欢迎访问 舍力博客(www.shuyong.net)
<?php //widget:最新评论 function widget_newcomm($title){ global $CACHE; $com_cache = $CACHE->readCache('comment'); ?> <li> <h3><span><?php echo $title; ?></span></h3> <ul id="newcomment"> <?php foreach($com_cache as $value): $url = Url::comment($value['gid'], $value['page'], $value['cid']); ?> <li id="comment"><?php echo $value['name']; ?> <br /><a href="<?php echo $url; ?>"><?php echo $value['content']; ?></a></li> <?php endforeach; ?> </ul> </li> <?php }?>替换成
<?php //widget:热评文章 function widget_newcomm($title){$index_comnum = Option::get('index_comnum');?> <li> <h3><span><?php echo $title;?></span></h3> <ul id="newcomment"> <?php $db = MySql::getInstance();$db = MySql::getInstance(); $sql = $db->query ("SELECT * FROM ".DB_PREFIX."blog inner join ".DB_PREFIX."sort WHERE hide='n' AND type='blog' AND top='n' AND sortid=sid order by `comnum` DESC limit 0,$index_comnum"); while($row = $db->fetch_array($sql)){?> <li id="comment"><a href="<?php echo Url::log($row['gid']);?>" title="<?php echo $row['title'];?>" /><?php echo $row['title'];?></a></li> <?php }?></ul><?php }?>这样就搞定收工了!本文有舍力原创,转载请注明,谢谢合作!
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。