Jump to content

Reszie it


egturnkey

Recommended Posts

Hello dear friends,

 

I've many titles and the page that show it , show only 15 per page

and as the titles are more than 15 so it shows me 15 and select page below

 

the bad news is that the pages number are getting out of the page cause it is too many

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20---> ect

(goes out the page)

 

so how can i resize it to be as following

 

1 2 3 4 5 6 7 8 9 10

11 12 13 14 15 16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

(pages number 10 ber line)

 

 

here is the code that respoible to show the pages number

 

if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Previous</a>";
} for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a>";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next</a>";
}

 

where $total_pages is the total pages will be shown

 

thanks so much

Link to comment
https://forums.phpfreaks.com/topic/216517-reszie-it/
Share on other sites

"if the current page is greater than 0, and the current page divided by 10 leaves no remainder (remainder == 0), insert a line break"

 

::) well i think almost understood your idea

i set it if the page number divided by 10 then echo <br>

so it means every 10 pages will leave line ...  :shrug: something like this i think...

 

i don't know how to apply it on that code but i will try

 

thank you for that idea

Link to comment
https://forums.phpfreaks.com/topic/216517-reszie-it/#findComment-1125041
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.