I'm trying to use it with Scheduler module, but it creates links for feature unpublished stories. Any idea how to fix it?

Comments

kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand why this would happen. The module checks status = 1 for all the queries.

idflorin’s picture

I think it's solved now, at least for me , I use

/* next previous navigation */
function pn_node($node, $mode = 'n') {
  if (!function_exists('prev_next_nid')) {
    return NULL;
  }

  switch($mode) {
    case 'p':
      $n_nid = prev_next_nid($node->nid, 'prev');
      $link_text = $n_node->title;
      break;

    case 'n':
      $n_nid = prev_next_nid($node->nid, 'next');
      $link_text = $n_node->title;
      break;

    default:
      return NULL;
  }

  if ($n_nid) {
    $n_node = node_load($n_nid);

    $options = array(
      'attributes' => array('class' => 'thumbnail'),
      'html'  => TRUE,
    );
    switch($n_node->type) {

      // For picturestory nodes
      case 'picturestory':

          $img_html = theme('imagecache', 'tiny', $n_node->field_pictures[0]['filepath'], $n_node->title, $n_node->title);
          $img_html = l($img_html, 'node/'. $n_nid, array('attributes' => array('class' => 'navigation-image'), 'html' => TRUE));
          $text_html = l($n_node->title, 'node/'. $n_nid, array('attributes' => array('title' => $n_node->title), 'html' => TRUE));
          if ($n_node->status == 1) {
          if ($mode == 'p') { return $text_html . $img_html; }
          return $img_html . $text_html;
          }

      case 'videostory':

          $img_html = '<img src="' . $n_node->field_embvideos[0]['data']['thumbnail']['url'] . '" alt="' . $n_node->title . '" title="' . $n_node->title . '" class="image videostory-thumbnail" />';
          
          $img_html = l($img_html, 'node/'. $n_nid, array('attributes' => array('class' => 'navigation-image'), 'html' => TRUE));
          
          $text_html = l($n_node->title, 'node/'. $n_nid, array('attributes' => array('title' => $n_node->title), 'html' => TRUE));

          if ($n_node->status == 1) {
          	if ($mode == 'p') {
          		return $text_html . $img_html . $n_nid->status;
				  };
          return $img_html . $text_html . $n_nid->status;
          }
     // default:
        // Add other node types here if you want.
    }
  }
}

I added an extra if :
if ($n_node->status == 1) {....
an use it in my template.tpl.php

kbahey’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)