(X)Aseco+RASP Website Stats v3.6

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by Ant » 15 Dec 2011 23:27

McRobert wrote:Sorry guys, but I get this error on my server and you do not see the banners of users

Code: Select all

PHP Parse error:  syntax error, unexpected T_STRING in /mnt/ssd1/hosted/blackangel.fakaheda.eu/xaseco-stats2/xaseco-stats/playerstats.php on line 155, referer: http://blackangel.fakaheda.eu/xaseco-stats2/xaseco-stats/?serv=0&lang=ENG&page=playerstatsbox&plid=20
Thanks
It looks like you're using the beta for tm2, In this version you need to add your ManiaPlanet Web Services username and password into the provided fields in the config.

Code: Select all

$username[$i] = 'USER'; // MPWS username
$password[$i] = 'PASS'; //MPWS password
The latest beta was posted by w1lla here if you missed it -> viewtopic.php?f=127&t=27475&start=165#p199676
McRobert wrote: For your problem I solved by putting this string in config.php

Code: Select all

mysql_query('set names utf8');
Nice one for that fix :thumbsup:

User avatar
sbone
happy cruiser
happy cruiser
Posts: 180
Joined: 13 Sep 2007 18:11
Owned TM-games: TMUF, TM2
Location: In the sky...
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by sbone » 16 Dec 2011 14:20

Ant wrote:
McRobert wrote: For your problem I solved by putting this string in config.php

Code: Select all

mysql_query('set names utf8');
Nice one for that fix :thumbsup:
Yes it works for the ranking page but not for the banner player page (page=playerstatsbox&plid=x) same incorrect nickname displayed :(
I try many

Code: Select all

mysql_query('set somethings utf8');
but without success.
An idea ?
Thanks
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: (X)Aseco+RASP Website Stats v3.6

Post by w1lla » 16 Dec 2011 14:55

For both players:

Inside includes/db_connect.php you can delete the slashes: so you get this:

Code: Select all

<?php
$db = mysql_connect($db_host[$serv], $db_user[$serv], $db_pass[$serv]) or ("Error connecting to MySQL database.");
mysql_select_db($db_name[$serv],$db);
$SQL_Characters="SET NAMES utf8";
$charset=mysql_query($SQL_Characters);
?>

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

User avatar
sbone
happy cruiser
happy cruiser
Posts: 180
Joined: 13 Sep 2007 18:11
Owned TM-games: TMUF, TM2
Location: In the sky...
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by sbone » 16 Dec 2011 15:10

w1lla wrote:For both players:

Inside includes/db_connect.php you can delete the slashes: so you get this:

Code: Select all

<?php
$db = mysql_connect($db_host[$serv], $db_user[$serv], $db_pass[$serv]) or ("Error connecting to MySQL database.");
mysql_select_db($db_name[$serv],$db);
$SQL_Characters="SET NAMES utf8";
$charset=mysql_query($SQL_Characters);
?>
Thanks ;) it works....for almost the nicknames with special caracteres,
but there is still a little few errors, see screenchots :

Image
Image
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: (X)Aseco+RASP Website Stats v3.6

Post by w1lla » 16 Dec 2011 15:32

ah k should look at the colorparser function :P

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by Ant » 16 Dec 2011 16:05

