[Comoblog-commit] modules/mod_prevnext/include mod_prevnext.inc.php,1.1,1.2
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2005-12-11 21:53:17
|
Update of /cvsroot/comoblog/modules/mod_prevnext/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21789/mod_prevnext/include Modified Files: mod_prevnext.inc.php Log Message: checked. and cant see why this is failing... could use a fresh pair of eyes. NOTE THAT IVE LEFT DEBUG INFO IN PLACE it seems to be randomly failing in two places - one is the SQL in include/mod_prevnext.inc.php - which is identical to the previous version apart from the white spacing - as commited this code works for me, so please check and let me know - it could be that i've removed a typo that i just cant see in the diffs The other place it fails is in mod_prevnext.php it seems that sometimes it wont get the post id from the url - the code is the same as on post.php but with an additional check to make sure that its only on post.php. i just cant see why its failing ;-( Index: mod_prevnext.inc.php =================================================================== RCS file: /cvsroot/comoblog/modules/mod_prevnext/include/mod_prevnext.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_prevnext.inc.php 28 Nov 2005 10:31:35 -0000 1.1 +++ mod_prevnext.inc.php 11 Dec 2005 21:53:04 -0000 1.2 @@ -6,21 +6,16 @@ $iisbug = ''; } - $query = " - select p.post_id as next_post_id - from ".CFG_MYSQL_TABPREFIX."posts p - where p.post_id > '".$post_id."' - order by p.post_id limit 1; - "; + $query = "select p.post_id as next_post_id from ".CFG_MYSQL_TABPREFIX."posts p where p.post_id > '".$post_id."' order by p.post_id limit 1"; $res = mysql_query($query); - + echo mysql_errno() . ": " . mysql_error(). ":" .$query . "<hr>\n"; if (!$res || !mysql_num_rows($res)){ return (false); } $post = mysql_fetch_array($res); $returnval = CFG_SITE_URL.'post.php'.$iisbug.'/'.$post['next_post_id']; - # echo $returnval; + echo $returnval; return ($returnval); } @@ -32,21 +27,16 @@ $iisbug = ''; } - $query = " - select p.post_id as prev_post_id - from ".CFG_MYSQL_TABPREFIX."posts p - where p.post_id < '".$post_id."' - order by p.post_id desc limit 1; - "; + $query = "select p.post_id as prev_post_id from ".CFG_MYSQL_TABPREFIX."posts p where p.post_id < '".$post_id."' order by p.post_id desc limit 1"; $res = mysql_query($query); - + echo mysql_errno() . ": " . mysql_error(). ":" .$query . "<hr>\n"; if (!$res || !mysql_num_rows($res)){ return (false); } $post = mysql_fetch_array($res); $returnval = CFG_SITE_URL.'post.php'.$iisbug.'/'.$post['prev_post_id']; - # echo $returnval; + echo $returnval; return ($returnval); } |