欢迎访问 舍力博客(www.shuyong.net)
<?php function com_tt($gid){ $db = MySql::getInstance(); $sql = "SELECT * FROM ".DB_PREFIX."blog WHERE hide='n' and gid in ($gid) ORDER BY `date` DESC LIMIT 0,1"; $list = $db->query($sql);while($row = $db->fetch_array($list)){echo $row['title'];}}?>
<?php //评论文章标题 function com_tt($gid){$db = MySql::getInstance();$sql = "SELECT * FROM ".DB_PREFIX."blog WHERE hide='n' and gid in ($gid) ORDER BY `date` DESC LIMIT 0,1";$list = $db->query($sql);while($row = $db->fetch_array($list)){?> <a href="<?php echo Url::log($row['gid']);?>" title="<?php echo $row['title'];?>"><?php echo $row['title'];?></a><?php }}?>然后在module.php文件里找到最新评论的函数代码,在里面找到<?php echo $value['name'] ;?>这串代码,在其后加上<?php com_tt($value['gid']);?>就会显示当前评论随在的文章标题了,至于美化就自行修改吧。
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。