不少採用帝國CMS建站的站長都會遇到標題過長致使頁面排版錯亂的狀況,這時候每每須要用標題截取並追加上省略號的方法予以解決。對此,帝國CMS萬能標籤標題截取後自動加入省略號,沒有達到字數的則不加省略號可以使用以下方法予以解決:php
1.打開e/class/connect.phpsql
查詢ReplaceListVars函數,大約在2224行找到
函數
if(!empty($subtitle))//截取字符
在下面加入代碼:fetch
if($r[title] != $r[oldtitle])
{
$value=sub($value,0,$subtitle,false,'...');
}
修改後代碼以下:spa
if(!empty($subtitle))//截取字符
{
if($r[title] != $r[oldtitle])
{
$value=sub($value,0,$subtitle,false,'...');
}
}
2. 打開e/class/t_functions.phpcode
大約在637行找到:
it
$r[oldtitle]=$r[title];
大約在638行,即在$r[oldtitle]=$r[title];下面加:
io
$r[title]=sub($r[title],0,$strlen,false);
修改後的代碼以下:function
while($r=$empire->fetch($sql)) { $r[oldtitle]=$r[title]; //修改 $r[title]=sub($r[title],0,$strlen,false);