[Comoblog-commit] modules/mod_postbytitle/include mod_postbytitle.inc.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2005-11-27 21:10:18
|
Update of /cvsroot/comoblog/modules/mod_postbytitle/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24295/mod_postbytitle/include Added Files: mod_postbytitle.inc.php Log Message: initial add, just to make sure ive got the hang of it. mod_postbytitle,builds a select box or list of posts by title clicking on a link in it takes you to the post --- NEW FILE: mod_postbytitle.inc.php --- <?php function mod_postbytitle_list () { $post_id = ''; if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/') $post_id = substr($_SERVER['PATH_INFO'],1,strlen($_SERVER['PATH_INFO'])-1); # echo $post_id; $query = "select * from ".CFG_MYSQL_TABPREFIX."posts order by post_mail_date desc "; $res = mysql_query($query); if (!$res || !mysql_num_rows($res)) return (false); $items = array(); while ($row = mysql_fetch_assoc($res)) { $row['is_selected'] =""; if ($row['post_id'] == $post_id){ $row['is_selected'] ="SELECTED";} #echo $row['post_id'] ." - " . $row['is_selected'] . "<br>"; $items[] = $row; } return ($items); } ?> |