DrupalBin
Submit Code
About
Recent Posts
css path
39 min 6 sec
ago
Fix for Code
4 hours 38 min
ago
Fix for Code
4 hours 44 min
ago
Fix for Code
4 hours 52 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Add next link to node
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
<?php function next_node_link($type, $object, $teaser = FALSE) { $links = array(); if ($type == 'node' && isset($object->nid)) { if (!$teaser) { if (user_access('access content')) { // do permission checks - this is fairly open $nid = db_result(db_query_range("SELECT nid from {node} WHERE status = 1 AND nid > %d ORDER BY nid", $object->nid, 0, 1)); if($nid) { $links['next'] = array( 'title' => t('Next node'), 'href' => 'node/'. $nid, 'attributes' => array('title' => t('The next entered node.')) ); } } } } return $links; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.