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.
Increase number of players in list?
Re: Increase number of players in list?
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?
The quantity is in the select statement:
Like: limit 0,20
This limits the result set that you get from the select.
Greg
Like: limit 0,20
This limits the result set that you get from the select.
Greg
Running a game is like riding a bike ... well it should be!
New Worlds Engine / FunMayhem.com
Helping you get your game concept up and running. Now.
New Worlds Engine / FunMayhem.com
Helping you get your game concept up and running. Now.
Re: Increase number of players in list?
How might I add a link to see the next or previous 20?
Re: Increase number of players in list?
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
I know this is pseudo code but if you look at any code that does pagination you can get the idea.
Greg
Running a game is like riding a bike ... well it should be!
New Worlds Engine / FunMayhem.com
Helping you get your game concept up and running. Now.
New Worlds Engine / FunMayhem.com
Helping you get your game concept up and running. Now.
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Increase number of players in list?
This is where the limit keyword in queries comes into play:
Something like that. The numbers may be wrong and you would also do some checks and count how many players you have
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);
Re: Increase number of players in list?
What about the number of entries in the drop downs on some of the screens? Is it possible to increase that number?
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Increase number of players in list?
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?
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!
Thanks!
Re: Increase number of players in list?
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.