-=-
Menu
Tournaments
Profile
Poll
Latest videos
Latest comments
2019-06-22: "Lets get this b..." -A7med
2019-06-16: "Nice tribute F0..." -Vivando
2019-06-13: "Yea, fun little..." -Jelly Jam
2019-06-12: "i found the tim..." -Ragnarok
2019-06-11: "I made a tribut..." -MasterSven
2019-06-09: "you already hav..." -ThunDer
2019-06-09: ""Anyway I ..." -Loon
2019-06-08: "I never said Ra..." -MasterSven
2019-06-08: "Sven sweetie, p..." -King
2019-06-08: "Well Veg, since..." -MasterSven
2019-06-08: "MS:"Imo so..." -Vegito
2019-06-07: "Yeah this gotta..." -ThunDer
Latest matches
flag CX [06:02] -t3>flag
flag CX [10:05] -t3>flag
flag [GpW] [09:07] [CDF]flag
flag [GpW] [05:02] [CDF]flag
flag CX [16:04] [GpW]flag
flag CX [07:03] [GpW]flag
flag [GpW] [08:08] -t3>flag
flag CX [11:09] [GpW]flag
flag CX [18:03] [GpW]flag
flag CX [05:05] -t3>flag
Latest forum posts
By: Borgia, in: CX Internship SchemeClan talk 2019-06-14 09:12
[quote]Our simplest answer however, is that Jety c...
By: ThunDer, in: CX Internship SchemeClan talk 2019-06-14 00:29
m8 we already got we wanted no need to push this f...
By: Ragnarok, in: CX Internship SchemeClan talk 2019-06-13 21:39
Codex.LTD offer a large number of benefits for the...
By: Ragnarok, in: Wall JumpJJ2 related 2019-06-13 21:35
Hi all, Based on a conversation I had with JJ a...
By: Loon, in: CX Internship SchemeClan talk 2019-06-12 22:48
lunch included btw?
More...!

JJnet's forum

«Latest posts» «Latest threads» «Search» «User CP»

     ZStats (and [url]) | [q] 2012-07-07 15:37
wKtKavatar
JJnet user

Posts: 707
121
First of all, gj of integrating it in the main site. This really adds to the idea of a reatime ranking emo

