Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
Lucifix
Regular
Regular



Joined: Mar 11, 2005
Posts: 67

PostPosted: Fri Mar 11, 2005 4:20 pm Reply with quote

I have tried to find paging for news module that it's used in NSN News, but without suceed.

I am using PHP-Nuke 7.6 but I don't wish to install NSN News.

Have checked index.php code (NSN News Module) and find this code for paging:

Code:
        echo "\n<!-- PAGING -->\n";

        $articlepagesint = ($totalarticles / $storynum);
        $articlepageremain = ($totalarticles % $storynum);
        if ($articlepageremain != 0) {
            $articlepages = ceil($articlepagesint);
            if ($totalarticles < $storynum) { $articlepageremain = 0; }
        } else {
            $articlepages = $articlepagesint;
        }
        if ($articlepages!=1 && $articlepages!=0) {
            echo "<br>\n";
            OpenTable();
            $counter = 1;
            $currentpage = ($max / $storynum);
            echo "<form action='modules.php?name=$module_name' method='post'>\n";
            echo "<table align='center' border='0' cellpadding='2' cellspacing='2'>\n";
            echo "<tr>\n<td><b>"._NE_SELECT." </b><select name='min' onChange='top.location.href=this.options[this.selectedIndex].value'>\n";
            while ($counter <= $articlepages ) {
                $cpage = $counter;
                $mintemp = ($storynum * $counter) - $storynum;
                if ($counter == $currentpage) {
                    echo "<option selected>$counter</option>\n";
                } else {
                    if($module_name == $main_module) {
                      echo "<option value='index.php?min=$mintemp'>$counter</option>\n";
                    } else {
                      echo "<option value='modules.php?name=$module_name&amp;min=$mintemp'>$counter</option>\n";
                    }
                }
                $counter++;
            }
            echo "</select><b> "._NE_OF." $articlepages "._NE_PAGES.".</b></td>\n</tr>\n";
            echo "</table>\n";
            echo "</form>\n";
            CloseTable();


But it doesnt work if I insert it in my index.php (news module).

Does anyone else has any idea how to do paging for news?

PS: I am talking about news on main page:
etc: Select Page xxx of yyy pages.
 
View user's profile Send private message
BobMarion
Former Admin in Good Standing



Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Fri Mar 11, 2005 10:21 pm Reply with quote

It's more then just that section of code to do the paging. That's just the part that puts the parts together in a readable/usable way. The code that does the meat of the paging is in the top of the file to include the new sql query for generating the proper number of stories.

Now for a question of you, why do you not want to use NSN News?

_________________
Bob Marion
Codito Ergo Sum
http://www.nukescripts.net 
View user's profile Send private message Send e-mail Visit poster's website
Lucifix







PostPosted: Sat Mar 12, 2005 5:50 am Reply with quote

It's ok, I have manage to implanted the script to my code and it's working now.

If somone need it, I am willing to post it here.
 
manunkind
Client



Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Mon Mar 14, 2005 9:29 am Reply with quote

I just modified the old page numbers hack for 6.5 and got it working on a 7.6 version with chat's 2.9 patches. It works for me. Scroll to the bottom and check it out:

http://www.pcsympathy.com

This is combined with Googlifier for the html urls. Not GT.
 
View user's profile Send private message Visit poster's website
drzwingle
New Member
New Member



Joined: Aug 06, 2005
Posts: 1

PostPosted: Sat Aug 06, 2005 3:01 pm Reply with quote

manunkind....

how did you modify phpnuke news to add page numbers?

the current version of "page numbers" is not compatable with phpnuke 7.5

i read your post on ravenscripts. is there any way i could get a look at your phpnuke news index.php to see your mods???


drzwingle.
 
View user's profile Send private message
manunkind







PostPosted: Sat Aug 06, 2005 5:48 pm Reply with quote

Just sent you an email.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

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 ©