Author Topic: Nice pagination for advancing to next page  (Read 952 times)

0 Members and 1 Guest are viewing this topic.

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Nice pagination for advancing to next page
« on: December 16, 2013, 05:12:35 PM »
This is a little complicated so read carefully.

You will need CSS. I called mine pagination. Here is my CSS; it uses orange and grey, but you can use anything you want.

Code: [Select]
.pagination , .paginationselected{
padding: 0px 5px 0px 5px;
border-width: 1px;
border-style: solid;
margin: 0px 5px 10px 5px;
border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px 3px 3px 3px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out; /* For IE8 and earlier */}

.pagination{
border-color: #F57803;}

.paginationselected{
border-color: #C8C8C8;
background-color: #C8C8C8;
color: #333333;}

.pagination:hover{
background-color: #F57803;
color: #333333;
text-decoration: none;}

In the csvread script find the section for the page selector at or about line 297

Code: [Select]
#set page selector
Following that identifier, find the line that reads:

Code: [Select]
$pages_out= "&nbsp;<a href=\"$scriptname?$qs&page=".($FORM{page}-1)."\">$textPrevious</a> " if $FORM{page}>0;
Change to:

Code: [Select]
$pages_out= "&nbsp;<a class=pagination href=\"$scriptname?$qs&page=".($FORM{page}-1)."\">$textPrevious</a> " if $FORM{page}>0;
Next Find:

Code: [Select]
if($FORM{page}==$pages){$pages_out.= " $p";}
Change to:

Code: [Select]
if($FORM{page}==$pages){$pages_out.= " <span class=paginationselected> $p</span>";}
Next find:

Code: [Select]
else{$pages_out.= qq| <a href="$scriptname?$qs&page=$pages">$p</a>|;}
Change to:

Code: [Select]
else{$pages_out.= qq| <a class=pagination href="$scriptname?$qs&page=$pages">$p</a>|;}
Finally, find:

Code: [Select]
$pages_out.= " <a href=\"$scriptname?$qs&page=".(1+$FORM{page})."\">$textNext</a>" if  $FORM{page} < $total/$records_per_page-1;
Change to:

Code: [Select]
$pages_out.= " <a class=pagination href=\"$scriptname?$qs&page=".(1+$FORM{page})."\">$textNext</a>" if  $FORM{page} < $total/$records_per_page-1;
That will style your page selector to look like this: (beta site ever changing) http://www.maxxtraction.com/c/?tmp=sr&db=pl&pre=MT

Jason

« Last Edit: December 16, 2013, 06:38:08 PM by Jason »
Founder of www.slipdex.com