[Comoblog-commit] modules/mod_prevnext index.php,NONE,1.1 mod_prevnext.php,NONE,1.1 mod_prevnext.tex
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2005-11-28 10:32:04
|
Update of /cvsroot/comoblog/modules/mod_prevnext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11777/mod_prevnext Added Files: index.php mod_prevnext.php mod_prevnext.text Log Message: initial add mod_postbytitle, adds next and previous links to the individual post pages. --- NEW FILE: mod_prevnext.php --- <?php if (in_array('mod_prevnext', $SIDEBAR_MODULES)) { $mod_pos = 'sidebar'; }else{ $mod_pos = 'top'; } require_once (CFG_BASE_PATH.'/modules/mod_prevnext/include/mod_prevnext.inc.php'); $post_id = ''; if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/' && $_SERVER['SCRIPT_FILENAME'] == CFG_BASE_PATH . 'post.php'){ $post_id = substr($_SERVER['PATH_INFO'],1,strlen($_SERVER['PATH_INFO'])-1); } $prevnext_prevlink = mod_prevnext_post_prev($post_id); $prevnext_nextlink = mod_prevnext_post_next($post_id); #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 "; $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 "; $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 "; $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 "; $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVTEXT', CFG_MOD_PREVNEXT_NOPREVTEXT ); $mod_prevnext_tpl->assign('CFG_MOD_PREVNEXT_PREVLINK', '#' ); } $mod_prevnext_tpl->parse('main'); $mod_contents = $mod_prevnext_tpl->text("main"); }else { $mod_contents = ""; } ?> --- NEW FILE: index.php --- --- NEW FILE: mod_prevnext.text --- mod_prevnext adds a previous and next link to the page when you're viewing a specific post (i.e. ONLY in post.php) because I wasnt very happy with where this ended up on the page, either in the side bar or in the top position, you can add any other style info via the admin area so that you can use some css positioning. NOTE that this module should be made obsolite in the next version of comoblog, I believe we'd be better served by moving the code into the main libraries. |