帝国CMS调用列表TAGS(list.var)简介,来源,还有伪静态方法.
直接上代码自己对应改 注意数据表名;

$tsql=$empire->query("select * from www_zzxiu_com_ecms_news_data_1 where id='$r[id]'");
while($tr=$empire->fetch($tsql)){
$a="$tr[infotags]";
$str=str_replace(',', ',', $a);
$tag='';
$t= explode(",", $str);
for($i=0;$i<count($t);$i++)
{
        if($t[$i])
        {
        
            $tsql=$empire->query("SELECT * FROM www_zzxiu_com_enewstags WHERE tagname = '".$t[$i]."'");
            while($trs=$empire->fetch($tsql)){
                $tagid=$trs[tagid];
            }
        
               $tagslink="/tag/".$tagid."/";
               $tag.="<a href='$tagslink' target='_blank' rel='category'><i class='dot'></i>".$t[$i]."</a>";
               
        }
}} 
if($r['befrom']=="") {$laiyuan=$public_r['add_www_zzxiu_com_name'];}else{$laiyuan=$r[befrom];}
$smalltext=esub($r[smalltext],170);
$listtemp='<div class="col-6 col-sm-6 col-md-4 col-lg-3">
    <article class="post post-grid type-post hentry hasintro" data-aos="zoom-in">
        <div class="entry-media">
            <div class="placeholder" style="padding-bottom: 66.666666666667%;">
                <a href="[!--titleurl--]" target="_blank">
                                        <img class="lazyload" data-src="[!--titlepic--]" alt="[!--title--]">
                                    </a>
            </div>
                    </div>
        <div class="entry-wrapper">
            <header class="entry-header">
                <h2 class="entry-title"><a href="[!--titleurl--]" title="[!--title--]" target="_blank" rel="bookmark">[!--title--]</a></h2> 
                <div class="entry-meta">
                    <span class="meta-category">
                                                   '.$tag.'
                                               
                                                                    </span>
                </div>
            </header>
                        <div class="entry-excerpt u-text-format">
    介绍:[!--smalltext--]</div>
                        <div class="entry-footer">
                <a href="[!--titleurl--]" target="_blank"><time datetime="[!--newstime--]"><i class="fa fa-clock-o"></i> [!--newstime--]</time></a>
             
                
<a href="[!--titleurl--]"><span class="price"><i class="fa fa-rmb"></i> [!--jg--]</span></a>            </div>
        </div>
    </article>
</div>';


声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益 请联系邮箱:312334557@qq.com 我们将配合处理!

原文地址:《帝国cms列表页面调用tag,简介和来源的方法》发布于2020-07-01 14:13:24