Cris D., on May 19 2007, 04:45 AM, said:
Thanks Cris
Posted 31 May 2007 - 08:50 AM
Posted 31 May 2007 - 11:11 AM
Cris D., on May 31 2007, 09:50 AM, said:
Posted 31 May 2007 - 11:26 AM
Quote
[b]$nav.="<div align=\"center\" class=\"prev_next\">";//set the container for top and bottom navigation links.[/b]
if($start>=$maxOnPage) {
$nav.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start - $maxOnPage)."\">Previous |</a>";
}
$page=($start+1);
$nav.=" Page ".(ceil($page/$maxOnPage))." of ". ceil($numrows/$maxOnPage);
if($numrows >($start + $maxOnPage)){
$nav.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start + $maxOnPage)."\"> | Next</a>";
}
[b]$nav.="</div>";[/b]
if($start>=$maxOnPage) {
$nav.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start - $maxOnPage)."\">Previous |</a>";
}
$page=($start+1);
$nav.=" Page ".(ceil($page/$maxOnPage))." of ". ceil($numrows/$maxOnPage);
if($numrows >($start + $maxOnPage)){
$nav.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start + $maxOnPage)."\"> | Next</a>";
}
The div was an afterthought, and in retrospect, the code is probably better off without it.
Edited by Cris D., 31 May 2007 - 11:32 AM.
Posted 11 June 2007 - 12:29 PM
//Top and Bottom navigation links, created separately so that they can be in separate classes to position them with CSS.
//Top class="navTop" therefore set this in your CSS with something like .navTop{top: 100px}
$navTop.="<div align=\"center\" class=\"prev_next_top\">";
if($start>=$maxOnPage) {
$navTop.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start - $maxOnPage)."\">Previous |</a>";
}
$page=($start+1);//re-set start from 0 (required to collect row 1 from db), to 1 for maths functions
$navTop.=" Page ".(ceil($page/$maxOnPage))." of ". ceil($numrows/$maxOnPage);
if($numrows >($start + $maxOnPage)){
$navTop.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start + $maxOnPage)." "."\">| Next</a>";
}
$navTop.="</div>";
//Set the bottom navigation links
//Bottom class="navBotom" therefore set this in your CSS with something like .navBottom{bottom:80px;}
$navBottom.="<div>";
if($start>=$maxOnPage) {
$navBottom.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start - $maxOnPage)."\">Previous |</a>";
}
$navBottom.=" Page ".(ceil($page/$maxOnPage))." of ". ceil($numrows/$maxOnPage);
if($numrows >($start + $maxOnPage)){
$navBottom.="<a href=\"?id=".$etomite->documentIdentifier."&start=".($start + $maxOnPage)." "."\">| Next</a>";
}
$navBottom.="</div>";
return $navTop."".stripslashes($output)."".$navBottom;
.odd {
float: left;
padding-left: 10%;
}
.even {
float: right;
padding-right: 10%;
}
.prev_next_bot{
position:absolute;
left:50%;
top:105%;//adjust this to get within the required limits for the page height
}
or if you are still having problems, or want a quick fix for a bottom navigation that floats where you don't want it (this might happen in this instance where every div is set to float), just change the last line to...return $nav."".stripslashes($output);OR
return $navTop."".stripslashes($output);if you made the changes above
Edited by Cris D., 11 June 2007 - 12:31 PM.
Posted 18 June 2007 - 01:04 PM
Posted 20 July 2008 - 12:45 PM
Posted 20 July 2008 - 01:20 PM
0 members, 1 guests, 0 anonymous users