下面是效果图:

上面是由下面改善的模块罗列在一起后实现的[模块复制]
最上行是后台可定义的一张图片,并带有 more定义的链接.
末尾的 more 是后台可定义的链接。
实现方法是依据上篇文章 “将最新文章模块hack成两列输出样式” 来完善的。
1, mod_latestnews.xml 结尾部分的
</params>
替换为:
<param name="image" type="text" size="45" default="" label="top_image" description="" />
<param name="more" type="text" size="45" default="" label="more link" description="" />
</params>
2, mod_latestnews.php 里的
$nullDate = $database->getNullDate();
替换为:
$image = trim( $params->get( 'image') );
$more = trim( $params->get( 'more' ) );
$nullDate = $database->getNullDate();
下面的
// Output
?>
替换为:
// Output
if ($image != "") echo '<div style="margin-bottom:5px;"><a href="'.$more.'">
<img src="'. $image.'" border="0"></a></div>';
?>
将:
<ul class="latestnews<?php echo $moduleclass_sfx; ?>">
替换为:
<table width='98%' border='0' class="latestnews<?php echo $moduleclass_sfx; ?>"
cellspacing="0" cellpadding="0">
下面的:
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; ?>">
<a href="<?php echo $link; ?>" class="latestnews<?php echo $moduleclass_sfx; ?>">
<?php echo $row->title; ?></a>
</li>
<?php
}
?>
</ul>
替换为:
if ($rowcounter%2==1) {
echo "<td width='4%' style=\"background: url(/images/gdot2.gif); background-position: center bottom; background-repeat: repeat-y;\"></td><td class=\"latestnews". $moduleclass_sfx."\" width=\"48%\" style=\"background: url(/images/gdot.gif); background-position: 2cm bottom; background-repeat: repeat-x; \" height=\"25\">";
} else {
echo "<td class=\"latestnews". $moduleclass_sfx."\" width=\"48%\" style=\"background: url(/images/gdot.gif); background-position: 2cm bottom; background-repeat: repeat-x; \" height=\"25\" >";
} ?>
<img src="/images/con_dot.jpg" align="absbottom"> <a href="<?php echo $link; ?>" class="latestnews<?php echo $moduleclass_sfx; ?>">
<?php echo $row->title; ?></a> <small>(<?php echo substr( $row->created,5,5 ); ?>)</small>
</td>
<?php
$rowcounter++;
}
if ($rowcounter%2<>0) {
for ($i = 1; $i <= (2-($rowcounter%2)); $i++) {
echo "<td width='4%' style=\"background: url(/images/gdot2.gif); background-position: center bottom; background-repeat: repeat-y;\"></td><td width='48%' style=\"background: url(/images/gdot.gif); background-position: 2cm bottom; background-repeat: repeat-x;\"><img src=\"/images/con_dot.jpg\"> <a href=\"".$more."\" class=\"latestnews". $moduleclass_sfx."\">more...</a></td>\n";
}
}
echo "</tr>\n</table>\n";
?> Ok. End By Autoit
常规设置:
1:此模块的标题不要显示, 因为要输出图片啦. 当然你模块里的图片未设置他就不会出现.
2:文章条目设置为奇数, 上面是设置9, 这样的话, more 才会显示...
3:此模块的标题显示 + 此模块的图片路径为空 + 上面设置为偶数 --》 效果等于 "将最新文章模块hack成两列输出样式" 一文的效果。
注意: 上面是针对一本地站点hack后,直接帖上来的, 未改动什么,所以里面涉及到3个小图片[/images/ 下面],一个是行的下划线, 一个是中间的竖线, 另一个是那个三角[没写在css里是因为这样好调试出效果来] .... 三个图片: 

