当前位置:首页 > 教程中心 > CMS教程 > DedeCMS

去除dedecms织梦升级友情链接增加织梦链投放链接

所属栏目:DedeCMS 时间:2013-12-13 来源:网络 作者:不详 点击:

方法如下: 点击后台 - 模板 - 标签源码管理 找到:

flink.lib.php                                  友情链接

点击更改:

将下列全部代码复制到里面替换,保存即可!

<?php
 if(!defined('DEDEINC'))
 {
  exit("Request Error!");
 }
 
function lib_flink(&$ctag,&$refObj)
 {
  global $dsql;
  $attlist="type|textall,row|24,titlelen|24,linktype|1,typeid|0";
  FillAttsDefault($ctag->CAttribute->Items,$attlist);
  extract($ctag->CAttribute->Items, EXTR_SKIP);
 
 $totalrow = $row;
  $revalue = '';
 
 $wsql = " where ischeck >= '$linktype' ";
  if($typeid == 0)
  {
   $wsql .= '';
  }
  else
  {
   $wsql .= "And typeid = '$typeid'";
  }
  if($type=='image')
  {
   $wsql .= " And logo<>'' ";
  }
  else if($type=='text')
  {
   $wsql .= " And logo='' ";
  }
 
 $equery = "Select * from dede_flink $wsql order by sortrank asc limit 0,$totalrow";
 
 if(trim($ctag->GetInnerText())=='') $innertext = "<li>[field:link /]</li>";
  else $innertext = $ctag->GetInnerText();
   
  $dsql->SetQuery($equery);
  $dsql->Execute();
  while($dbrow=$dsql->GetObject())
  {
   if($type=='text'||$type=='textall')
   {
    $link = "<a href='".$dbrow->url."' target='_blank'>".cn_substr($dbrow->webname,$titlelen)."</a> ";
   }
   else if($type=='image')
   {
    $link = "<a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' width='88' height='31' border='0'></a> ";
   }
   else
   {
    if($dbrow->logo=='')
    {
     $link = "<a href='".$dbrow->url."' target='_blank'>".cn_substr($dbrow->webname,$titlelen)."</a> ";
    }
    else
    {
     $link = "<a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' width='88' height='31' border='0'></a> ";
    }
   }
   $rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $row['url'], $innertext);
    $rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $row['webname'], $rbtext);
    $rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $row['logo'], $rbtext);
    $rbtext = preg_replace("/\[field:link([\/\s]{0,})\]/isU", $link, $rbtext);
    $revalue .= $rbtext;
  }
  return $revalue;
 }
 ?>

注意下gbk和uft8的编码。建议先复制到dreamweaver再复制到后台编辑器里即可!

请站长喝杯咖啡?

站长一直坚持白天工作、晚上熬夜更新素材,付出了巨大的精力和时间,其中的辛酸难以言述。

坚持免积分、免登录、无任何限制下载!如果本站素材对你有用,不妨考虑请站长喝杯咖啡鼓励一下!

标签:

你应该也喜欢这些吧

共有 0 条评论

给个评价吧

验证码: