| Author |
Message |
Lucifix Regular


Joined: Mar 11, 2005 Posts: 62
|
Posted:
Fri Mar 11, 2005 4:20 pm |
|
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&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. |
|
|
|
 |
BobMarion Former Admin in Good Standing

Joined: Oct 30, 2002 Posts: 1043 Location: RedNeck Land (known as Kentucky)
|
Posted:
Fri Mar 11, 2005 10:21 pm |
|
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? |
|
|
|
 |
Lucifix Regular


Joined: Mar 11, 2005 Posts: 62
|
Posted:
Sat Mar 12, 2005 5:50 am |
|
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
|
Posted:
Mon Mar 14, 2005 9:29 am |
|
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:
This is combined with Googlifier for the html urls. Not GT. |
|
|
|
 |
drzwingle New Member


Joined: Aug 06, 2005 Posts: 1
|
Posted:
Sat Aug 06, 2005 3:01 pm |
|
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. |
|
|
|
 |
manunkind Client

Joined: Apr 26, 2004 Posts: 368 Location: Albuquerque, NM
|
Posted:
Sat Aug 06, 2005 5:48 pm |
|
|
|
 |
|
|
|
|