SRL Archive - SRL Stats

SRL User Stats Signatures


Dynamite

2011-12-14 15:37:04

Didn't realise this forum was here so ima just leave this here :)

Hi there guys, so today is the release of the SRL User Stats Signatures!

This is in beta at the moment, as not all bugs are ironed out and the site looks disgusting, but it is functional.

So here it is:

The site is quite slow at the moment, so if someone wants to host, PM me.

To get your User Stats Signature click here

Thanks
-Boom

doublex8

2011-12-16 00:28:59

Thanks! Looks Smexy :cool:

Nava2

2011-12-16 01:28:48

Code plx

Kyle Undefined

2011-12-16 01:41:04

Nava, here you go. The only thing that is different for his, is the link it produces under the image.


<?php

/**
* @author Dynamite
* @copyright 2011
*/


$urlbase = "http://localhost/game_stats/";

putenv("GDFONTPATH=".realpath("."));

$script_name = $_SERVER["SCRIPT_NAME"];
$script_name = explode('/', $script_name);
$script_name = $script_name[count($script_name) - 1];

If (isset($_GET['js']))
{
?>
var link_to_script = 'http://stats.durp.me/';
$(document).ready(function () {
$('#imgbox').hide()
});

function GetData() {
data = new Array();
$('#select :selected').each(function (i, selected) {
data[i] = $(selected).text().replace(/ /g, '_');
});
return data;
}
function FetchImage(uid, data) {
var request = '?img&uid=' + uid + '&vars=';
$.each(data, function (key, val) {
var substr = val.split(',');
request += '"' + substr[0] + '",'
});
request = request.substring(0, request.length - 1);
$('#img').attr('src', '<?php echo $script_name;?>' + request);
$('#imgbox').show(0);
$('#link').html(link_to_script + (encodeURI(request)));
}
<?php

die();
}

if(isset($_GET['vars'])){
$strArr = stripslashes($_GET['vars']);
$strArr = str_replace('_', ' ', $strArr);
$strArr = str_replace('"', '', $strArr);
$varArr = explode(',', $strArr);
}

If (isset($_GET['img']))
{
Foreach ($_GET as $key => $value)
{
If ($key != 'img')
{
$$key = $value;
}
}

header("Content-type: image/png");
$image = imagecreatefrompng('image3.png');
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$i = 0;
$b = 1;
$c = 0;
$u;
$t;
$r;

$pair = array(2,4,6,8,10,12,14,16,18,20);
$impair = array(1,3,5,7,9,11,13,15,17,19);

$data = @file_get_contents("http://stats.villavu.com/api/user/".$_GET['uid']);
$data = @json_decode($data);

foreach($data as $key => $value){
//print($key.': '.$value.' | ');
if($key == 'rank'){
$r = $value;
}else if($key == 'user'){
$u = $value;
}else if($key == 'time'){
$t = $value;
}

for($j = 0; $j < count($varArr); $j++){
for($k = 0; $k < count($value); $k++){
if(is_array($value)){
if($value[$k][1] == $varArr[$j]){
$i = $i == 0 ? 25 : $i + 15;
$print = $value[$k][1].': '.$value[$k][0].' ';

If ($b > 10)
{
$c = $c == 0 ? 25 : $c + 16;
imagestring($image, 3, 250, $c, $print, $black);
}else{
imagestring($image, 3, 6, $i, $print, $black);
}

$i++;
$b++;
}
}
}
}

}

imagestring($image, 5, 10, 5, "Username: ".$u." Time: ".$t." Rank: ".$r, $white);
imagepng($image);
imagedestroy($images);
}

If (isset($_GET['uid']))
{

$id = intval($_GET['uid']);

$page = '
<html>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="'.$script_name.'?js"></script>
</head>
<body>
<ins></ins>
<b>Username:</b> {$user} <br/>
<b>Rank:</b> {$rank} <br/>
<b>Time:</b> {$time} <br/>

<br/>

{$select}

<br/> <br/>

<div id="imgbox">
<img id="img" src=\''.$script_name.'\' border="0"></img>
<br><br/>
<div id="link"></div>
<br/>
</div>

<button onclick="FetchImage(\'{$uid}\', GetData());">Generate Signature</button>

</body>
</html>
';

$data = @file_get_contents("http://stats.villavu.com/api/user/".$id);

If (!$data)
{
Die ("Couldn't fetch data from the site");
}

$data = @json_decode($data);

If (!$data)
{
Die ("Invalid data");
}

foreach ($data as $key => $value)
{
$$key = $value;
}

$select = '<select multiple="true" style="height: 150px" id="select">';

foreach ($vars as $var)
{
$select .= "<option value=\"{$var[0]}\">{$var[1]}</option>";
}

$select .= '</select>';

eval("\$page = \"".str_replace("\\'", "'", addslashes($page))."\";");
Echo $page;

}else{

$form = '<form method="get" action=""><input type="text" name="uid"/> <input type="submit" value="Search UID"/></form>';
Echo $form;

}


?>

kyocera

2011-12-16 07:59:42

From: Camo Developer
Nava, here you go. The only thing that is different for his, is the link it produces under the image.


<?php

/**
* @author Dynamite
* @copyright 2011
*/


$urlbase = "http://localhost/game_stats/";

putenv("GDFONTPATH=".realpath("."));

$script_name = $_SERVER["SCRIPT_NAME"];
$script_name = explode('/', $script_name);
$script_name = $script_name[count($script_name) - 1];

