Page 1 of 1
Increase number of players in list?
Posted: Fri Sep 18, 2015 6:28 pm
by cbsarge
When I click on Search Players the number of results is limited to 20. How can I increase this number or maybe make it paginated?
Thank you.
Re: Increase number of players in list?
Posted: Fri Sep 18, 2015 7:45 pm
by cbsarge
Would adding something like this to the content.php file in the view_player module work? I'm sure this isn't exactly right as it cause my page to crash but, perhaps it's close?
Code: Select all
<a href='.$_SERVER['PHP_SELF'].'?result='.($result+10).'>Next</a>
Re: Increase number of players in list?
Posted: Fri Sep 18, 2015 9:12 pm
by gmoore
The quantity is in the select statement:
Like: limit 0,20
This limits the result set that you get from the select.
Greg
Re: Increase number of players in list?
Posted: Sat Sep 19, 2015 2:53 am
by cbsarge
How might I add a link to see the next or previous 20?
Re: Increase number of players in list?
Posted: Sat Sep 19, 2015 11:14 pm
by gmoore
This would be the same concept as pagination for a blog page. You might include the starting player and ending players in the URL (like: ?start_player=123&end_player=456). You would then add a section the content.php to recognize your are going backward or forward (if (isset($_GET["back"]) ... if (isset($_GET["forward"]))). Then change the SQL to make the range less than or greater than the start_player or end_player but still limit the last or first 20 accordingly.
I know this is pseudo code but if you look at any code that does pagination you can get the idea.
Greg
Re: Increase number of players in list?
Posted: Sun Sep 20, 2015 4:37 am
by KyleMassacre
This is where the limit keyword in queries comes into play:
Code: Select all
$perPage = (isset($_GET['perPage']) ? $_GET['perPage'] + 0 : 20);
$page = (isset($_GET['page']) ? $_GET['page'] + 1 : 0);
$start = $page * $perPage;
$result = $db->Execute("select * from users limit ?,?",$start,$perPage);
//echo all the data here
ButtonArea();
if($page >= 1)
echo LinkButton("Back","index.php?p=module&page=".$page-1);
echo LinkButton("Next","index.php?p=module&page=".$page+1);
Something like that. The numbers may be wrong and you would also do some checks and count how many players you have
Re: Increase number of players in list?
Posted: Mon Sep 21, 2015 3:25 pm
by cbsarge
What about the number of entries in the drop downs on some of the screens? Is it possible to increase that number?
Re: Increase number of players in list?
Posted: Mon Sep 21, 2015 3:27 pm
by KyleMassacre
I believe that is set to a fixed height hiding the overflow so you may have to change the CSS properties on that
Re: Increase number of players in list?
Posted: Mon Sep 21, 2015 3:39 pm
by cbsarge
Would that be in the CSS for the template I'm using or is it buried in all of the module folders in different CSS files?
Thanks!
Re: Increase number of players in list?
Posted: Mon Sep 21, 2015 3:41 pm
by cbsarge
Hmmm... there seems to be a size parameter applied to the slection list. Increasing that on the fly lengthens the drop down but, not the number of results returned.