导读:织梦技术织梦技术织梦cms为{dede:tag}增加[field:global.autoindex/]标签的方法,首先打开/include/taglib/tag.lib.php。
织梦cms为{dede:tag}增加[field:global.autoindex/]标签的方法,首先打开/include/taglib/tag.lib.php文件,找到下列代码,(注意备份好原有文件,以免发生错误)
$dsql->SetQuery("SELECT * FROM `tagindex` $addsql ORDER BY $orderby LIMIT 0,$num");
$dsql->Execute();
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field','[',']');
$ctp->LoadSource($InnerText);
while($row = $dsql->GetArray())
{ $row['keyword'] = $row['tag']; $row['tag'] = dede_htmlspecialchars($row['tag']);
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/"; $row['highlight'] = 0;
if($row['monthcc']>1000 || $row['weekcc']>300 )
{
$row['highlight'] = mt_rand(3,4);
}
else if($row['count']>3000)
{
$row['highlight'] = mt_rand(5,6);
}
else
{
$row['highlight'] = mt_rand(1,2);
}
foreach($ctp->CTags as $tagid=>$ctag)
{ if(isset($row[$ctag->GetName()]))
{
$ctp->Assign($tagid,$row[$ctag->GetName()]);
} }
$revalue .= $ctp->GetResult();织梦首页模板
}
|
将以上代码修改为
$dsql->SetQuery("SELECT * FROM `tagindex` $addsql ORDER BY $orderby LIMIT 0,$num");
$dsql->Execute();
$GLOBALS['autoindex'] = 0;
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field','[',']');
$ctp->LoadSource($InnerText);
while(
$row = $dsql->GetArray())
{
$row['keyword'] = $row['tag']; $row['tag'] = dede_htmlspecialchars($row['tag']);
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
$row['highlight'] = 0;
if($row['monthcc']>1000 || $row['weekcc']>300 )
{
$row['highlight'] = mt_rand(3,4);
}
else if($row['count']>3000)
{ $row['highlight'] = mt_rand(5,6); }
else { $row['highlight'] = mt_rand(1,2); }
foreach($ctp->CTags模板织梦 as $tagid=>$ctag)
{
if(isset($row[$ctag->GetName()]))
{ $ctp->Assign($tagid,$row[$ctag->GetName()]);
} }
$revalue .= $ctp->GetResult(); $GLOBALS['dede下瓻模板下载autoindex']++;
}
|
这样就可以实现了
实现后的效果如下:
相关。
关键词标签: 织梦 标签 标题
声明: 本文由我的SEOUC技术文章主页发布于:2023-07-18 ,文章织梦cms为dede:tag标签增加[field:global.auto,织梦技术主要讲述标签,标题,织梦网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_29149.html