dedecms5.5分类信息模块,让地区名字显示在列表title里面
一.修改include\taglib\infolink.lib.php
主要增加了
$fields['puper'] = $em_nativeplaces[$toptype];
与
$fields['puper'] .= ‘ - ‘ . $em;
改成以下代码
//地区链接
if(empty($nativeplace))
{
foreach($em_nativeplaces as $eid=>$em)
{
if($eid % 500 != 0) continue;
$fields['nativeplace'] .= ” {$em}\r\n”;
}
}
else
{
$sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 );
$toptype = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplace%500) ) );
$fields['nativeplace'] = “{$em_nativeplaces[$toptype]} >> “;
$fields['puper'] = $em_nativeplaces[$toptype];
foreach($em_nativeplaces as $eid=>$em)
{
if($eid < $toptype+1 || $eid > $toptype+499) continue;
if($eid == $nativeplace) {
$fields['nativeplace'] .= ” {$em}\r\n”;
$fields['puper'] .= ‘ - ‘ . $em;
}
else {
$fields['nativeplace'] .= ” {$em}\r\n”;
}
}
}
二、在列表调用里用
{dede:infolink}[field:puper/]{/dede:infolink}
调用