DEDE5.3将跳转网址改成直接链接

 

1.列表页的修改方法如下:
include\arc.listview.class.php : 591
(修改SQL语句
)
//
如果不用默认的sortrankid排序,使用联合查询(数据量大时非常缓慢)

if(ereg(‘hot|click|lastpost’,$orderby))
{
$query = “Select arc.*,`$addtable`.redirecturl,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
$addField
from `dede_archives` arc
left join `dede_arctype` tp on arc.typeid=tp.id
$addJoin
where {$this->addSql} $ordersql limit $limitstart,$row”;
}

include\arc.listview.class.php : 618(修改SQL语句)
$query = “Select arc.*,`$addtable`.redirecturl,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,
tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
$addField
from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id
$addJoin
where arc.id in($idstr) $ordersql “;

include\arc.listview.class.php : 656(“$row[‘filename’] = $row[‘arcurl’] = GetFileUrl(…”前加句判断)
if ($row[‘redirecturl’]) $row[‘filename’] = $row[‘arcurl’]  = $row[‘redirecturl’] ; else//
跳转链接转直接链接

2.首页的修改方法如下:
include\inc\arclist.lib.php :  183
(修改SQL语句
)
//12.26
修改跳转

$addtable = [url=mailto:]’dede_addonarticle‘[/url];
 $query = “Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,
  tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,$addtable.redirecturl
   from `$maintable` arc
   inner join [url=mailto:`dede_arctype]`dede_arctype[/url]` tp on tp.id=arc.typeid
  left outer join $addtable   on  arc.id = $addtable.aid
  $orwhere $ordersql $limitsql”;

include\inc\arclist.lib.php :  227(“$row[‘filename’] = $row[‘arcurl’] = GetFileUrl(…”前加句判断判断)
if ($row[‘redirecturl’]) $row[‘filename’] = $row[‘arcurl’]  = $row[‘redirecturl’] ; else//
跳转链接转直接链接

注意一点,从这往上还有几处要修改一下,因为该语句中typeid比较含糊不清,要改成arc.typeid,否则发布文章啥的有问题,直接替换如下代码:
if(!empty($typeid))
  {
   //
指定了多个栏目时,不再获取子类的
id
   if(ereg(‘,’,$typeid)) $orwheres[] = ” arc.typeid in ($typeid) “;
   else
   {
    //
处理交叉栏目

    $CrossID = ”;
    if((isset($envs[‘cross’]) || $ctag->GetAtt(‘cross’)==’1′ ) && $ctag->GetAtt(‘nocross’)!=’1′)
    {
     $arr = $dsql->GetOne(“Select `id`,`topid`,`cross`,`crossid`,`ispart`,`typename` From [url=mailto:`dede_arctype]`dede_arctype[/url]` where id=’$typeid’ “);
     if($arr[‘cross’]==0 || ($arr[‘cross’]==2 && trim($arr[‘crossid’]==”)))
     $orwheres[] = ‘ arc.typeid in (‘.GetSonIds($typeid).’)’;
     else
     {
      $selquery = ”;
      if($arr[‘cross’]==1) {
       $selquery = “Select id,topid From [url=mailto:`dede_arctype]`dede_arctype[/url]` where typename like ‘{$arr[‘typename’]}’ And id<>'{$typeid}’ And topid<>'{$typeid}’  “;
      }
      else {
       $arr[‘crossid’] = ereg_replace(‘[^0-9,]’,”,trim($arr[‘crossid’]));
       if($arr[‘crossid’]!=”) $selquery = “Select id,topid From [url=mailto:`dede_arctype]`dede_arctype[/url]` where id in(‘{$arr[‘crossid’]}’) And id<>'{$typeid}’ And topid<>'{$typeid}’  “;
      }
      if($selquery!=”)
      {
       $dsql->SetQuery($selquery);
       $dsql->Execute();
       while($arr = $dsql->GetArray()) {
        $CrossID .= ($CrossID==” ? $arr[‘id’] : ‘,’.$arr[‘id’]);
       }
      }
     }
    }
    if($CrossID==”) $orwheres[] = ‘ arc.typeid in (‘.GetSonIds($typeid).’)’;
    else $orwheres[] = ‘ arc.typeid in (‘.GetSonIds($typeid).’,’.$CrossID.’)’;
   }
  }

 



发表评论

您的电子邮箱地址不会被公开。

49 − 43 =