建站教学网,让你建站更便捷和轻松!
您当前的位置:首页 > CMS建站

帝国cms列表读取tag名称和tagid方法

来源:建站教学网  时间:2016-09-18 20:11:22

 $tagstr='';

$tsql=$empire->query("select tagid from {$dbtbpre}enewstagsdata where id='$r[id]' and classid='$r[classid]' ");
while($tr=$empire->fetch($tsql))
{
$tt=$empire->fetch1("select * from {$dbtbpre}enewstags where tagid=".$tr['tagid']." limit 1");
if(!$tt['tagid'])
{
continue;
}
else
{
$tagslink=$public_r['newsurl'].'e/tags/?tagid='.$tt['tagid'];
}
$tagstr.='<a title="'.$tt['tagname'].'" target="_blank" href="'.$tagslink.'">'.$tt['tagname'].'</a>';
}
 
$titlepic=$r[titlepic];
if($titlepic=='')
{
$listtemp='<div class="xwt">
<div class="xwt_a"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank">[!--title--]</a></div>
<div class="xwt_b">[!--smalltext--]</div>
<div class="xwt_c">标签:'.$tagstr.'</div>
</div>';
}
else
{
$listtemp='<div class="xwt">
<div class="xwt_left"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank"><img src="[!--titlepic--]"></a></div>
<div class="xwt_right">
<div class="xwt_right_a"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank">[!--title--]</a></div>
<div class="xwt_right_b">[!--smalltext--]</div>
<div class="xwt_right_c">标签:'.$tagstr.'</div>
</div>
</div>';
}
 
 
 
 
 
 
 
 
 
$id=$r[id];
$newbook1=$empire->query("select * from phome_ecms_news_data_1 where id =".$id."");
$r1=$empire->fetch($newbook1);
$a="$r1[infotags]";
$str=str_replace(',', ',', $a);
$tag='';
$t= explode(",", $str);
            
for($i=0;$i<count($t);$i++)
{
if($t[$i])
{
$tagslink="/e/tags/?tagname=".urlencode($t[$i])."";
$tag.="<a href='$tagslink' target='_blank'>".$t[$i]."</a> ";
}
}
$titlepic=$r[titlepic];
if($titlepic=='')
{
$listtemp='<div class="xwt">
<div class="xwt_a"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank">[!--title--]</a></div>
<div class="xwt_b">[!--smalltext--]</div>
<div class="xwt_c">标签:'.$tag.'</div>
</div>';
}
else
{
$listtemp='<div class="xwt">
<div class="xwt_left"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank"><img src="[!--titlepic--]"></a></div>
<div class="xwt_right">
<div class="xwt_right_a"><a href="http://www.jzread.com/cms/2016-09-18/3358.html" target="_blank">[!--title--]</a></div>
<div class="xwt_right_b">[!--smalltext--]</div>
<div class="xwt_right_c">标签:'.$tag.'</div>
</div>
</div>';
}

责任编辑:风中的自由

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
CopyRight 2008-2009, JZREAD.COM, Inc. All Rights Reserved
皖ICP备09015033号