百度空间 | 百度首页 
 
查看文章
 
Dedecms 分类信息列表页Title标题中显示地区名
2009-11-08 11:19

一.修改include\taglib\infolink.lib.php

主要增加了

$fields['puper'] = $em_nativeplaces[$toptype];



$fields['puper'] .= ' - ' . $em;

这段代码改成这样

以下为引用的内容:

  1. //地区链接
  2. if(empty($nativeplace))
  3. {
  4. foreach($em_nativeplaces as $eid=>$em)
  5. {
  6. if($eid % 500 != 0) continue;
  7. $fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
  8. }
  9. }
  10. else
  11. {
  12. $sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 );
  13. $toptype = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplace%500) ) );
  14. $fields['nativeplace'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'><b>{$em_nativeplaces[$toptype]}</b></a> >> ";
  15. $fields['puper'] = $em_nativeplaces[$toptype];
  16. foreach($em_nativeplaces as $eid=>$em)
  17. {
  18. if($eid < $toptype+1 || $eid > $toptype+499) continue;
  19. if($eid == $nativeplace) {
  20. $fields['nativeplace'] .= " <b>{$em}</b>\r\n";
  21. $fields['puper'] .= ' - ' . $em;
  22. }
  23. else {
  24. $fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
  25. }
  26. }
  27. }


二、在列表调用里用

{dede:infolink}[field:puper/]{/dede:infolink}

调用

同样适用于Dedecms分类信息其他联动类别


类别:php编程 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu