I'm bashing my head against a wall with this module.

I've wasted 2 hours trying beta1 which didn't work and now 1.x-dev doesn't work either. I've followed the documentation on creating a basic pager.

Doing a node render shows up nothing inside the content array. I thought perhaps views might be at fault so wrote my own php snippet to feed custom pagers the node ids.

<?php
$view = views_get_view('custom_pager_nzpys');
$view->execute();
$node_ids = array();
foreach ($view->result as $node) {
  array_push($node_ids, $node->nid);
}
return $node_ids;
?>

Besides that I've tried all the different display options, both content type and php for visibility.

Are there any modules known to conflict with this?

I feel that a dirty hack into page.tpl.php would have been a much quicker way to go. Thanks in advance for any help.

Comments

weblance’s picture

Same here, I cant seem to get this module to work at all.

keyo’s picture

I ended up writing my own module in the same amount of time I wasted messing with this one.
I've pasted my code below, maybe someone will benefit from it. I only did this as a last resort and some of it is custom to my content types. Take with a large grain of salt.

<?php
function mypager_nodeapi(&$node, $op, $a3= NULL, $a4 = NULL) {
  if($op == 'view' && $node->type == 'yearling_sale_listing') {
    switch($node->field_sale[0]['nid']) {
      case('1016'):
        $view_name = 'ACYS2010';
        break;
      case('4755'):
        $view_name = 'NZP2010';
        break;
    }
    if($view_name) {
      $cache_name = 'mypager_'. $view_name;
      //dpm($cache_name, 'cache name');
      if(($cache = cache_get($cache_name)) && !empty($cache->data)) {//fetch cache
        $node_ids = $cache->data;
      }
      else{ //Do computational work then save to cache
        $view = views_get_view($view_name);
        $view->pager['items_per_page'] = 0; //unlimited items
        $view->execute();
        //dpm($view);
        if(count ($view->result) > 0) {
          $node_ids = array();
          foreach ($view->result as $n) {
            array_push($node_ids, $n->nid);
          }
          cache_set($cache_name, $node_ids, 'cache', CACHE_TEMPORARY);
        }
      }
    }
    if ($node_ids) {
        $current = $node->nid;
        $key = array_search($current, $node_ids);
        //dpm($key);
        if($key !==  FALSE) {
          $prev = node_load(array(nid=>$node_ids[$key-1]));
          $next = node_load(array(nid=>$node_ids[$key+1]));
          $pager = '';
          if($key != '0'){ //not the first node
            $pager .= '<span id="prev-horse">'. l('< Previous', 'node/'. $prev->nid) .'</span>';
          }
          $pager .= '<span id="horse-page">'.'  '. $node->field_lot[0]['value'] .' of '. count($node_ids) .'  '.' </span>';
          if($key+1 != count($node_ids)){ //not the last node
            $pager .= '<span id="next-horse">'. l('Next >', 'node/'. $next->nid) .'</span>';
          }
        }
        $node ->pager = $pager;
    }
  }
}

Note: You would need to add a line in your theme to "print $node->pager;"

mherchel’s picture

any status update on this??? I'm having the same issue