If (isset($_GET['js']))
{
?>
var link_to_script = 'http://stats.durp.me/';
$(document).ready(function () {
$('#imgbox').hide()
});

function GetData() {
data = new Array();
$('#select :selected').each(function (i, selected) {
data[i] = $(selected).text().replace(/ /g, '_');
});
return data;
}
function FetchImage(uid, data) {
var request = '?img&uid=' + uid + '&vars=';
$.each(data, function (key, val) {
var substr = val.split(',');
request += '"' + substr[0] + '",'
});
request = request.substring(0, request.length - 1);
$('#img').attr('src', '<?php echo $script_name;?>' + request);
$('#imgbox').show(0);
$('#link').html(link_to_script + (encodeURI(request)));
}
<?php

die();
}

if(isset($_GET['vars'])){
$strArr = stripslashes($_GET['vars']);
$strArr = str_replace('_', ' ', $strArr);
$strArr = str_replace('"', '', $strArr);
$varArr = explode(',', $strArr);
}

If (isset($_GET['img']))
{
Foreach ($_GET as $key => $value)
{
If ($key != 'img')
{
$$key = $value;
}
}

header("Content-type: image/png");
$image = imagecreatefrompng('image3.png');
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$i = 0;
$b = 1;
$c = 0;
$u;
$t;
$r;

$pair = array(2,4,6,8,10,12,14,16,18,20);
$impair = array(1,3,5,7,9,11,13,15,17,19);

$data = @file_get_contents("http://stats.villavu.com/api/user/".$_GET['uid']);
$data = @json_decode($data);

foreach($data as $key => $value){
//print($key.': '.$value.' | ');
if($key == 'rank'){
$r = $value;
}else if($key == 'user'){
$u = $value;
}else if($key == 'time'){
$t = $value;
}

for($j = 0; $j < count($varArr); $j++){
for($k = 0; $k < count($value); $k++){
if(is_array($value)){
if($value[$k][1] == $varArr[$j]){
$i = $i == 0 ? 25 : $i + 15;
$print = $value[$k][1].': '.$value[$k][0].' ';

If ($b > 10)
{
$c = $c == 0 ? 25 : $c + 16;
imagestring($image, 3, 250, $c, $print, $black);
}else{
imagestring($image, 3, 6, $i, $print, $black);
}

$i++;
$b++;
}
}
}
}

}

imagestring($image, 5, 10, 5, "Username: ".$u." Time: ".$t." Rank: ".$r, $white);
imagepng($image);
imagedestroy($images);
}

If (isset($_GET['uid']))
{

$id = intval($_GET['uid']);

$page = '
<html>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="'.$script_name.'?js"></script>
</head>
<body>
<ins></ins>
<b>Username:</b> {$user} <br/>
<b>Rank:</b> {$rank} <br/>
<b>Time:</b> {$time} <br/>

<br/>

{$select}

<br/> <br/>

<div id="imgbox">
<img id="img" src=\''.$script_name.'\' border="0"></img>
<br><br/>
<div id="link"></div>
<br/>
</div>

<button onclick="FetchImage(\'{$uid}\', GetData());">Generate Signature</button>

</body>
</html>
';

$data = @file_get_contents("http://stats.villavu.com/api/user/".$id);

If (!$data)
{
Die ("Couldn't fetch data from the site");
}

$data = @json_decode($data);

If (!$data)
{
Die ("Invalid data");
}

foreach ($data as $key => $value)
{
$$key = $value;
}

$select = '<select multiple="true" style="height: 150px" id="select">';

foreach ($vars as $var)
{
$select .= "<option value=\"{$var[0]}\">{$var[1]}</option>";
}

$select .= '</select>';

eval("\$page = \"".str_replace("\\'", "'", addslashes($page))."\";");
Echo $page;

}else{

$form = '<form method="get" action=""><input type="text" name="uid"/> <input type="submit" value="Search UID"/></form>';
Echo $form;

}


?>


Sorry if I missed the point but that's written in java, sooo… how do i get that signature? When i go to the site and type in my UID I get this error "Couldn't fetch data from the site".

Kyle Undefined

2011-12-16 08:05:09

From: kyocera
Sorry if I missed the point but that's written in java, sooo… how do i get that signature? When i go to the site and type in my UID I get this error "Couldn't fetch data from the site".


Umm what? That's not Java, did you miss the "<?php" tag at the top? Also, what UID are you entering?

DeiJaiVui

2011-12-20 23:12:22

Couldn't fetch data from the site.

Press Play

2011-12-22 23:27:34

I'm not too fluent with php, but could you make one for scripts, not just users? If so, that would be awesome! ^_^

EDIT: Not to worry; I found one made by Silent SPY

Kyle Undefined

2011-12-23 01:02:48

From: -daazndagger-
I'm not too fluent with php, but could you make one for scripts, not just users? If so, that would be awesome! ^_^

EDIT: Not to worry; I found one made by Silent SPY


You mean by me :D

Daniel

2011-12-23 04:30:12

From: Kyle Undefined
You mean by me :D


Stop trying to make people believe you are a good asset to this community… We all know your true intentions.

Kyle Undefined

2011-12-23 09:18:52

From: Daniel
Stop trying to make people believe you are a good asset to this community… We all know your true intentions.


Lol, you're right. However, how do we know you're not the sneaky one here? :unsure:

putonajonny

2012-01-23 10:40:54

Could you make it so that we can have these same sigs for individual scripts? I love the style of them.

Jagex_Fagex

2012-02-16 02:14:59

Can you put the url ouput into a smaller area or add a copy to clipboard button? It's a PITA to copy.