|
将最新文章模块hack成两列输出样式
|
|
|
|
Author: Autoit | Date:2006-11-23 | View: 12893 | 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
|