You are here

function _views_exclude_previous in Views exclude previous 7

Same name and namespace in other branches
  1. 8 views_exclude_previous.module \_views_exclude_previous()

This function stores/returns nids for the given category.

@staticvar array $excludes Static storage of our excluded nids.

Parameters

$cat: A category given by the exclude plugin.

$nid: The nid to be excluded. Optional so the function just returns the category.

Return value

array Always returns the given category.

4 calls to _views_exclude_previous()
views_exclude_previous_handler_filter::query in views/views_exclude_previous_handler_filter.inc
Add this filter to the query.
views_exclude_previous_node_load in ./views_exclude_previous.module
Implements hook_node_load().
views_exclude_previous_node_view in ./views_exclude_previous.module
Implements hook_node_view().
views_exclude_previous_views_post_execute in views/views_exclude_previous.views.inc
Implements hook_views_post_execute().

File

./views_exclude_previous.module, line 56
Main file of the views exclude previous module.

Code

function _views_exclude_previous($cat, $nid = NULL) {
  $excludes =& drupal_static(__FUNCTION__);

  // Add nid to be excluded in the current category.
  if (!empty($nid)) {
    $excludes[$cat][$nid] = $nid;
  }
  return !empty($excludes[$cat]) ? $excludes[$cat] : array(
    0,
  );
}