You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 59 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - prev / next news story [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
fragilefringe
Guest






PostPosted: Mon Aug 15, 2005 6:30 am Reply with quoteBack to top

Is there a way to display previous and next story in the news article pages? I see there is a way to show prev / next in the same topic, but I want to display prev / next in overall news stories. Thanks for your help.
Find all posts by Anonymous
fragilefringe
Guest






PostPosted: Mon Aug 15, 2005 7:43 pm Reply with quoteBack to top

Thanks, but I figured it out myself. Because I had couldn't find anything after googling the heck out of it, here is the code for anyone else trying to do this. I inserted this in my article.php page above the comments section:

$sql ="select sid FROM ".$prefix."_stories where sid < '$sid' order by sid DESC limit 0,1";

$resultprv = sql_query($sql, $dbi);

if (sql_num_rows($resultprv, $dbi)>0) {

list($s_sid) = sql_fetch_row($resultprv, $dbi);

$link_prev = "<a href = \"modules.php?name=News&amp;file=article&amp;sid=$s_sid\">PREVIOUS ENTRY</a> ";

} else

{

$link_prev = "";

}



$sql ="select sid FROM ".$prefix."_stories where sid > '$sid' order by sid ASC limit 0,1";

$resultnext = sql_query($sql, $dbi);

if (sql_num_rows($resultnext, $dbi) > 0) {

list($s_sid) = sql_fetch_row($resultnext, $dbi);

$link_next= "<a href = \"modules.php?name=News&amp;file=article&amp;sid=$s_sid\">NEXT ENTRY</a>";

} else

{

$link_next = "";

}



echo "$link_prev&nbsp;&nbsp;&nbsp;$link_next\n";
Find all posts by Anonymous
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-friendly view
View previous topic Log in to check your private messages View next topic
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.393 Seconds - 300 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::