方法1、调用信息的全部tag
[e:loop={"select id, title, titleurl, smalltext, newstime, titlepic from [!db.pre!]ecms_news order by id desc limit 30",0,24,0}]
<?php
$tags='';
$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_1 where id='$bqr[id]'");
$tag1=''.$fr[infotags].'';
$r_tag=explode(",",$tag1);
{
for($i=0;$i<count($r_tag);$i++)
if($r_tag[$i])
{
$tagslink=$public_r[newsurl]."e/tags/?tagname=".$r_tag[$i];//链接
$tags.="<a href='$tagslink' target='_blank'>".$r_tag[$i]."</a> ";
}
if(empty($fr[infotags]))
{
$tags="无";
}
}
?>
<?=esub($bqr[title],108)?> | <?=$tags?>
<br/><br/>
[/e:loop]
或[e:loop={34,10,0,0}]格式
限制数量,把$i<count($r_tag)修改为$i<count($r_tag)&&$i<限制数量
-----------------------------------------------------------------------------
方法2、调用信息的tag时,可控制输出个数
[e:loop={"select id, title, titleurl, smalltext, newstime, titlepic from [!db.pre!]ecms_news order by id desc limit 30",0,24,0}]
<?php
$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_1 where id='$bqr[id]'");
$tag1=''.$fr[infotags].'';
$r_tag=explode(",",$tag1);
for($p=0;$i<count($r_tag);$i++)
?>
<?=esub($bqr[title],108)?> | <a href="<?=$public_r['newsurl']?>e/tags/?tagname=<?=$r_tag[0]?>" target='_blank'><?=$r_tag[0]?></a> <a href="<?=$public_r['newsurl']?>e/tags/?tagname=<?=$r_tag[1]?>" target='_blank'><?=$r_tag[1]?></a> <a href="<?=$public_r['newsurl']?>e/tags/?tagname=<?=$r_tag[2]?>" target='_blank'><?=$r_tag[2]?></a> <a href="<?=$public_r['newsurl']?>e/tags/?tagname=<?=$r_tag[3]?>" target='_blank'><?=$r_tag[3]?></a>
<br/><br/>
[/e:loop]
或[e:loop={34,10,0,0}]格式
限制数量,把$i<count($r_tag)修改为$i<count($r_tag)&&$i<限制数量
-----------------------------------------------------------------------------
方法3、调用信息的tag时,可控制输出个数
[e:loop={34,10,0,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
<?
$tbname=$class_r[$bqr[classid]][tbname];
$fb=$bqr[stb];
$ftbname=$dbtbpre."ecms_".$tbname."_data_".$fb;
$navinfor['infotags'] = $empire->gettotal("select infotags as total from $ftbname where id='$bqr[id]'"); //结果赋值给$navinfor就是为了使用 showtags标签的selfinfo
?>
Tags:[showtags]'selfinfo',10,0,'',0,'',' ',0,'','tagname'[/showtags]<br>
[/e:loop]
注释:
[showtags]'selfinfo',10,0,'num desc',0,'s,r',' ',1,'tagname'[/showtags]
'selfinfo'=当前信息ID,
10=调用总数量,
0=每行显示数量,
num desc=显示排序,
0=只显示推荐的(0为不显示,1为显示),
s,r=推荐TAGS属性(s为加粗,r为加红),
''=显示间隔符(一般为空格符: ),
1=显示信息数量(0为不显示,1为显示),
'tagname'=链接使用变量(一般为tagname和tagid)
查看原内容