花魁直播高品质美女在线视频互动社区 - 花魁直播官方版

 歡迎來到素材無憂網(wǎng),按 + 收藏我們
登錄 注冊 退出 找回密碼

帝國CMS內(nèi)容頁調(diào)用TAG的5種方法!包括PHP和靈動(dòng)還有樣式改造!

時(shí)間: 2024-02-25 09:30 閱讀: 作者:素材無憂網(wǎng)




方法1、
調(diào)用10條當(dāng)前tag
[showtags]'selfinfo',10,0,'',0,'',' ',0,'','tagname'[/showtags]


方法2、
內(nèi)容頁調(diào)用tag,按tagname調(diào)用

Tags: $str=str_replace(',', ',', $a);
$tag='';
$t= explode(",", $str);

for($i=0;$i {
if($t[$i])
{
$tagslink="[!--news.url--]e/tags/?tagname=".urlencode($t[$i])."&tempid=1";
$tag.="".$t[$i]." ";
}
}
echo $tag;
?>






或,按tagname調(diào)用


$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id='$navinfor[id]'");
$infotags=$fr['infotags'];//這個(gè)就是infotags字段內(nèi)容
$tag='';
$t=explode(',',$infotags);//去逗號(hào)
$d=count($t);
for($i=0;$i {
if($t[$i])
{
$tagslink="[!--news.url--]e/tags/?tagname=".urlencode($t[$i])."&tempid=1";
$tag.="".$t[$i]." ";
}
}
echo $tag;
?>


或,按id調(diào)用


$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 {
if($t[$i])
{ $datar=$empire->fetch1("select tagid from {$dbtbpre}enewstags where tagname='$t[$i]' limit 1");
$tagslink="[!--news.url--]e/tags/?tagid=".$datar[tagid]."";
$tag.="".$t[$i]." ";
}
}
echo $tag;
?>


注釋:

限制數(shù)量,把$i

mid=1數(shù)據(jù)模型id tempid=1模型的模板id orderby排列方式 classid=34欄目id &line=5調(diào)用條數(shù)

如:上面的 &tempid=1

---------------------------------------------------------------------------------------------------------------
方法3、tags標(biāo)簽實(shí)現(xiàn)多顏色樣式
$ecms_bq_sql=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewstagsdata where classid='$navinfor[classid]' and id='$navinfor[id]' order by tagid",10,24,0);
$bqno=0;
while($bqr=$empire->fetch($ecms_bq_sql))
{
$bqsr=sys_ReturnEcmsLoopStext($bqr);
$bqno++;
?>

$ecms_bq_sql2=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewstags where tagid='$bqr[tagid]' order by tagid",1,24,0);
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>



}
}
?>

接著在css中定義標(biāo)簽的樣式,這個(gè)可以自己定義。
.tag-1{background:#ff7094;}
.tag-2{background:#94b770;}
.tag-3{background:#db94ff;}
.tag-4{background:#399;}
.tag-5{background:#f60;}


注釋:mid=1數(shù)據(jù)模型id tempid=1模型的模板id orderby排列方式 classid=34欄目id

如:上面的 &tempid=1

---------------------------------------------------------------------------------------------------------------
方法4、

[e:loop={"select a.*,b.* from [!db.pre!]enewstags a LEFT JOIN [!db.pre!]enewstagsdata b ON a.tagid=b.tagid where b.classid='$navinfor[classid]' and b.id='$navinfor[id]' group by b.tagid order by a.num desc limit 100",0,24,0}]
e/tags/?tagname=' title='個(gè)'>()
[/e:loop]

---------------------------------------------------------------------------------------------------------------
方法5、
$tsql=$empire->query("select * from {$dbtbpre}enewstagsdata where id='$navinfor[id]'order by id asc limit 7");
while($tr=$empire->fetch($tsql)){
$tag=$empire->fetch1("select * from {$dbtbpre}enewstags where tagid='$tr[tagid]' limit 1");
?>



方法6.(網(wǎng)友提供,感謝)
$tbname="news"; //"news"為新聞數(shù)據(jù)表名稱
$ftbname=$dbtbpre."ecms_".$tbname."_data_".$navinfor['stb'];
$hlt = $empire->fetch1("select infotags from {$ftbname} where id='$navinfor[id]'");
$keyr=explode(',',$hlt[infotags]);
for($i=0;$i{
echo ''.$keyr[$i].' ';
}
?>



$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id='$navinfor[id]'");
$keyr=explode(',',$fr[infotags]);
for($i=0;$i{
echo ''.$keyr[$i].' ';
}
?>



$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id='$navinfor[id]'");
$infotags=$fr['infotags'];
$r_tag=explode(",",$infotags);
for($i=0;$i if($r_tag[$i]){
$tagslink=$public_r[newsurl]."e/tags/?tagname=".urlencode($r_tag[$i]);
$tags.="".$r_tag[$i]."";
}
}
?>
tag:

注釋:限制數(shù)量,把$i

版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!

轉(zhuǎn)載請注明: 帝國CMS內(nèi)容頁調(diào)用TAG的5種方法!包括PHP和靈動(dòng)還有樣式改造!

相關(guān)文章
模板推薦