Determine whether a member is logged in
<?php if(!$_COOKIE[ecmsmlusername]){ $srr="登录可见"; }else{ $srr="[!--lbsly--]"; } ?>
[!--news.url--]skin/default/ [e:loop={"select classid,classname,bname from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop] [e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop] <?php $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]); $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的顶级栏目ID $rs=$empire->fetch1("select * from phome_enewsclass where classid=$topbclassid"); ?> _<?=$rs['bname']?>_<?=$public_r[sitename]?> 顶级栏目名称+网站标题 <?=$class_r[$GLOBALS[navclassid]][bname]?> 得到当前栏目的名称 <title>[!--pagetitle--] </title> 或 <title><?=$class_r[$GLOBALS[navclassid]][bname]?></title> <meta name="keywords" content="[!--pagekey--]" /> <meta name="description" content="[!--pagedes--]" />
isgood=1 一级推荐 firsttitle=1 一级头条 [e:loop={10,3,0,0}] 10当前栏目,3显示条数, [e:loop={4,1000,0,1,'leib="楼市快讯"','id DESC'}] 1有图片的显示。 [e:loop={"select * from phome_ecms_xtgg where firsttitle=1 order by id DESC limit 20",6,24,0}] <?=$bqno?> [!--no.num--] 循环序号 <?=$bqsr['titleurl']?> <?=$bqr[title]?> <?=esub($bqr[title],8)?> [/e:loop]
=DoWapRepNewstext($r[newstext])?>
Time call tag: =date("Y-m-d",$bqr['newstime'])?>
List page
Your current location: [!--newsnav--]
[!--no.num--]
[!--show.listpage--]
Content page
[!--info.next--]Next article [!--info.pre--]Previous article
Use [!--onclick--] for universal tags and =$bqr[onclick]?> for smart tags; click volume
Copy code The code is as follows:
$titleurl=sys_ReturnBqTitleLink($navinfor); Get the URL of the current page
$url = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; Get the URL of the current page
sql statement
Copy code The code is as follows:
//Number of applicants
$num=$empire->gettotal("select count(*) as total from phome_enewsfeedback where kft='".$navinfor[title]."'");
?>
Sql statements often used by Empire CMS:
Please note that if it is Empire version 7.0, you need to remove checked=1
Copy code The code is as follows:
1. According to the latest article select * from [!db.pre!]ecms_news where checked=1 order by newstime desc limit 10
2. According to recommended articles select * from [!db.pre!]ecms_news where checked=1 and isgood=1 order by newstime desc limit 10
3. According to popular articles select * from [!db.pre!]ecms_news where checked=1 order by onclick desc limit 10
4. According to the headline news select * from [!db.pre!]ecms_news where checked=1 and firsttitle=1 order by newstime desc limit 10
5. Rank according to comments select * from [!db.pre!]ecms_news where checked=1 order by plnum desc limit 10
6. According to digg ranking select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc limit 10
7. According to voting ranking select * from [!db.pre!]ecms_news where checked=1 order by votenum desc limit 10
8. According to the download ranking select * from [!db.pre!]ecms_news where checked=1 order by totaldown desc limit 10
9. Ranking based on ratings select * from [!db.pre!]ecms_news where checked=1 order by infopfen desc limit 10
Tips included:
php ternary conditional operator:
Copy code The code is as follows:
=$bqr['ftitle']?$bqr['ftitle']:$bqr['title']?>
When calling the editor content in Smart or PHP query, you need to add stripslashes and delete the backslashes, for example:
Copy code The code is as follows:
=stripslashes($r['newstext'])?>
Current information ID of content page:
Copy code The code is as follows:
$navinfor['id']
List content template information ID:
Copy code The code is as follows:
$r['id']
Current column name:
Copy code The code is as follows:
$class_r[$GLOBALS['navclassid']]['classname'];
Current column’s parent column:
Copy code The code is as follows:
$class_r[$GLOBALS['navclassid']]['bclassid'];
Current column alias:
Copy code The code is as follows:
$class_r[$GLOBALS['navclassid']]['bname'];
Current column sub-column:
Copy code The code is as follows:
$class_r[$GLOBALS['navclassid']]['sonclass'];
To determine whether the current column is the final column:
Copy code The code is as follows:
$class_r[$GLOBALS['navclassid']]['islast'];
Whether the current column has reviewed information:
Copy code The code is as follows:
$GLOBALS['num']==0 means no information
Introduction of php path writing method in empire cms (example is the file is in the root directory)
Copy code The code is as follows:
Exclude top posts, headlines, recommendations, etc., sql additional conditions:
Copy code The code is as follows:
'istop=0 and isgood=0 and firsttitle=0'
Superior column id:
<?php $bclassid=$class_r[$GLOBALS[navclassid]][bclassid]; $bbclassid=$class_r[$bclassid][bclassid]; echo $bbclassid; ?> $bbclassid就是上上级父栏目id
Jump to the specified page after submission, login, feedback, message, etc.:
Copy code The code is as follows:
Number of statistics collected:
Copy code The code is as follows:
$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");
?>
=$favas?>That’s the number of favorites for this message
List and combination items judge that there is currently no information and give a prompt:
if($GLOBALS['num']=='0'){
?>
Sorry, there is no information at the moment!
Dynamic usage:
Site name: =$public_r['sitename']?>
Website address: =$public_r['newsurl']?>
The empire’s own time conversion function:
Copy code The code is as follows:
=format_datetime($bqr[newstime],'Y-m-d')?>
This function comes with its own judgment, which is quite good and recommended.
Determine whether the content has pictures. If there are no pictures, the ads in the text will be displayed. If there are pictures, they will not be displayed:
Copy code The code is as follows:
$string=$navinfor['newstext'];//Content field
$some="
$num=explode($some,$string);
if(count($num)>1){//Determine whether there are pictures in the content
?>
[!--newstext--]
}else{
?>
Intercept and add filter tags:
Copy code The code is as follows:
=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>
Content page or smart tag supports title attribute
Content page:
Copy code The code is as follows:
=DoTitleFont($navinfor[titlefont],$navinfor[title])?>
Smart tags:
Copy code The code is as follows:
=DoTitleFont($bqr[titlefont],$bqr[title])?>
Number of words for title interception Title attributes:
Copy code The code is as follows:
=DoTitleFont($bqr[titlefont],esub($bqr[title],32,'...'))?>
The above is the entire content of this article, I hope you all like it.