您的位置:首页 > 帝国cms教程

帝国cms如何把文章tags标签当做keywords关键字使用调用

2023-11-07 10:44:51 帝国cms教程 227

帝国cms多图不同样式展示,
列表内容模板(list.var) (*)
代码:注意:一定要勾选(使用程序代码)
帝国cms的文章tags标签当做keywords关键字使用调用
需求:每篇文章都有自己的tags,现在需要将每篇文章的keywords关键字位置调用该文章的tags标签,
<?         
$tbname=$class_r[$navinfor['classid']]['tbname'];
$ftbname=$dbtbpre."ecms_".$tbname."_data_".$navinfor['stb'];
$hlt = $empire->fetch1("select infotags from {$ftbname} where id='$navinfor[id]'");   
            $a=$hlt[infotags];
            $str=str_replace(',', ',', $a);
            $tag='';
            $t= explode(",", $str);
                    for($i=0;$i<count($t);$i++)
                    {
                            if($t[$i])
                            {    $datar=$empire->fetch1("select tagid from {$dbtbpre}enewstags where tagname='$t[$i]' limit 1");   
                                 $tag.=$t[$i].",";
                            }
            }
            ?>
调用:
 <meta name="keywords" content="<?php echo $tag; ?>"/>

相关推荐