04-17-2009, 04:41 PM
|
#5 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Ok, I have figured out the span issue. Here is how I am doing it.
As it loops through, it looks at the $get_page variable, and appends 2 pages before and after it and puts it into an array.
I've tested it and it works perfectly!
Code:
/* CREATE PAGES TO DISPLAY */
for ($i=1; $i<=$page_last; $i++) {
if(($get_page - 2) == $i) $display_pages[] = " <a href=\"$_SERVER[PHP_SELF]?p=$i\">$i</a>";
if(($get_page - 1) == $i) $display_pages[] = " <a href=\"$_SERVER[PHP_SELF]?p=$i\">$i</a>";
if($get_page == $i) $display_pages[] = "$i";
if(($get_page + 1) == $i) $display_pages[] = " <a href=\"$_SERVER[PHP_SELF]?p=$i\">$i</a>";
if(($get_page + 2) == $i) $display_pages[] = " <a href=\"$_SERVER[PHP_SELF]?p=$i\">$i</a>";
}
If $get_page = 10.
Then the output will be:
8 9 10 11 12
|
|
|
|