Lizardking, little help
Lizardking, little help
CatFlea X |
Jan 18 2004, 05:53 PM
Post
#1
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
Infi said you may help me so blame her
I was wonderin how I would be able to get a little server stats kind of thing showing IP, map on server and how many players I would like it to be able to fit it into a box which is about 200x200 big can you help? YAY RANT!!!!!!!! (I like rant ) -------------------- |
TheLizardKing |
Jan 18 2004, 06:27 PM
Post
#2
|
Secretive Rodian Lover Hater Group: Admin Posts: 93 Joined: 13-June 03 From: Orlando, Florida, United States of America Member No.: 1 |
First off lets get some things down, do you have a PHP capable webserver? And if so, do you know any PHP/HTML? And i'm awesome.
-------------------- AS;LDJFA;LSKFADS
|
Slicer |
Jan 18 2004, 07:18 PM
Post
#3
|
Padawan Group: Members Posts: 24 Joined: 5-August 03 Member No.: 40 |
infinite is a girl? o no wonder the jan skins.
-------------------- |
CatFlea X |
Jan 19 2004, 01:12 PM
Post
#4
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
Lizard, yes I have a php capable server and yes I know html and no not so much PHP but you can have html in php anyways!
if you would like to take a look at the site I am wanting it for it is here Lol @ Slicer You never knew Infi was female? Did you think Infi was male and louved the Jan skins or something? -------------------- |
TheLizardKing |
Jan 19 2004, 02:39 PM
Post
#5
|
Secretive Rodian Lover Hater Group: Admin Posts: 93 Joined: 13-June 03 From: Orlando, Florida, United States of America Member No.: 1 |
I have uploaded the script, basicly it works simply like this. Open her up, edit the ip and port address and BAM include it on a php capable site and you should get two arrays. $players and $variables. This is where the php comes into play. if you want to see the structure of them use:
CODE print_r($players); /* OR */ print_r($variables); Attached File(s) serverstats.inc.php ( 2.01k ) Number of downloads: 310 -------------------- AS;LDJFA;LSKFADS
|
TheLizardKing |
Jan 19 2004, 02:40 PM
Post
#6
|
Secretive Rodian Lover Hater Group: Admin Posts: 93 Joined: 13-June 03 From: Orlando, Florida, United States of America Member No.: 1 |
Oh and one last thing. I got two turn tables and a microphone.
-------------------- AS;LDJFA;LSKFADS
|
CatFlea X |
Jan 19 2004, 03:48 PM
Post
#7
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
I wish I knew how to program this kinda stuff
also, do I have to change anything in the file I download apart from the IP and port? and where would I put this? CODE print_r($players); /* OR */ print_r($variables); One last thing now QUOTE I got two turn tables and a microphone ummmm, wha? -------------------- |
TheLizardKing |
Jan 19 2004, 04:05 PM
Post
#8
|
Secretive Rodian Lover Hater Group: Admin Posts: 93 Joined: 13-June 03 From: Orlando, Florida, United States of America Member No.: 1 |
i'm going to take it you know VERY little PHP... OK here we go! First off the code snipit i gave you was for mildly experianced PHPers, they would get it. Secondly just those two variables is all you need. you include
CODE include_once('the/lizard/king/is/awesome/serverstats.inc.php'); the file. Next you need to parse the arrays to do magical stuff like this: CODE foreach ($variables as $key => $value) { // format output here. remember, $key and $value are your variables you use here. } foreach ($players as $player) { // format output here. now this spits out ANOTHER array called $player, player contains "name","score","ping" hope this helps } -------------------- AS;LDJFA;LSKFADS
|
CatFlea X |
Jan 19 2004, 04:26 PM
Post
#9
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
no, I dont know much php, but all I want is a thing to say the map name on the server, the IP address and the number of players playin, which will fit in a box 200x200
Yes, I am hard to work with, I get confused very easily so I would like you to talk like your talkin to a baby Who's a cwever boi!?!? kinda thing you basically need to tell me in a step by step, simpleton way -------------------- |
TheLizardKing |
Jan 19 2004, 04:32 PM
Post
#10
|
Secretive Rodian Lover Hater Group: Admin Posts: 93 Joined: 13-June 03 From: Orlando, Florida, United States of America Member No.: 1 |
I agree Infi would make a much better teacher than me in the complex arts of data formatting and presentation
-------------------- AS;LDJFA;LSKFADS
|
CatFlea X |
Jan 19 2004, 05:44 PM
Post
#11
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
She told me to come to you
Now I dont have a clue what to do! -------------------- |
InfiniteWarrior |
Jan 19 2004, 07:48 PM
Post
#12
|
Emperor Group: Members Posts: 800 Joined: 21-June 03 Member No.: 20 |
Actually, Flea, this is Liz's masterpiece - the script that returns ALL the variables and player info from the server. It's much cleaner and nicer than the one you're running now. But alas, I don't know how to write out the info it returns, either. Sry, buddy. Designers format output; they don't actually write it. It is The Way of Things.
I believe what he's looking for tho, Mr. Lizard, is a much smaller little dealie (like the blurb on your home page) that will just show who's playing and where. Is that right, Flea? Same arrays but the only "$variable" needed would be the map name. So, where you have "format output here" in your instructions to the mighty CatFlea, if you could tell him how to actually write out the player info in PHP code, I'll be more than happy to help him (echo) format it. |
TheBeast |
Jan 19 2004, 08:52 PM
Post
#13
|
Master Group: -=RJ=-Clan Posts: 444 Joined: 18-June 03 From: Quebec...woohoo !!! Member No.: 12 |
Well... because I think I am PHP-enabled
I can still understand what Lizard script does and what are the output... well not exactly but I still have a good idea So CatFlea... the first question you have to ask yourself (after setting that you only have about 200 X 200 pixels to display the server information) is Want to you want to be displayed ??? - Just the number of player ??? - Only the player, there name & pings & scores ??? - The server variables + the players information (kind of like we have here) Because you have all the information you need to do that in the 2 arrays that are outputed by lizard's script. So tell us what you want... and after we'll tell you how you can display it properly - Beast -------------------- "Separately, woman and alcohol can be quite fun... but when you mix them, they can make you a dumbass"
- Red, That's 70's Show :) |
CatFlea X |
Jan 20 2004, 12:39 PM
Post
#14
|
Padawan Group: Members Posts: 35 Joined: 6-January 04 From: UK Member No.: 89 |
*sigh*
why does nobody understand me I Want something which looks like this New Republic Server (which is linked to the main server stats page which says the server config and stuff) IP : (the IP address when I get it - we dont have server yet, will get it by end of week, hopefully) Map: (whatever the map is if it changes off Bespin lol) Players Currently Connected: (the number of players which are connected) The title and IP I can put into the part which shows the html or php, w/e. So its really just the map and number of players which are connected that I need is that too much to ask? -------------------- |
TheBeast |
Jan 20 2004, 02:04 PM
Post
#15
|
Master Group: -=RJ=-Clan Posts: 444 Joined: 18-June 03 From: Quebec...woohoo !!! Member No.: 12 |
Here you go CatFlea...download this Server Stats Package in the zip file you will find 2 files
1. serverstats.php : it's the same file that Liz posted earlier in the thread... but I added a comment that shows what are in the 2 arrays outputed by the script (so you can see what you can call... and how the variables are called) 2. displayserverstats.php : it's the thing you asked for... what it does is display the IP address, the current map and the number of player currently connected (excluding bots (thing with a ping of 0 to be more exact)) in a 200 X 125 HTML table. So that's about it. - Beast -------------------- "Separately, woman and alcohol can be quite fun... but when you mix them, they can make you a dumbass"
- Red, That's 70's Show :) |
Lo-Fi Version | Time is now: 28th March 2024 - 11:20 AM |