欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

dedecms列表中顯示文章完整標題的解決辦法

 更新時間:2008年03月23日 18:12:52   作者:  
dedecms通過標簽arclist輸出文章列表的時候,文章的標題會被titlelen屬性截取為指定長度的字符串, 但是我們在實際使用的過程中,經(jīng)常會用到文章標題的完整內(nèi)容,在dedecms中如何實現(xiàn)呢,方法很多,這里推薦通過小小的修改程序,達到目的。
解決方法:

修改include\inc\inc_fun_SpGetArcList.php文件,修改函數(shù)SpGetArcList,找到以下代碼:

復制代碼 代碼如下:

$row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; 
           $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>"; 
           $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>"; 
           $row['title'] = cn_substr($row['title'],$titlelen); 
           $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; 

           if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>"; 
           if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>"; 

修改為:

復制代碼 代碼如下:

$row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; 
           $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>"; 
           $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>"; 
           $row['alltitle'] = $row['title'];  //增加文章標題屬性支持 
           $row['title'] = cn_substr($row['title'],$titlelen); 
           $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; 

           if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>"; 
           if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>"; 
代碼中增加了

$row['alltitle'] = $row['title'];
重新定義一個數(shù)組變量存放標題的內(nèi)容。

然后你在模板中就可以使用類似[field:alltitle/]這樣的標簽調(diào)用文章完整標題。
例如:

復制代碼 代碼如下:

{dede:arclist typeid='0' row='6' titlelen=32 orderby='pubdate'} 
 <li><a href="[field:filename /]" title="[field:alltitle/]">[field:title/]</a></li> 
 {/dede:arclist} 

That about does it - enjoy!

相關文章

最新評論