• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    织梦cms为dede:tag标签增加[field:global.autoindex/]标签
    POST TIME:2017-11-12 23:31
    织梦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['autoindex']++; 
    }
    
    这样就可以实现了
    实现后的效果如下:

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!