电脑技术学习

dede3.01局部加省略号

admin

调用举例: CODE:{dede:arclist row="22" titlelen="24" limit="1,23" title_slh="…"}<dt><a href="[field:arcurl /]">[field:title /]</a></dt>{/dede:arclist}[Copy to clipboard]

演示:http://my.bbsou.com/index.html 最顶上的最近更新部分
改法:
打开文件includeinc_arcpart_view.php

找到:
CODE: $channelid,
$ctag->GetAtt("limit")[Copy to clipboard]
改为:
CODE: $channelid,
$ctag->GetAtt("limit"),
$ctag->GetAtt("title_slh")[Copy to clipboard]
找到:
CODE:$row["title"] = cn_substr($row["title"],$titlelen);[Copy to clipboard]
改为:
CODE: //zouql标题没有显示完全后面显示的省略号…,默认为空则不开启本功能
if ($title_slh != "") $slh = strlen($title_slh);
$row["title_full"] = $row["title"];
$row["title"] = cn_substr($row["title"],$titlelen);
$row["title_2"] = cn_substr($row["title_full"],$titlelen-$slh);
if($row["title"] != $row["title_full"]) $row["title"] = $row["title_2"].$title_slh;