Posted By

G470 on 12/15/11


Tagged

plugin indexhibit


Versions (?)

Indexhibit nextlink


 / Published in: PHP
 

URL: http://gatonet.de

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/

  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. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: G470 on December 15, 2011

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

You need to login to post a comment.