Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 8

112.111.x.x forum
112.111.x.x forum
175.44.x.x forum
175.44.x.x forum
175.44.x.x forum
23.20.x.x forum
36.248.x.x forum
89.236.x.x request

Last Seen

xMin Sat 17:58
Dodgeitorelse Sat 17:52
Wussie Sat 17:07
palyarmerc Sat 11:09
BYTM Sat 07:32

Newest Members

Forums
Sorting output options
Mr.Burns
Sun Dec 07 2008, 09:04AM
Guest Is there a way to sort the servers with newest submited server on top? Or even random? My output is now just like the order as i submitted the servers.
Rich
Sun Dec 07 2008, 01:23PM
Posts: 1700
Joined: Wed Nov 26 2003, 04:30PM

There are currently no built in options, its just id order or most players order.

If you want newest servers on top, you can use the advanced management button to put new servers at the top of the list.

Or you could edit the lgsl_class.php and find lgsl_sort_servers_by_id and change:
$server_a['o']['id'] > $server_b['o']['id'] to $server_a['o']['id'] < $server_b['o']['id']

For random, you could edit the lgsl_list.php and remove
$server_list = lgsl_sort_servers($server_list);
So that it lists the servers by last refresh time.
Website
Mr.Burns
Sun Dec 07 2008, 03:21PM
Guest You make it sound so easy....

worked fine!


And another question, maybe even the wrong website to post this...

How should a php file look when i want to extract all servers in the database with one gametype. What i want to do is that users can click on "Call of Duty 4", and see only call of duty 4 servers... The database contains servers with all gametypes, including cod1, 2, and so on...
Maybe this is the hard way, and instead i should use zones... What do you recommend?
Rich
Sun Dec 07 2008, 05:34PM
Posts: 1700
Joined: Wed Nov 26 2003, 04:30PM

Its easier when its your own code

As to your quest, the option that avoids no PHP code, is to setup several copies of LGSL, each with its own database, and split the games between them.

To do it with code, here something to get you started:
http://www.greycube.com/help/lgsl_5.x/lgsl_type_filter.txt
Website
Anonymous
Fri Dec 26 2008, 10:30AM
Guest Added the code, sorting works! thanks man!
I assume this is a safe way? A friend of me said with some code added to the url anyone can flush the database... is this correct? Made a backup anyway..:P

Another question.
Output is a table with 7 cells per row. How can i add a sorting option above it, for example, to sort online players (most players top, no players bottom). Maybe you have a txt file hidding about this aswell.

Thanks for the help anyway! Youve been great.
Rich
Fri Dec 26 2008, 05:11PM
Posts: 1700
Joined: Wed Nov 26 2003, 04:30PM

Your friend is not completely off the mark, but is wrong, and because security is important I will explain why.

Here is how deleting of a database could occur:

$_GET contains data from the url.

so: website/lgsl/?type=source
makes: $_GET[type] = source
making sql: ...WHERE `disabled` = 0 AND `type` = 'source' ORDER BY...

Now some evil person comes along and changes the url.

so: webiste/lgsl?type=';DROP lgsl FROM database;etc '
makes: $_GET[type] = website/lgsl?type=';DROP lgsl FROM database;etc '
making sql: ...WHERE `disabled` = 0 AND `type` = '';DROP lgsl FROM database;etc '' ORDER BY...

By using a single quote and semi-colon in the url, you could break out of the quotes and add something nasty, then just have to join it back up to avoid a sql error. This is called php sql injection, and if your doing php coding, I recommend googling and learning more.

So why is the above code not at risk ? $lgsl_type = mysql_real_escape_string($_GET['type']);
mysql_real_escape_string function escapes ( puts backslashes infront of ) quotes or other sql symbols, so they are treated as text within the quotes.

As to the other question, what you want is 'column sorting' which gets complicated, I dont have a text file for that, so you will need to google it.
Website
dutchbastard
Fri Oct 22 2010, 11:35PM
Posts: 19
Joined: Mon Jan 25 2010, 11:53AM
Registered Member #5749
Rich
Did you ever find out anything about column sorting in your script?
I'm looking around but since I'm quite new to php and not everything is stored in mysql as it's own row I'm having trouble finding out how to call for things and sort by it.
Such as country, gametype, ip etc.

The thing is, I see various fairly easy to implement scripts or bits of code that can sort.
I've made the column headings, but I am unable to make anythign work in your script.

Since you are a lot of experienced then most of us here, perhaps you'd be willing to implement this option yourself?
Website
KIKOFF
Thu Nov 18 2010, 09:56AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
Hi all, maybe this help you to sort table, work for me.
http://www.kryogenix.org/code/browser/sorttable/

Greetings, KIKOFF

Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
dutchbastard
Thu Nov 18 2010, 07:27PM
Posts: 19
Joined: Mon Jan 25 2010, 11:53AM
Registered Member #5749
Kikoff how did you manage to implement that?
Could I see your files?
Website
KIKOFF
Fri Nov 19 2010, 09:36AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
dutchbastard wrote ...

Kikoff how did you manage to implement that?
Could I see your files?

Hi simply place the call to the script in the head and set class='sortable' in the table you need to sort

Saludos

Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
dave19901
Fri Jul 13 2012, 05:52AM
Posts: 6
Joined: Fri Jun 10 2011, 10:53AM
Registered Member #6765
I want to show online a liste by Game, like $_GET['game'].. How can i do this? I have the lgsl 5.8 and i dont find the code that you mean. Please help me
C0n
Tue Sep 18 2012, 12:14AM
Posts: 33
Joined: Tue Nov 03 2009, 01:54AM
Registered Member #5538
Follow my post http://www.greycube.com/site/e107_plugins/forum/forum_viewtopic.php?14726.post

C0n

Live Steam Server List tracking over 1million servers http://www.steam-hacks.com/servers.html Listing more servers than gametracker and game-monitor
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org