添加步骤:
在当前主题module.php文件中添加如下代码: readCache("logtags"); $Tag_Model = new Tag_Model(); $related_log_id_str = "0"; foreach($log_cache_tags[$logid] as $key => $val) { $related_log_id_str .= ",".$Tag_Model->getTagByName($val["tagname"]); } $sql .= " AND gid!=$logid AND gid IN ($related_log_id_str)"; }else{ $sql .= " AND gid!=$logid AND sortid=$sortid"; } switch ($related_log_sort) { case "views_desc": { $sql .= " ORDER BY views DESC"; break; } case "views_asc": { $sql .= " ORDER BY views ASC"; break; } case "comnum_desc": { $sql .= " ORDER BY comnum DESC"; break; } case "comnum_asc": { $sql .= " ORDER BY comnum ASC"; break; } case "rand": { $sql .= " ORDER BY rand()"; break; } } $sql .= " LIMIT 0,$related_log_num"; $related_logs = array(); $query = $DB->query($sql); while($row = $DB->fetch_array($query)) { $row["gid"] = intval($row["gid"]); $row["title"] = htmlspecialchars($row["title"]); $related_logs[] = $row; } $out = ""; if(!empty($related_logs)) { foreach($related_logs as $val) { $out .= "
"; } } if(!empty($value["content"])) { if($related_inrss == "y") { $abstract .= $out; } }else{ echo $out; }
}
?>
打开当前主题的echo_log.php文件,在喜欢的位置,如下面添加调用代码:
然后通过CSS美化样式,以下显示样式供需要的博主作参考: #art_about{margin:10px 5px; padding: 10px 0; overflow:hidden; padding-bottom:10px;} #art_about b{margin:0 0px 5px 10px} #art_about ul{padding:10px;} #art_about ul li { line-height:1.5em; float:left; background:url("images/dot.gif") no-repeat scroll 0px 50% transparent; padding-left:15px; margin:5px 15px; width:350px; white-sapce:nowrap; overflow:hidden;
display:inline;
}
以上代码摘自互联网。