Thats to do with the font being used in the banners, (i'm pretty sure, cos nocturne covered that earlier in this thread) ARIALUNI.TTF produces the best results but it isn't legal to distribute or even use without a licence.

Edit: By the way, this will give you a better result for the country field in the top 2 banners (tm2 version)

playerstats.php

Code: Select all

<?php
/*************************************************
*                                                *
*   Stats for XAseco+RASP                        *
*   __________________________________________   *
*                                                *
*   Copyright (c) 2007-2008 by oS.Cypher         *
*   Developed as a Project of Old School Gaming  *
*                                                *
*   http://www.os-gaming.de                      *
*                                                *
*************************************************/

require('config.php');
require('includes/globals.php');
require('includes/functions.php');
include('languages/' . $lang . '.php');
require('includes/ColorParser.php');
require_once('includes/tm2mpws/libraries/autoload.php');
include('includes/db_connect.php');

$cp = new ColorParser();
$arial = 'fonts/tahoma';
$arial2 = 'fonts/arial.ttf';

/**
* Summary: Strips all display formatting from an input string, suitable for display
*          within the game ('$$' escape pairs are preserved) and for logging
* Params : $input - The input string to strip formatting from
*          $for_tm - Optional flag to double up '$' into '$$' (default, for TM) or not (for logs, etc)
* Returns: The content portions of $input without formatting
* Authors: Bilge/Assembler Maniac/Xymph/Slig
*/

function stripFormatting($input, $for_tm = true) {
    return
        //Replace all occurrences of a null character back with a pair of dollar
        //signs for displaying in TM, or a single dollar for log messages etc.
        str_replace("\0", ($for_tm ? '$$' : '$'),
            //Replace links (introduced in TMU)
            preg_replace(
                '/
                #Strip TMF H, L & P links by stripping everything between each square
                #bracket pair until another $H, $L or $P sequence (or EoS) is found;
                #this allows a $H to close a $L and vice versa, as does the game
                \\$[hlp](.*?)(?:\\[.*?\\](.*?))*(?:\\$[hlp]|$)
                /ixu',
                //Keep the second and third capturing groups if present
                '$1$2',
                //Replace various patterns beginning with an unescaped dollar
                preg_replace(
                    '/
                    #Match a single dollar sign and any of the following:
                    \\$
                    (?:
                        #Strip color codes by matching any hexadecimal character and
                        #any other two characters following it (except $)
                        [0-9a-f][^$][^$]
                        #Strip any incomplete color codes by matching any hexadecimal
                        #character followed by another character (except $)
                        |[0-9a-f][^$]
                        #Strip any single style code (including an invisible UTF8 char)
                        #that is not an H, L or P link or a bracket ($[ and $])
                        |[^][hlp]
                        #Strip the dollar sign if it is followed by [ or ], but do not
                        #strip the brackets themselves
                        |(?=[][])
                        #Strip the dollar sign if it is at the end of the string
                        |$
                    )
                    #Ignore alphabet case, ignore whitespace in pattern & use UTF-8 mode
                    /ixu',
                    //Replace any matches with nothing (i.e. strip matches)
                    '',
                    //Replace all occurrences of dollar sign pairs with a null character
                    str_replace('$$', "\0", $input)
                )
            )
        )
    ;
}

function stripColors($str, $for_tm_drawing = true)
{
    $str2 = str_replace('$', "\001", preg_replace("`[\001\002]`", '', 'a' . $str) );

    if($for_tm_drawing)
        $str2 = str_replace("\001\001", '$$', $str2);
    else
        $str2 = str_replace("\001\001", '$', $str2);

    $str2 = preg_replace("`\001[hlHL]`","\002",$str2);
    $str2 = preg_replace("`\002\[([^\]]*)\]([^\002]*)\002`","$2",$str2);
    $str2 = preg_replace("`\002\[([^\]]*)\]`","",$str2);
    $str2 = str_replace("\002", '', $str2);
    $str2 = str_replace('{/LINK}', '</a>', $str2);
    $str2 = preg_replace("`\001([0-9a-fA-F][0-9a-zA-Z][0-9a-zA-Z]|[^\001])`","",$str2);
    $str2 = str_replace("\001", '$$', substr($str2,1) );

    return $str2;
}

$timeout = 5;
$fp = @fsockopen($ip2[$serv], $server_port[$serv], $errno, $errstr, $timeout);
if($fp) {
    fclose($fp);
    require('includes/GbxRemote.inc.php');
    $client = new IXR_Client_Gbx;
    if (!$client->InitWithIp($ip[$serv], $port[$serv])) {
           die('An error occurred - ' . $client->getErrorCode() . ':' . $client->getErrorMessage());
    }
    if (!$client->query('Authenticate', $user[$serv], $pass[$serv])) {
        Error($client->getErrorMessage(), $client->getErrorCode());
        print 'login failed !<br/>';
    }
    if($client->query('GetServerOptions')) {
        $ServerOptions = $client->getResponse();
        $sname_tmtags = $ServerOptions['Name'];
        $sname_stripped = stripFormatting($sname_tmtags);
//        $sname_stripped = preg_replace("`\\$(w|s|n|i|z|g|m|r|>|<|o|l|h)`", "", $sname_stripped);
//        $sname_stripped = preg_replace("`\\[[A-Za-z0-9]+\.[A-Za-z0-9]+\.[A-Za-z0-9]+\]`", "", $sname_stripped);
//        $sname_stripped = preg_replace("`\\[[A-Za-z0-9]+\.[A-Za-z0-9]+\-[A-Za-z0-9]+\.[A-Za-z0-9]+\.[A-Za-z0-9]+\]`", "", $sname_stripped);
//        $sname_stripped = preg_replace("`\\$[a-f0-9]{3}`",  "", $sname_stripped);
//        $sname_stripped = preg_replace("`\\$[a-f0-9]{2}`","", $sname_stripped);
//        $sname_stripped = preg_replace("`\\$[a-f0-9]{1}`", "", $sname_stripped);
    }
}

$sql = 'SELECT * FROM rs_rank ORDER BY avg ASC';
$result = mysql_query($sql);
$rank = 1;

while($data = mysql_fetch_array($result)){
    if($data['PlayerId'] == $plid) {
        // Player is ranked
        $playerrank = $rank;
        $avg = $data['Avg']/10000;
        $avg = sprintf('%.1f', $avg);
        break;
    } else {
        $rank++;
    }
}

if (!isset($playerrank)) {
    // Player is not ranked
    $playerrank = '-';
    $avg = '-';
}

$sql = 'SELECT * FROM players WHERE Id=' . $plid;
$result = mysql_query($sql);
$data = mysql_fetch_array($result);
$playerlogin = $data['Login'];
$players = new \Maniaplanet\WebServices\Canyon\MultiplayerRankings($username[$i], $password[$i]);
try
	{
		$player = $players->getPlayer($playerlogin);
		//var_dump($player);
	}
	catch(\Maniaplanet\WebServices\Exception $e)
	{
		echo "Error!\n";
		printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
			$e->getHTTPStatusMessage());
		echo "\n";
		printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
		echo "\n";
	}
