[Comoblog-commit] modules/mod_latest_comments/include mod_latest_comments.inc.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-02-16 23:24:25
|
Update of /cvsroot/comoblog/modules/mod_latest_comments/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32685/mod_latest_comments/include Added Files: mod_latest_comments.inc.php Log Message: MOD LATEST COMMENTS as request https://sourceforge.net/forum/message.php?msg_id=3580702 lists the text of the latest comments in the side bar --- NEW FILE: mod_latest_comments.inc.php --- <?php function latest_comments ($howmany) { if (CFG_USE_PATH_INFO == 'no') $iisbug = '?'; else $iisbug = ''; $query = " select c.*, p.* from easymoblog_posts p , easymoblog_comments c where p.post_id =c.post_id order by comment_id desc limit 0,".$howmany.";"; $res = mysql_query($query); if (!$res || !mysql_num_rows($res)) return (false); $posts = array(); while ($row = mysql_fetch_array($res)) { $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; error_log($row['comment_added']); $row['comment_added'] = gmstrftime("%a, %d %b %Y at %T %Z",$row['comment_added']); error_log($row['comment_added']); $posts[] = $row; } return ($posts); } ?> |