Support jOOmla! Autoit!
 
将最新文章模块hack成两列输出样式 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2006-11-23 | View Count View: 12893 | Digg Count Digg: 57

就是下图 latestnews 模块的效果:

输出效果

 

修改文件: modules/mod_latestnews.php 

将133 行的:

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

替换为:

<table width='100%' border='0' class="latestnews<?php echo $moduleclass_sfx; ?>">

下面的:

foreach ( $rows as $row ) {

替换为:

 echo "<tr>\n";
 $rowcounter = 0;
 foreach ( $rows as $row ) {
    if (($rowcounter%2==0) AND ($rowcounter<>0)) echo "</tr>\n<tr>\n";

在这段结尾部分的:

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

替换为:

 <td class="latestnews<?php echo $moduleclass_sfx; ?>" width="50%">

下面的:

 </li>
 <?php
}
?>
</ul>

替换为:

 </td>
 <?php
 $rowcounter++;
}
if ($rowcounter%2<>0) {
 for ($i = 1; $i <= (2-($rowcounter%2)); $i++) {
  echo " <td width='50%'></td>\n";
 }
}
echo "</tr>\n</table>\n";
?>

Ok. End By Autoit


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

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

 
不装组件也让你的文章显示出关键字来--[2]   将单元内容列表 hack 成两列显示