Support jOOmla! Autoit!
在最新文章模块条目前面增加此条目所属的分类 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-22 | View Count View: 13654 | Digg Count Digg: 67

效果:

  

[此文没考虑 Static 即 调用最新静态文章, 也就是说,你用最新文章mod掉用静态文章的话,下面是有问题的。不过你可以用下面的开关方法来关闭他.]

文件 : modules/mod_latestnews.php

搜索

, a.sectionid

替换为[有两处] :

, a.sectionid, cc.name

在结尾处的

<li class="latestnews<?php echo $moduleclass_sfx; ?>">

后面增加:

[<a href="<?php echo sefRelToAbs("index.php?option=content&task=category&sectionid=$row->sectionid&id=$row->catid$Itemid"); ?>" title='<?php echo $row->name; ?>'><?php echo $row->name;?></a>]

ok. 这样就可以了。

当然还可以给他增加个开关。

方法:

在上面我们加的那行前面加:

<?php if ($show_catid == '1') { ?>

后面加

<?php } ?>

接着在此文件的开始部分的:

$show_front = $params->get( 'show_front', 1 );

下面增加:

$show_catid = $params->get( 'show_catid', 1 );

然后在 modules/mod_latestnews.xml 结尾处的

 </params>

上面增加:

  <param name="show_catid" type="radio" default="1" label="show catid" description="Show/Hide catid">
   <option value="1">show</option>
   <option value="0">hide</option>
  </param>

就可以了。在使用中,如果不需要显示单元,只要在后台设置此模块的 show catid 处选 hide 就不显示了。

end by autoit.


Permanent URL: http://www.autoit.cn/index.php/content/view/99/25.html

Shares: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us   |  Tags: 最新文章  latestnews  分类  hack  

 
在热门文章模块结尾增加点击数   关注 Joomla 的页面 meta 标签