Indexhibit nextlink


/ Published in: PHP
Save to your folder(s)

Save this as plugin.nextlink.php to your ndxz-studio/site/plugin folder. Call the Plugin where you need it: <plug:nextlink />

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


Copy this code and paste it in your HTML
  1. if (!defined('SITE')) exit('No direct script access allowed');
  2.  
  3. function nextlink(){
  4. $OBJ = get_instance();
  5. global $rs;
  6.  
  7. $pages = $OBJ->db->fetchArray("SELECT id, url
  8. FROM ".PX."objects, ".PX."sections
  9. WHERE status = '1'
  10. AND hidden != '1'
  11. AND section_id = secid
  12. ORDER BY sec_ord ASC, ord ASC");
  13.  
  14. if (!$pages) return 'Error with pages query';
  15. foreach ($pages as $reord){
  16. $order[$reord['sec_desc']][] = array(
  17. 'id' => $reord['id'],
  18. 'url' => $reord['url']);
  19. }
  20. $active = false;
  21. foreach($order as $key => $out)
  22. {
  23. foreach($out as $page){
  24. if ($active==true){
  25. $nextlink=$page['url'];
  26. $active = false;}
  27. $active = ($rs['id'] == $page['id']) ? true : false;
  28. }
  29. $next .= "<a href='".BASEURL.ndxz_rewriter($nextlink)."'>NEXT</a>";
  30. }
  31. return $next;
  32. }

URL: http://gatonet.de

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.