$pname_tmtags = $data['NickName'];
$pname_stripped = stripFormatting($pname_tmtags);
//$pname_stripped = preg_replace("`\\$(w|s|n|i|z|g|m|r|>|<|o|l|h)`", "", $pname_stripped);
//$pname_stripped = preg_replace("`\\[[A-Za-z0-9]+\.[A-Za-z0-9]+\.[A-Za-z0-9]+\]`", "", $pname_stripped);
//$pname_stripped = preg_replace("`\\[[A-Za-z0-9]+\.[A-Za-z0-9]+\-[A-Za-z0-9]+\.[A-Za-z0-9]+\.[A-Za-z0-9]+\]`", "", $pname_stripped);
//$pname_stripped = preg_replace("`\\$[a-f0-9]{3}`", "", $pname_stripped);
//$pname_stripped = preg_replace("`\\$[a-f0-9]{2}`", "", $pname_stripped);
//$pname_stripped = preg_replace("`\\$[a-f0-9]{1}`", "", $pname_stripped);
$nation = $data['Nation'];
$flag = ($nation ? 'img/flags/' . $nation . '.png' : 'img/flags/UKN.png');
$MwTime = $data['TimePlayed'];
$hours = floor($MwTime/3600);
$minutes = floor(($MwTime/60-$hours*60));
$seconds = substr($MwTime-$minutes*60-$hours*3600,-2);
$time = sprintf('%02dh %02dm %02ds', $hours, $minutes, $seconds);

