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

2021-06-15 21:57:25 字數 2592 閱讀 5004

dedecms通過標籤arclist輸出文章列表的時候,文章的標題會被titlelen屬性擷取為指定長度的字串, 但是我們在實際使用的過程中,經常會用到文章標題的完整內容,在dedecms中如何實現呢,方法很多,這裡推薦通過小小的修改程式,達到目的。

解決方法:

修改include/inc/inc_fun_spgetarclist.php檔案,修改函式spgetarclist,找到以下**:

$row['

typelink'] 

="".

$row['

typeurl']

."'>".

$row['

typename']

."";

$row['

image'] 

=".$row['

picname']

."' border='0' width='$imgwidth' height='$imgheight' alt='".

ereg_replace("

['>

"",$row['

title'])

."'>";

$row['

imglink'] 

="".

$row['

filename']

."'>".

$row['

image']

."";

$row['

title'] 

=cn_substr(

$row['

title']

,$titlelen

);$row['

textlink'] 

="".

$row['

filename']

."'>".

$row['

title']

."";

if($row['

color']

!=""

) $row['

title'] 

="".

$row['

color']

."'>".

$row['

title']

."";

if($row['

iscommend']

==5||$row['

iscommend']

==16

) $row['

title'] 

="".

$row['

title']

."";

修改為:

$row['

typelink'] 

="".

$row['

typeurl']

."'>".

$row['

typename']

."";

$row['

image'] 

=".$row['

picname']

."' border='0' width='$imgwidth' height='$imgheight' alt='".

ereg_replace("

['>

"",$row['

title'])

."'>";

$row['

imglink'] 

="".

$row['

filename']

."'>".

$row['

image']

."";

$row['

alltitle'] 

=$row['

title

'];  

//增加文章標題屬性支援

$row['

title'] 

=cn_substr(

$row['

title']

,$titlelen

);$row['

textlink'] 

="".

$row['

filename']

."'>".

$row['

title']

."";

if($row['

color']

!=""

) $row['

title'] 

="".

$row['

color']

."'>".

$row['

title']

."";

if($row['

iscommend']

==5||$row['

iscommend']

==16

) $row['

title'] 

="".

$row['

title']

."";

**中增加了

$row['alltitle'] = $row['title'];

重新定義乙個陣列變數存放標題的內容。

[field:title/]

the end.

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

dedecms列表中顯示文章完整標題的解決辦法 解決方法 修改include inc inc fun spgetarclist.php檔案,dedecms 修改函式spgetarclist,找到以下 複製 如下 row typelink row typename row image row imgl...

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

解決方法 修改include inc inc fun spgetarclist.php檔案,修改函式spgetarclist,找到以下 複製 如下 row typelink row typename row image www.cppcns.com row title row imglink row...

dedeCMS 文章顯示常用方法

列表隔5行加一行線 target blank field title function cn substr me,48 field pubdate runphp yes a strftime m d me b strftime m d me ntime time day3 3600 24 if nt...