Summary of commonly used tags in Empire CMS, summary of Empire CMS_PHP tutorial

WBOY
Release: 2016-07-13 09:47:13
Original
917 people have browsed it

A summary of commonly used tags in Empire CMS, a summary of Empire CMS

Determine whether a member is logged in

<&#63;php
if(!$_COOKIE[ecmsmlusername]){
$srr="登录可见";
}else{
$srr="[!--lbsly--]";
}
&#63;>
Copy after login
[!--news.url--]skin/default/

[e:loop={"select classid,classname,bname from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><&#63;=$bqr[bname]&#63;></title>[/e:loop]

[e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><&#63;=$bqr[bname]&#63;></title>[/e:loop]

<&#63;php
$fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]&#63;$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的顶级栏目ID
$rs=$empire->fetch1("select * from phome_enewsclass where classid=$topbclassid");
&#63;>
_<&#63;=$rs['bname']&#63;>_<&#63;=$public_r[sitename]&#63;> 顶级栏目名称+网站标题

<&#63;=$class_r[$GLOBALS[navclassid]][bname]&#63;> 得到当前栏目的名称
<title>[!--pagetitle--] </title> 或  <title><&#63;=$class_r[$GLOBALS[navclassid]][bname]&#63;></title>
<meta name="keywords" content="[!--pagekey--]" />
<meta name="description" content="[!--pagedes--]" />

Copy after login
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}]

<&#63;=$bqno&#63;> [!--no.num--] 循环序号

<&#63;=$bqsr['titleurl']&#63;> <&#63;=$bqr[title]&#63;> <&#63;=esub($bqr[title],8)&#63;>

[/e:loop]

Copy after login

Time call tag:


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 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:

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:

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:

<&#63;php
$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];
$bbclassid=$class_r[$bclassid][bclassid];
echo $bbclassid;
&#63;>
$bbclassid就是上上级父栏目id

Copy after login

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]'");
?>
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!


}else{
?>
[!--empirenews.listtemp--][!--empirenews.listtemp--]
}
?>
[/code]

Dynamic usage:

Site name:
Website address:

The empire’s own time conversion function:

Copy code The code is as follows:

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{
?>


[!--newstext--]
}
?>

Intercept and add filter tags:

Copy code The code is as follows:

Content page or smart tag supports title attribute
Content page:

Copy code The code is as follows:

Smart tags:

Copy code The code is as follows:

Number of words for title interception Title attributes:

Copy code The code is as follows:

The above is the entire content of this article, I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1027498.htmlTechArticleA summary of commonly used tags in empire cms, a summary of empire cms to determine whether a member is logged in phpif(!$_COOKIE[ecmsmlusername]){$ srr="Login visible";}else{$srr="[!--lbsly--]";} [!--news.url--]skin/default/...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!