// STATS BANNERS
if($statsbox == 1) {
    //create small Statusgraphic
    $im = ImageCreateFromPNG ('img/statsbox/playerstats_big.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);  // white
    $black = ImageColorAllocate ($im, 0, 0, 0); // black
    $cp->drawStyledString($im, 10, 85, 14, $white, $arial, $pname_tmtags . ' @ ' . $sname_tmtags);
    //imagettftext($im, 10, 0, 300, 14, $white, $arial2, '@ '.$sname_stripped);
    //$cp->drawStyledString($im, 10, 310, 14, $white, $arial, $sname_tmtags);
    imagettftext($im, 10, 0, 60, 34, $black, $arial2, $lng_stats_server . ' ' . $lng_trecords_id . ': ' . $playerrank . '    ' . $lng_players_avg . ': ' . $avg);
    imagettftext($im, 10, 0, 60, 54, $black, $arial2, $lng_players_timeplayed . ': ' . $time);
    $nationflag = imagecreatefrompng($flag);
    imagealphablending($im, 1);
    imagealphablending($nationflag, 1);
    imagecopy($im, $nationflag, 60,4,0,0,18,11);
    Header ('Content-type: image/png');
    ImagePng ($im); // Als PNG ausgeben
    ImageDestroy ($im); // Resourcen freigeben
}

if($statsbox == 2){
    //create small Statusgraphic
    $im = ImageCreateFromPNG ('img/statsbox/playerstats_middle.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);  // white
    $black = ImageColorAllocate ($im, 0, 0, 0); // black
    imagettftext($im, 8, 0, 10, 12, $white, $arial2, $pname_stripped);
    imagettftext($im, 8, 0, 10, 25, $white, $arial2, $lng_stats_blank . ' @ ' . $sname_stripped);
    imagettftext($im, 8, 0, 5, 32, $white, $arial2, '--------------------------------------------------');
    imagettftext($im, 8, 0, 10, 42, $white, $arial2, $lng_stats_server . ' ' . $lng_trecords_id . ': ' . $playerrank);
    imagettftext($im, 8, 0, 10, 55, $white, $arial2, $lng_players_avg . ': ' . $avg);
    Header ('Content-type: image/png');
    ImagePng ($im); // Als PNG ausgeben
    ImageDestroy ($im); // Resourcen freigeben
}

if($statsbox == 3){
    //create small Statusgraphic
    $im = ImageCreateFromPNG ('img/statsbox/playerstats_small.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);  // white
    $black = ImageColorAllocate ($im, 0, 0, 0); // black
    imagettftext($im, 7, 0, 110, 9, $white, $arial2, $pname_stripped . ' @ ' . $sname_stripped);
    imagettftext($im, 6, 0, 110, 18, $white, $arial2, $lng_stats_server . ' ' . $lng_trecords_id . ': ' . $playerrank .
					'  --  ' . $lng_players_avg . ': ' . $avg . '  --  ' . $lng_players_timeplayed . ': ' . $time);
    Header ('Content-type: image/png');
    ImagePng ($im); // Als PNG ausgeben
    ImageDestroy ($im); // Resourcen freigeben
}

if($statsbox == 4){
    //create World-TMN Statusgraphic
    $im = ImageCreateFromPNG ('img/statsbox/signature.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);  // white
    $black = ImageColorAllocate ($im, 0, 0, 0); // black
	    $textX = 21;
    $textY = 12;
    $textsize = 9;
    $lineheight = 17;
    imagettftext($im, $textsize, 0, $textY, $textX, $white, $arial2, 'Nickname: ' . $pname_stripped);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Nationrank: ' . $player->ranks[1]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Worldrank: ' . $player->ranks[0]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Ladderpoints: ' . $player->points);
	//imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[0]->path);
    //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[1]->path);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $data['Nation']);
	$nationflag = imagecreatefrompng($flag);
	imagealphablending($im, 1);
    imagealphablending($nationflag, 1);
    imagecopy($im, $nationflag, 95,80,0,0,18,11);
    Header ('Content-type: image/png');
    ImagePng ($im);
    ImageDestroy ($im);
}

if($statsbox == 5){
    $im = ImageCreateFromPNG ('img/statsbox/signature_player.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);
//    $name = stripFormatting($fetcher->nickname);
    $textX = 21;
    $textY = 12;
    $textsize = 9;
    $lineheight = 17;
    imagettftext($im, $textsize, 0, $textY, $textX, $white, $arial2, 'Nickname: ' . $pname_stripped);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Nationrank: ' . $player->ranks[1]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Worldrank: ' . $player->ranks[0]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Ladderpoints: ' . $player->points);
    //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[0]->path);
	//imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[1]->path);
	imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $data['Nation']);
	$nationflag = imagecreatefrompng($flag);
	imagealphablending($im, 1);
    imagealphablending($nationflag, 1);
    imagecopy($im, $nationflag, 95,80,0,0,18,11);
    Header ('Content-type: image/png');
    ImagePng ($im);
    ImageDestroy ($im);
}

?>
Edit2: Also for the banners, there is this code near the top of playerstats.php:

Code: Select all

$arial = 'fonts/tahoma';
$arial2 = 'fonts/arial.ttf';
For the banners that don't display properly, you can change arial2 into arial, for example this:

Code: Select all

if($statsbox == 5){
    $im = ImageCreateFromPNG ('img/statsbox/signature_player.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);
//    $name = stripFormatting($fetcher->nickname);
    $textX = 21;
    $textY = 12;
    $textsize = 9;
    $lineheight = 17;
    imagettftext($im, $textsize, 0, $textY, $textX, $white, $arial2, 'Nickname: ' . $pname_stripped);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Nationrank: ' . $player->ranks[1]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Worldrank: ' . $player->ranks[0]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Ladderpoints: ' . $player->points);
    //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[0]->path);
   //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $player->ranks[1]->path);
   imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial2, 'Country: ' . $data['Nation']);
   $nationflag = imagecreatefrompng($flag);
   imagealphablending($im, 1);
    imagealphablending($nationflag, 1);
    imagecopy($im, $nationflag, 95,80,0,0,18,11);
    Header ('Content-type: image/png');
    ImagePng ($im);
    ImageDestroy ($im);
}
would become:

Code: Select all

if($statsbox == 5){
    $im = ImageCreateFromPNG ('img/statsbox/signature_player.png'); // Open of the Master-Picture
    $white = ImageColorAllocate ($im, 255, 255, 255);
//    $name = stripFormatting($fetcher->nickname);
    $textX = 21;
    $textY = 12;
    $textsize = 9;
    $lineheight = 17;
    imagettftext($im, $textsize, 0, $textY, $textX, $white, $arial, 'Nickname: ' . $pname_stripped);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Nationrank: ' . $player->ranks[1]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Worldrank: ' . $player->ranks[0]->rank);
    imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Ladderpoints: ' . $player->points);
    //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Country: ' . $player->ranks[0]->path);
   //imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Country: ' . $player->ranks[1]->path);
   imagettftext($im, $textsize, 0, $textY, $textX+=$lineheight, $white, $arial, 'Country: ' . $data['Nation']);
   $nationflag = imagecreatefrompng($flag);
   imagealphablending($im, 1);
    imagealphablending($nationflag, 1);
    imagecopy($im, $nationflag, 95,80,0,0,18,11);
    Header ('Content-type: image/png');
    ImagePng ($im);
    ImageDestroy ($im);
}
This will fix a lot of the banners, but maybe not all of them.

User avatar
sbone
happy cruiser
happy cruiser
Posts: 180
Joined: 13 Sep 2007 18:11
Owned TM-games: TMUF, TM2
Location: In the sky...
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by sbone » 16 Dec 2011 22:27

Ant wrote:Thats to do with the font being used in the banners, (i'm pretty sure, cos nocturne covered that earlier in this thread) ARIALUNI.TTF produces the best results but it isn't legal to distribute or even use without a licence.
...
This will fix a lot of the banners, but maybe not all of them.
I try arialuni.ttf, but best results for mine is 'arial'.
Yes its only about font use and you 'll never find the right font cause TM2 accept too much font type in nickname ;)

Many thanks to all ;)
HF
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by Ant » 18 Dec 2011 22:07

No problem man, did you try that code for the improved banner? -> viewtopic.php?f=127&t=27475&p=199856#p199818 (tm2 version) It now gives the proper result in the country field - at the moment, everybodys country is set as "World" that last playerstats.php that I posted fixes that.

User avatar
sbone
happy cruiser
happy cruiser
Posts: 180
Joined: 13 Sep 2007 18:11
Owned TM-games: TMUF, TM2
Location: In the sky...
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by sbone » 20 Dec 2011 15:50

Ant wrote:No problem man, did you try that code for the improved banner? -> viewtopic.php?f=127&t=27475&p=199856#p199818 (tm2 version) It now gives the proper result in the country field - at the moment, everybodys country is set as "World" that last playerstats.php that I posted fixes that.
Yes it works, but i had already fix this (simply see case 1 and 5 ;) )
sorry not to have post this fix before :(

Thanks
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
McRobert
cyclist
cyclist
Posts: 36
Joined: 19 Jun 2008 23:28
Owned TM-games: TMFU, TM²
Location: Cremona, Italy
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by McRobert » 21 Dec 2011 11:16

Ant wrote: It looks like you're using the beta for tm2, In this version you need to add your ManiaPlanet Web Services username and password into the provided fields in the config.

Code: Select all

$username[$i] = 'USER'; // MPWS username
$password[$i] = 'PASS'; //MPWS password
The latest beta was posted by w1lla here if you missed it -> viewtopic.php?f=127&t=27475&start=165#p199676
McRobert wrote: For your problem I solved by putting this string in config.php

Code: Select all

mysql_query('set names utf8');
Nice one for that fix :thumbsup:
But the one I use is already the updated version, and user and pass for MPWS are correct, my mistake could be due to PHP 5.2.9 which is installed on my web server?
thanks
BaMcRober
Image
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: (X)Aseco+RASP Website Stats v3.6

Post by w1lla » 21 Dec 2011 11:20

Requirements
PHP 5.3 or newer
cURL extension (http://php.net/manual/en/book.curl.php)
JSON extension (http://php.net/manual/en/book.json.php)
You must be able to make HTTPS requests on ws.maniaplanet.com
http://code.google.com/p/maniaplanet-ws ... ingStarted

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

xefil
pedestrian
pedestrian
Posts: 13
Joined: 15 Nov 2011 16:44
Owned TM-games: TMC

Re: (X)Aseco+RASP Website Stats v3.6

Post by xefil » 11 Jan 2012 11:41

Hello!

Could someone point me to the right setting to show the players with special characters correctly?
I.e.:
义EƒเĹ
is shown as
?E???
On phpMyAdmin I can browse the values correctly and the symbols are shown. Also on the DB is stored correctly.
I've apache on linux box. Using "AddDefaultCharset ISO-8859-1" helps to see correctly only the "ƒ". Other characters are still not handled.

Thank's for suggestions.

simon

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by Ant » 11 Jan 2012 16:21

where is it not showing correctly? banners? ladder page? It could be the fonts if on the banners, that has been explained many times throughout this thread if thats the case though.

xefil
pedestrian
pedestrian
Posts: 13
Joined: 15 Nov 2011 16:44
Owned TM-games: TMC

Re: (X)Aseco+RASP Website Stats v3.6

Post by xefil » 11 Jan 2012 17:00

It's the player list information page as well as the banner generator.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: (X)Aseco+RASP Website Stats v3.6

Post by Ant » 11 Jan 2012 17:20


Post Reply