|
|
|
|
Giving the responsibility of finding a pagination solution since I recommend using Postnuke.
I looked at:
Postnuke's API and found that if I used pnHTML() I could use $output->Pager()
ADODB Pager functions - unusable for pn (my 2 cents)
Envolution - found printlink()
I decided to modify the printlink() from Envolution because it allowed me to modify the least amount of code.
As a result of extracting, modifing and renaming printlink(). I had pagination support for the News module.
minor changes to file: index.php are required to make this work.
change
$articles = getArticles($whereclause, $storyorder, $storynum);
to this
$articles = getArticles($whereclause, $storyorder, $storynum, $startnum);
add this before the getArticles function
$startnum=$_GET['startrow'];
if(!$startnum) {
$startnum = 0;
}
what it should look like...
$startnum=$_GET['startrow'];
if(!$startnum) {
$startnum = 0;
}
$articles = getArticles($whereclause, $storyorder, $storynum, $startnum);
Using the function in your theme file.
We're using AutoThemes so I modifed the custom modules news template
adding something like this...
include_once('modules/News/pnnewspager.php');
if($_GET['file'] == "article") {
// don't display when viewing a article
}
else {
pn_newspager();
}
Download
|
|
|
|
|
|