Ok, a small suggestion: Make the records based on playername, not on IP.
For example, see [url=http://www.jazzjackrabbit.net/zstats/showtable.php?page=&pname=aEs wKtK]ID 405 vs ID 69[/url].

Which brings us to the second suggestion: the forum's tags do not support certain characters in the url, like '+' or '%'.
This makes entering urls with certain PHP/SQL formatted arguments a pain.

Also, the old GIP shown on the right is still vulnerable for the ampersand character '&'. Not much evil cn be done with it, but I thought I'd still tell it.

Thanks, great job on the site sofar.


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
Replies
Anubis
CC
avatar
JJnet user
Posts: 181
29
#1 | [q]2012-07-07 19:56
The current top player is some Bulgarian o.o
Grytolle
avatar

JJnet admin
Posts: 847
87
#2 | [q]2012-07-07 21:33
Dunno if Jake still reads this forum every now and then. I just copied some code from one of his scripts and tried to make it fit ok in the front page layout emo
Grytolle
avatar

JJnet admin
Posts: 847
87
#3 | [q]2012-07-07 21:36
Code:

function gipke () {
        $r = "\n".'<table border="0" align="center">'."\n".'';
        $connection = fsockopen("list2.digiex.net", 10057, $errno, $errstr, 1);
        if (!$connection) return false;
        $list = ''; //Received data accumulated here
        while (!feof($connection)) $list .= fread($connection, 8192);
        fclose($connection);
        
        $list = str_replace("<", "<", $list);
    $list = str_replace(">", ">", $list);

        $list = nl2br($list);        
        $list = str_replace("   ", " ", $list);
        $list = str_replace("1.24 x", "1.24x", $list);
        $list = str_replace("1.24 s", "1.24s", $list);
        $list = str_replace("1.21 s", "1.21s", $list);
        $list = str_replace("1.20 s", "1.20s", $list);
        $list = str_replace("1.21", "1.23", $list);


        $list = explode("\n", $list);

        $number = count($list) - 1; //always one too much, accordint to cataphract's script
        for ($counter=0; $counter<$number; $counter++) {
                $server = explode(" ",$list[$counter],8);
                $r .=  '<tr>'."\n".'<td>'.sl_remlixo($server[7]emo.'</td>'."\n".''; //name
                if ($server[2] == "private") $r .= '<td><img src="nyckel.png" width="14" height="6" alt="private"/></td>'."\n".''; //private?
                else $r .= "<td> </td>\n";
                $r .=  "<td>".$server[4]."</td>\n"; //versuib
                $r .=  "<td>".str_replace("unknown","?",str_replace("treasure","trs",str_replace("battle","btl",$server[3]emo))."</td>\n"; //type
//                $r .=  "<td>".$server[6]."</td>";//players in server
list($players,$capacity) = explode("/",str_replace(array("[","]"),"",$server[6]emo);
                $r .=  "<td>[".str_pad($players, 2, 0, STR_PAD_LEFT)."/".str_pad($capacity, 2, 0, STR_PAD_LEFT)."]</td>\n";

                $r .=  "</tr>\n";

        }
        return $r."</table>\n";
}


Mby you can figure out a way to fix the script emo
Jake
NF
avatar
JJnet user
Posts: 99
4
#4 | [q]2012-07-08 11:48
It's actually to prevent someone with personal issues to destroy someone else's stats emo
wKtK
avatar

JJnet user
Posts: 707
121
#5 | [q]2012-07-08 12:13
Quote:
It's actually to prevent someone with personal issues to destroy someone else's stats emo


Ah, yes that makes sense. In that case, maybe you could offer users a function that let's them merge results with the same ingame name, but ONLY if they're on the same IP as the result the other record(s) get merged into...


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
wKtK
avatar

JJnet user
Posts: 707
121
#6 | [q]2012-07-08 12:44
important: remove the underscore from '&_amp;' in these snippets. I had to add it, to prevent the forum from displaying it as a plain '&' character... same goes for '&_lt;' and '&_gt;'.

Ok, I haven't had a chance to test it, seeing as my firewall doesn't seem to like fsockopen making outward connections -_-.
Code:
function gipke () {
                //Write start of table
        $r = "\n".'<table border="0" align="center">'."\n".'';
        /*
         * Open connection. Use the url of the listserver here.
         * Timeout changed from 1 to 2 seconds, to avoid timeouts on lag.
         * If desired, change back to 1 to let the site load a bit faster
         * when the server is experiencing lag.
         * 
         * Addresses to use:
         * list.digiex.net     -  Defaults to a working one?
         * list1.digiex.net    -  The first and main digiex server, back up again.
         * list2.digiex.net    -  Secondary digiex server, seems down atm...
         * Djazz' server       -  Can't find it because his site's down atm. Ask him.
         * list.lun4rsoft.info -  wKtK's expirimental listserver. Not stable atm, don't use yet.
         */
        $connection = fsockopen("list.digiex.net", 10057, $errno, $errstr,2);
        if (!$connection) return false; //Connection failed.
        $list = ''; //Received data accumulated here
        while (!feof($connection)) $list .= fread($connection, 8192); //Read raw data
        fclose($connection);
        
        $list = str_replace("<", "&_lt;", $list);
                $list = str_replace(">", "&_gt;", $list);

        $list = nl2br($list);        
        $list = str_replace("   ", " ", $list);
        $list = str_replace("1.24 x", "1.24x", $list);
        $list = str_replace("1.24 s", "1.24s", $list);
        $list = str_replace("1.21 s", "1.21s", $list);
        $list = str_replace("1.20 s", "1.20s", $list);
        $list = str_replace("1.21", "1.23", $list);


        $list = explode("\n", $list);

        $number = count($list) - 1; //always one too much, according to cataphract's script
        for ($counter=0; $counter<$number; $counter++) {
                $server = explode(" ",$list[$counter],8);
                
                /*
                 * Local fix for ampersands '&' in servernames.
                 * Please read the long comment below this line for a
                 * better solution.
                 */
                $server[7] = str_replace("&","&_amp;",$server[7]emo;
                /*
                 * Below here, the function 'sl_remlixo(String)' gets called.
                 * After some searching, I found this function in a php file
                 * for download on J2O. This function replaces the paragraph sign
                 * and the pipe character ('§' and '|') in servernames.
                 * 
                 * While I provide a local fix here, a better solution would be to
                 * add the following line to the 'sl_remlixo()' function:
                 *                 $v = str_replace("&","&_amp;",$v);
                 * add it just before the return statement, after the replace that
                 * handles the '|' pipe character.
                 * 
                 * I'll also include the fixed sl_remlixo() function.
                 * ~wKtK.
                 */
                $r .=  '<tr>'."\n".'<td>'.sl_remlixo($server[7]emo.'</td>'."\n".''; //name
                
                if ($server[2] == "private") $r .= '<td><img src="nyckel.png" width="14" height="6" alt="private"/></td>'."\n".''; //private?
                else $r .= "<td> </td>\n";
                $r .=  "<td>".$server[4]."</td>\n"; //versuib
                $r .=  "<td>".str_replace("unknown","?",str_replace("treasure","trs",str_replace("battle","btl",$server[3]emo))."</td>\n"; //type
//              $r .=  "<td>".$server[6]."</td>";//players in server
                list($players,$capacity) = explode("/",str_replace(array("[","]"),"",$server[6]emo);
                $r .=  "<td>[".str_pad($players, 2, 0, STR_PAD_LEFT)."/".str_pad($capacity, 2, 0, STR_PAD_LEFT)."]</td>\n";

                $r .=  "</tr>\n";

        }
        return $r."</table>\n";
}



If you choose to update sl_remlixo(), here is the updated version that handles ampersands (Remember, remove the underscore from '&_amp;'):
Code:
function sl_remlixo($v) {
        while (($n = strpos($v,"§")) !== FALSE) { 
                $v = substr($v,0,$n).substr($v,$n +2);
        }
        $v = str_replace("|","",$v);
        $v = str_replace("&","&_amp;",$v);
        return $v;
}



Another site suggestion: fix the codeblock displaying smileys that get copied as 'emo', or & tags getting displayed as the value they represent. not good, not good :p



[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
Grytolle
avatar

JJnet admin
Posts: 847
87
#7 | [q]2012-07-08 12:55
Applied it, seems to work.
(This post has been helpful to 1 of the forumers.)
wKtK
avatar

JJnet user
Posts: 707
121
#8 | [q]2012-07-08 12:56
Glad it works, great to see the GIP back emo


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
DanZeal
[CDF]
avatar
JJnet admin
Posts: 282
15
#9 | [q]2012-07-08 13:12
The original idea for ZStats was that the code should search for the playername and see if theres a match in usernames on JJ.net and then get the IP from there. If the IP is a match, then the data is saved. If there is no match for the playername, the current system would be used. Since the IP on JJ.net is updated everytime you visit it, you could easily update it and avoid duplicates.


"The myth that women should not lift heavy is advanced only by women who fear effort and men who fear women." -Eric Midkiff
wKtK
avatar

JJnet user
Posts: 707
121
#10 | [q]2012-07-08 13:40
Does it recognise clantags? So in other words, as long as I visit jj.net first it will be fine? any delay before it gets updated?


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
Jake
NF
avatar
JJnet user
Posts: 99
4
#11 | [q]2012-07-08 14:30
Quote:
maybe you could offer users a function that let's them merge results with the same ingame name, but ONLY if they're on the same IP as the result the other record(s) get merged into...


Nice idea. I could do that at some point.
DanZeal
[CDF]
avatar
JJnet admin
Posts: 282
15
#12 | [q]2012-07-08 14:54
Quote:
Does it recognise clantags? So in other words, as long as I visit jj.net first it will be fine? any delay before it gets updated?


It would, if it ever gets coded. And no delay.


"The myth that women should not lift heavy is advanced only by women who fear effort and men who fear women." -Eric Midkiff
wKtK
avatar

JJnet user
Posts: 707
121
#13 | [q]2012-07-08 16:05
Ah, that explains it. The reason I asked is because I had visited jj.net a few times already on this IP over the course of a few days, before ZStats made a duplicate entry.

So the reason for that is probably that my jj.net username is 'wKtK' and my ingame name is 'aEs wKtK'...


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
DanZeal
[CDF]
avatar
JJnet admin
Posts: 282
15
#14 | [q]2012-07-08 16:52
Quote:
Ah, that explains it. The reason I asked is because I had visited jj.net a few times already on this IP over the course of a few days, before ZStats made a duplicate entry.

So the reason for that is probably that my jj.net username is 'wKtK' and my ingame name is 'aEs wKtK'...


No, the reason is that this function is NOT coded yet! emo


"The myth that women should not lift heavy is advanced only by women who fear effort and men who fear women." -Eric Midkiff
wKtK
avatar

JJnet user
Posts: 707
121
#15 | [q]2012-07-08 19:29
That's what I meant :p
misunderstandings ftw~


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
Lithium
aEs
avatar
JJnet user
Posts: 1758
107
#16 | [q]2012-07-08 19:39
ZA becomes more competitive with this, that's good emo


We rode on the winds of the rising storm,
We ran to the sounds of the thunder.
We danced among the lightning bolts,
and tore the world asunder.
wKtK
avatar

JJnet user
Posts: 707
121
#17 | [q]2012-07-09 16:31
From the following name "1&_gt;2&_gt;3" (again, remove the underscores) that should be "1>2>3", it seems that the ampersand values don't get translated to their correct meaning...
I'll look into this.


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
wKtK
avatar

JJnet user
Posts: 707
121
#18 | [q]2012-07-12 19:32
The GIP seems broken again.

I believe this is because list1.digiex.net is down again, in favour of list2.digiex.net.

If you want, I can write a version of the above code that checks multiple listservers until it finds a working one, like Jazz2 does.
Any demand for this? emo


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
DanZeal
[CDF]
avatar
JJnet admin
Posts: 282
15
#19 | [q]2012-07-14 17:34
Please do!


"The myth that women should not lift heavy is advanced only by women who fear effort and men who fear women." -Eric Midkiff
wKtK
avatar

JJnet user
Posts: 707
121
#20 | [q]2012-07-15 20:23
Added the functionality to check multiple listservers.

I haven't had a chance to test it yet, due to PHP needing some configuration on my webserver.
If it doesn't work and it's not an easy fix, just show me the output (errors/warnings etc) and I'll fix it emo

[url=http://pastebin.com/bBNyZeJH]http://pastebin.com/bBNyZeJH[/url]


[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]
wKtK
avatar

JJnet user
Posts: 707
121
#21 | [q]2012-08-01 18:06
Sorry for doublepost, but...

I kinda found a vulnerabillity in zstats. Both the small jj.net widget thingy and the table itself do not escape tags and ampersands.

Explanation? check ZStats: [url=http://www.jazzjackrabbit.net/zstats/showtable.php]ZStats[/url].
My name has <i><u></u></i> around it, and another entry I tested had <!-- in it.

This should be prevented, I guess... I kept the score of the <!-- one low (~20.1) so it won't interfere much.

PS: Others can do evil, really evil, with <iframe> here. Even infect everyone simply visiting jj.net, so I thought I'd let you know.



[url=http://wekateka.com/childhood]Nostalgia warning, well, at least if you're one of those ppl...[/url]