Return to Snippet

Revision: 54228
at December 15, 2011 20:04 by G470


Initial Code
if (!defined('SITE')) exit('No direct script access allowed');

function nextlink(){
$OBJ = get_instance();
global $rs;

$pages = $OBJ->db->fetchArray("SELECT id, url
FROM ".PX."objects, ".PX."sections
WHERE status = '1'
AND hidden != '1'
AND section_id = secid
ORDER BY sec_ord ASC, ord ASC");

if (!$pages) return 'Error with pages query';
foreach ($pages as $reord){
$order[$reord['sec_desc']][] = array(
'id' => $reord['id'],
'url' => $reord['url']);
}
$active = false;
foreach($order as $key => $out)
{
foreach($out as $page){
if ($active==true){
$nextlink=$page['url'];
$active = false;}
$active = ($rs['id'] == $page['id']) ? true : false;
}
$next .= "<a href='".BASEURL.ndxz_rewriter($nextlink)."'>NEXT</a>";
}
return $next;
}

Initial URL
http://gatonet.de

Initial Description
Save this as plugin.nextlink.php to your ndxz-studio/site/plugin folder. Call the Plugin where you need it: &lt;plug:nextlink /&gt;

Original by "gd" http://www.indexhibit.org/forum/thread/7879/

Initial Title
Indexhibit nextlink

Initial Tags
plugin

Initial Language
PHP