DrupalBin
Submit Code
About
Recent Posts
float?
1 hour 57 min
ago
views handler
5 hours 28 min
ago
Code
5 hours 43 min
ago
Code
5 hours 45 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
Add next link to node
View
Download
Fix
May 25, 2008 - 6:11am — Anonymous
<?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
;
}
next link
node
template