![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2013
Location: Internet
Posts: 2,425
|
Simple question to php gurus about pagination
My php skills are very limited (I'm still learning) ! So there's a chance to paginate this thing ?
Code:
<?php $xml = simplexml_load_file("camsx.xml"); foreach($xml->children() as $child){ $gal[$child->getname()] = $child[0]; foreach($child as $ch){ $gal[$ch->getname()] = $ch[0]; } if($gal['sex']=="Female" && $n < 1000 && $gal['showmode'] == "free"){ ?><div id="grid"> <div class="host_box"> <a href="/<? echo $gal['screenname']; ?>" target="_self" "><img src="<? echo $gal['liveimage']; ?>" alt="<? echo $gal['screenname']; ?>"><br> <? echo $gal['screenname']; ?></a> </div> <?php $n++; } } ?></div>
__________________
Make Money With: Chaturbate |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Apr 2014
Posts: 393
|
I'm not sure I understood what you want to do, but some time ago I did something similar to a paging putting a counter inside the foreach
Code:
<?php $xml = simplexml_load_file("camsx.xml"); foreach($xml->children() as $child){ $gal[$child->getname()] = $child[0]; foreach($child as $ch){ $gal[$ch->getname()] = $ch[0]; } if($gal['sex']=="Female" && $n < 1000 && $gal['showmode'] == "free"){ ///////////////////// $start = $_GET['start']; $stop = $_GET['start']+5; if($n > $start && $n < $stop){ /////////////////////////////// ?><div id="grid"> <div class="host_box"> <a href="/<? echo $gal['screenname']; ?>" target="_self" "><img src="<? echo $gal['liveimage']; ?>" alt="<? echo $gal['screenname']; ?>"><br> <? echo $gal['screenname']; ?></a> </div> <?php //////////////////// } //////////////// $n++; } } ?></div> Load anyway the whole xml, but shows only a few lines of output |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Mar 2013
Location: Internet
Posts: 2,425
|
Thanks for your help ! That may work on my site with some changes !
__________________
Make Money With: Chaturbate |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2006
Posts: 11,356
|
Change this //////////////////////// to this ////////////////// and
This >>>>><<<<< to this >>>>>>>>>>>/>>>>><<<< And do not forget... This :;:;:;:;:;: should read like this ;(: ![]() and it will work ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |