Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro
Author Message
rovshan
Hangin' Around



Joined: Nov 26, 2005
Posts: 40

PostPosted: Fri Oct 20, 2006 4:43 pm Reply with quote

Hello,

I hope here someone who knows php programming, I am not so advanced..Sad

in Stories Archive module possible to change number of stories on page, "by default " it is 250.... So if you have 600 stories it should be 3 pages ... 1 and 2 pages 250 stories per page and 3 page 100 stories and normaly on the 3 page we don't find next link only previuos link...

BUT SOMETHING WRONG IN CODE ! The NEXT LINK never stop.

here is code in index.php of Stories_Archive module .... function show_all

-----------
function show_all($min) {
global $prefix, $user_prefix, $db, $bgcolor1, $bgcolor2, $user, $cookie, $sitename, $multilingual, $language, $module_name, $userinfo;
if (!isset($min) || intval($min) <= 0) {
$min = 0;
}
else $min = intval($min);
$max = 250;
include("header.php");
title(""._STORIESARCHIVE."");.................................
.............................................

$a = 0;
if (($numrows > 250) AND ($min == 0)) {
$min = $min+250;
$a++;
echo "<center>[ <a href=\"modules.php?name=$module_name&amp;sa=show_all&amp;min=$min\">"._NEXTPAGE."</a> ]</center><br>";
}
if (($numrows > 250) AND ($min >= 250) AND ($a != 1)) {
$pmin = $min-250;
$min = $min+250;
$a++;
echo "<center>[ <a href=\"modules.php?name=$module_name&amp;sa=show_all&amp;min=$pmin\">"._PREVIOUSPAGE."</a> | <a href=\"modules.php?name=$module_name&amp;sa=show_all&amp;min=$min\">"._NEXTPAGE."</a> ]</center><br>";
}
if (($numrows <= 250) AND ($a != 1) AND ($min != 0)) {
$pmin = $min-250;
echo "<center>[ <a href=\"modules.php?name=$module_name&amp;sa=show_all&amp;min=$pmin\">"._PREVIOUSPAGE."</a> ]</center><br>";
}
...............................
...........................
-----------------------

Help please..... to fix !
Thnks
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Oct 26, 2006 7:54 am Reply with quote

Yeah, this logic is definitely broken. Let me see what I can do... I will have to look at this tomorrow morning.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego







PostPosted: Thu Oct 26, 2006 6:29 pm Reply with quote

Ok, I have found the fix and have also fixed this for the upcoming RavenNuke 2.10.00 release. I modified the code as such:

Code:


    $a = 0;
    if (($numrows > $max) AND ($min == 0)) {
        $min = $min+$max;
        $a++;
        echo '<center>[ <a href="modules.php?name='.$module_name.'&amp;sa=show_all&amp;min='.$min.'">'._NEXTPAGE.'</a> ]</center><br />';
    }
    if (($numrows > $max) AND ($min < $numrows-$max) AND ($a == 0)) {
        $pmin = $min-$max;
        $min = $min+$max;
        $a++;
        echo '<center>[ <a href="modules.php?name='.$module_name.'&amp;sa=show_all&amp;min='.$pmin.'">'._PREVIOUSPAGE.'</a> | <a href="modules.php?name='.$module_name.'&amp;sa=show_all&amp;min='.$min.'">'._NEXTPAGE.'</a> ]</center><br />';
    }
    if (($numrows > $max) AND ($a == 0) AND ($min != 0)) {
        $pmin = $min-$max;
        echo '<center>[ <a href="modules.php?name='.$module_name.'&amp;sa=show_all&amp;min='.$pmin.'">'._PREVIOUSPAGE.'</a> ]</center><br />';
    }


This way, whatever you end up changing the $max = 250; variable to up above, it works properly.
 
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.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro

View next topic
View previous topic
You cannot post new topics in this forum
You cannot 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©