[Comoblog-commit] modules/mod_prevnext mod_prevnext.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 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21789/mod_prevnext Modified Files: mod_prevnext.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.php =================================================================== RCS file: /cvsroot/comoblog/modules/mod_prevnext/mod_prevnext.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_prevnext.php 28 Nov 2005 10:31:35 -0000 1.1 +++ mod_prevnext.php 11 Dec 2005 21:53:04 -0000 1.2 @@ -9,36 +9,44 @@ $post_id = ''; if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/' - && $_SERVER['SCRIPT_FILENAME'] == CFG_BASE_PATH . 'post.php'){ + //&& $_SERVER['SCRIPT_FILENAME'] == CFG_BASE_PATH . 'post.php' + + ){ $post_id = substr($_SERVER['PATH_INFO'],1,strlen($_SERVER['PATH_INFO'])-1); } + +echo "post_id=(" . $post_id .")"; +echo "<br/>(SERVER-PATH_INFO " . $_SERVER['PATH_INFO'] .")"; +echo "<br/>(SERVER-SCRIPT_FILENAME " . $_SERVER['SCRIPT_FILENAME'] .")"; +ECHO "<hr>"; +if($post_id) { + $prevnext_prevlink = mod_prevnext_post_prev($post_id); $prevnext_nextlink = mod_prevnext_post_next($post_id); - #echo $prevnext_prevlink; - #echo $prevnext_nextlink; + echo $prevnext_prevlink; + echo $prevnext_nextlink; $mod_prevnext_tpl = new XTemplate (CFG_BASE_PATH.'/modules/mod_prevnext/templates/'.$mod_pos.'/mod_prevnext.tpl.htm'); - -if($post_id) { + if ($prevnext_nextlink) { - #echo "next link "; + echo "next link "; $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_NEXTTEXT', CFG_MOD_PREVNEXT_NEXTTEXT ); $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_NEXTLINK', $prevnext_nextlink ); } else { - # echo "no next link "; + echo "no next link "; $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_NEXTTEXT', CFG_MOD_PREVNEXT_NONEXTTEXT ); $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_NEXTLINK', '#' ); } if ($prevnext_prevlink) { - # echo " prev link "; + echo " prev link "; $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVTEXT', CFG_MOD_PREVNEXT_PREVTEXT ); $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVLINK', $prevnext_prevlink ); } else { - # echo " no prev link "; + echo " no prev link "; $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVTEXT', CFG_MOD_PREVNEXT_NOPREVTEXT ); $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVLINK', '#' ); } |