"Manage Tags" -> "Import Tags"; then add "[ in the content template echoinfozt]0[/echoinfozt]” tag can be called."/> "Manage Tags" -> "Import Tags"; then add "[ in the content template echoinfozt]0[/echoinfozt]” tag can be called.">
Home > Article > CMS Tutorial > How to call the topic of Empire CMS 7.0? The topic to which this information belongs has a link.
How to call the topic to which this information belongs in Empire cms 7.0, with a link to the topic?
Empire cms called the topic to which this information belongs before 7.0. The system itself did not have such a function. You need to write your own plug-in or code
It is recommended to study "Empire cms Tutorial》
The method has been provided in the official forum of Empire cms, but it is not applicable to Empire cms7.0
==============This is Empire cms7 .0 Methods for previous versions =============
Demo:
tagDownload:
http://www.phome.net/ecms47/bq/echoinfozt/echoinfozt.zip
****************** ***** Tag import steps ********************
Log in to the backend->"Template Management"->"Manage Tags" ->"Import tag":
Note: Select the tag file in the compressed package: "echoinfozt1199799878.bq"
(Remember to copy the function content to e/class/userfun after importing. php file)
************************ Tag usage ****************** **
Add the call tag "[echoinfozt]0[/echoinfozt]" to the content template.
You can open the code in /e/class/userfun.php and take a look.
The code is as follows:
function user_EchoInfoZtBq($ecms=0){ global $class_zr,$navinfor; if(empty($navinfor[ztid])||$navinfor[ztid]=='|') { return ''; } $zt=''; $r=explode('|',$navinfor[ztid]); $c=count($r); for($i=1;$i<$c-1;$i++) { $ztid=$r[$i];//专题ID $ztname=$class_zr[$ztid][ztname]; if($ztname) { $zr[ztid]=$ztid; $ztlink=sys_ReturnBqZtname($zr);//专题链接 $zt.="".$class_zr[$r[$i]][ztname].","; } } if($zt) { echo substr($zt,0,strlen($zt)-1); } }
============ =======The topic to which the calling information of Empire cms7.0 belongs================
But unfortunately, with Empire cms7.0, the above method is no longer possible. Used, because there is no ztid field in the information table. Previously, the cache file of the topic was read based on this ztid
to obtain the topic name and topic link
in the empire cms7.0 The topic information has been placed in the table _enewsztinfo
If you want to call it, you must read the data table again
The following is the code I wrote, which can be placed directly in the content template Use
The code is as follows:
$sql=$empire->query("SELECT DISTINCT ztid FROM {$dbtbpre}enewsztinfo where id='$navinfor[id]' and classid=$navinfor[classid] ;"); while($r=$empire->fetch($sql)) { $ztid=$r[ztid]; $ztname=$class_zr[$ztid][ztname]; if($ztname) { $zr[ztid]=$ztid; $ztlink=sys_ReturnBqZtname($zr);//专题链接 $zt.="".$ztname.","; } } if($zt)$zt= substr($zt,0,strlen($zt)-1);
$zt is the topic information with links, which can be displayed
The above is the detailed content of How to call the topic of Empire CMS 7.0? The topic to which this information belongs has a link.. For more information, please follow other related articles on the PHP Chinese website!