Empire CMS template tags: How to call TAGS tags on homepage/list page/content page!

888u

Last update at :2024-03-14,Edit by888u

Many netizens often ask how to use TAG tags on the home page, list page, and content page of the Empire CMS template? Today, the editor will briefly introduce the Empire CMS template tags: the method of calling TAGS tags on the homepage/list page/content page! Let’s take a look below!

The first step is to paste the following code into "userfun.php".

function taglinks($aid, $num=5, $tbname='news') { global $public_r,$dbtbpre,$empire,$navinfor,$class_r; $qr = $empire->fetch1("select rewritetags from {$dbtbpre}enewspublic limit 1"); $sr = $empire->fetch1("select stb from {$dbtbpre}ecms_{$tbname} where id=$aid"); $fr = $empire->fetch1("select infotags from {$dbtbpre}ecms_{$tbname}_data_{$sr[stb]} where id=$aid"); $tagstr = ''.$fr[infotags].''; $tagarr = explode(",", $tagstr); for($i=0; $i "; } } return $tags; } ?>

If you need to call the tag in tagid form, then query the database in word; modify the following code:

if($tagarr[$i]) { if($qr[rewritetags]) { // Turn on pseudo-static $link = $public_r[newsurl]."tags-".urlencode($tagarr[$i])."-0.html"; } else { // dynamic link $link = $public_r[newsurl]."e/tags/?tagname=".urlencode($tagarr[$i]); } $tags .= "".$tagarr[$i]." "; }

The modification is as follows:

if($tagarr[$i]) { $tr = $empire->fetch1("select * from {$dbtbpre}enewstags where tagname='".$tagarr[$i]."'"); if($qr[rewritetags]) { // Turn on pseudo-static $link = $public_r[newsurl]."tags-etagid".$tr[tagid]."-0.html"; } else { // dynamic link $link = $public_r[newsurl]."e/tags/?tagid=".$tr[tagid]; } $tags .= "".$tagarr[$i]." "; }

The second step is to call parameters and tags into the template

Parameters: article ID, number of calling tags, table name

Smart label call (home page):

List page, check list.var to use program code, code example:

$listtemp='
  • [!--title--]

    [!--smalltext--]

    '.taglinks($r[id]).'

  • ';

    Content page call:

    Recommended site search: server, managed host, domain name provider, cheapest dual-line space, network server, this website server is in the United States, Ministry of Industry and Information Technology ICP filing, Taiwan proxy server, foreign space rental, how to buy virtual host,

    p>

    Empire CMS template tags: How to call TAGS tags on homepage/list page/content page!

    All copyrights belong to 888u unless special state
    取消
    微信二维码
    微信二维码
    支付宝二维码