Previous/Next API 6.x-1.x-dev
File ID: 101667
Previous/Next API 6.x-1.x-dev Description
Description: This module allows you to know the previous or next nodes for any given node. This is very useful for providing navigational links to the user without the expensive queries required to dynamically deduce such information on the fly.
The use case is two fold:
For example, on a site with a gallery of images, you want to show a next/previous link with a thumbnail under each image. Your site's visitor click on the link to show new content or browse it.
Although the previous and next nodes can be deduced with some SQL work, the queries to do so are very heavy on the database, and can bring a site to its knees. This module solves this problem by storing the previous/next node in a table so lookups are fast. Once the module is installed, it will build this index backwards via cron until all nodes have been indexed. See the "More Info" section below for a detailed post on the positive scalability impacts of implementing this module.
The module can be restricted to certain content types to be included in the previous/next indexing. For example, you want the site's visitors to browse through video and image nodes only, but not blogs and regular pages.
The number of nodes to index is defined in the settings too. The default is 200, but you may want to lower that for a site on shared hosts. Once the indexing is complete for all the site's nodes, cron will do do anything. You can always reindex the site using the "Re-Index" button on the settings page.
The module provides only one API call. If you do not call that function, this module will do nothing.
$n_nid = prev_next_nid($nid, $op);
Examples for using it are:
// Get the previous node id
$prev_nid = prev_next_nid($nid, 'prev');
// Get the previous node id
$next_nid = prev_next_nid($nid, 'next');
To implement the functionality for this module, please see the example in the README.txt file provided with this module.
At present, the module does not provide for indexing content by criteria other than the node type.
Other use cases may call for additional criteria, for example, a term id, so content is browsed by taxonomy terms. This will require database schema changes and reindexing of the site again.
If you have a patch to do this, please submit an issue for it.
For more info on the performance impact of this module on large sites, please read Previous/Next API: a high performance API module for previous/next node.
Development sponsored by: WebMediaBrands for Ads of the World
Khalid Baheyeldin of 2bits.com.
The author can also be contacted for paid customizations of this module as well as Drupal consulting, installation, development, and customizations.
Related: Module, Nodes, Content, previous, Site, previousnext, prev nidnid, Indexing, Performance, Image, Database, Index, criteria, customizations, Settings, Queries, Browse
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB
|More Similar Code|
This module allows you to know the previous or next nodes for any given node. This is very useful for providing navigational links to the user without the expensive queries required to dynamically deduce such information on the fly.
The use case is two fold:
For example, on a site with a gallery of images, you want to show a next/previous link with a thumbnail under each image. Your site's...
Custom Pagers allows administrators to define context-sensitive previous/next pagers for any node type. The list of nodes to be cycled through is generated by a user-selectable view, and each pager can be displayed above or below the node body or...
PHP 5 is required since version 1.2.
When displaying a single post, you might want to show links to the previous and next posts in the same category.
That's fine; WordPress let's you do this with previous_post_link() and...
Active Pager is a database tool which is used to add a paging tool to a data grid component. It offers useful navigation tool which helps the users to navigate between different pages using previous, next, drop down selector, first and last page,...
This is an ASP.NET tutorial through which you can learn how to build a generic pager control with first, previous, next and last paging buttons. In this article the author clearly explains the features of generic pager control. You can see the...
Slideshow style image gallery that features webbased uploading, password protected admin editing/deleting, previous/next buttons, quickjump links, automatic time delay slide show, folder-style tabs for unlimited image categories, current category...
This script is used for PHP Nuke. It shows you the comments of the past number of posts submitted by your site visitors through phpBB Forum in a PHP nuke block. Previous, next and up keys are given to select and view the comments. It also allows...
Multilingual guestbook that features seven layouts, auto-generation of previous/next pages, numeric site-rating, image inclusion, email notification, IP blocking, adjustable time difference, bad words filter, duplicate entry blocking, and a...
Fading XML Image Scroller Gallery & Menu & Banner Rotator & Slideshow with scrollbar component, autoPlay, previous, next buttons and scrollable text description box ( SPECIAL intro price ).
* Easy to...
Fading XML Image Scroller Gallery & Menu & Banner Rotator & Slideshow with scrollbar component, autoPlay, previous, next buttons and scrollable text description box ( Flash CS3 / CS4 and above / AS3 version ).
|User Review for Previous/Next API