(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 » 09 Dec 2011 21:11

Nice, there may be a new version soon because the player banners for global stats has already been tweaked for a little nicer display.

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 » 10 Dec 2011 13:52

Hi,

i have one problem since a lots of time with TM2 servers and same thing with last update of xstats.
Nicknames are well displayed for all xstats pages exect the ranking page (/xstats/?serv=0&lang=FRA&page=players)
See screenshots below :

Image


Image

On this ranking page, see the "?" in place of special caracteres in nickname column

Im using php 5.3.2, i check my os locale, UTF-8 enconding for http...
I don't find an issue.
Any idea ?

Thanks
Sorry if this has already be posted, but don't see it ;)
-- 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 » 11 Dec 2011 19:17

Maybe it has something to do with your changes to pages/players.php ? Have you double checked 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 » 11 Dec 2011 19:47

Ant wrote:Maybe it has something to do with your changes to pages/players.php ? Have you double checked that ?
No change on that page :(
-- 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 » 11 Dec 2011 20:24

Ok, well do you get these results with a clean install (try a test install maybe)

What changes have you made though?

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 » 12 Dec 2011 08:32

Ant wrote:Ok, well do you get these results with a clean install (try a test install maybe)

What changes have you made though?
Only changes in config.php for the colors
Same problem with a "clean original" install :(
-- 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 » 12 Dec 2011 20:27

Well the only difference I can see is you are on php 5.3.2 and I am still using 5.2.17 - Its quite strange though, I'll look into it a bit more then try and give you a solution.

Edit: Can you try this and let me know if that changes anything please?

pages/players.php

Code: Select all

<?php
require("config.php");

print "<p class=\"tabletitle\">$lng_players_headline</p>";

if (!$pos) $pos = 0;
if (is_null($orderby)) $orderby = "rank";
if (is_null($sort)) $sort = "ASC";

$sorturl = "?serv=$serv&lang=$lang&page=$page&orderby=%s&sort=".(($sort == "ASC") ? "DESC" : "ASC");

print "<table width=\"100%\" border=\"0\" bgcolor=\"$bg4\" align=\"center\">
  <tr bgcolor=\"$resultbg\">
    <td width=\"60\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "rank")."\">$lng_players_rank</a></td>
    <td width=\"150\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "NickName")."\">$lng_players_nickname</a></td>
    <td width=\"150\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "Login")."\">$lng_players_login</a></td>
    <td width=\"80\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "rank")."\">$lng_players_avg</a></td>
    <td width=\"120\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "TimePlayed")."\">$lng_players_timeplayed</a></td>
	<td width=\"120\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "UpdatedAt")."\">$lng_players_lastvisit</a></td>
    <td width=\"60\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "Id")."\">$lng_players_id</a></td>
    <td width=\"50\" class=\"tablehead\"><a href=\"".sprintf($sorturl, "Nation")."\">$lng_players_nation</a></td>";
    if ($show_player_banners) print "<td width=\"50\" class=\"tablehead\">$lng_players_banner</td>";
print "</tr>";

$sql = "SELECT * FROM (
			SELECT t1.*, @r:=@r+1 AS rank
			FROM (
				SELECT p.*, r.avg, r.avg IS NULL AS norank
				FROM players p
				LEFT JOIN rs_rank r ON p.Id = r.playerID
				ORDER BY norank ASC, r.avg ASC
			) t1, (SELECT @r:=0) t2
		) t3
		ORDER BY %s
		LIMIT $pos, $count";

if ($orderby == "rank") {
	$sql = sprintf($sql, "norank $sort, $orderby $sort");
} else {
	$sql = sprintf($sql, "$orderby $sort");
}

$result = mysql_query($sql) or die(mysql_error());
$totalrows = mysql_num_rows(mysql_query("SELECT * FROM players"));

if ($totalrows < 1) {
	print "<tr><td class=\"celltext\" colspan=\"10\">No results</td></tr>";
} else {
	$new_pos_next = $pos + $count;
	$new_pos_prev = $pos - $count;
	$link_next = ($new_pos_next >= $totalrows) ? "" : "?serv=$serv&lang=$lang&page=$page&pos=$new_pos_next&orderby=$orderby&sort=$sort";
	$link_prev = ($new_pos_prev < 0) ? "" : "?serv=$serv&lang=$lang&page=$page&pos=$new_pos_prev&orderby=$orderby&sort=$sort";

	$bg = $bg1;
	while($data = mysql_fetch_array($result))
	{
		$MwTime = $data['TimePlayed'];
		$lastvisited = $data['UpdatedAt'];
		$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);
		if (!is_null($data['avg'])) {
			$avg = sprintf ("%.1f", $data['avg']/10000);
			$rank = $data['rank'];
		} else {
			$avg = "-";
			$rank = "-";
		}
		
		

		$bg = ($bg == $bg1) ? $bg2 : $bg1;
		echo "<tr bgcolor=".$bg." onMouseOver=\"this.style.backgroundColor='".$bg3."'\" onMouseOut=\"this.style.backgroundColor='".$bg."'\">";
		echo "<td class=\"celltext\">".$rank."</td>";
		if ($stunt[$serv]){
		echo "<td class=\"celltext\"><a href=\"?serv=".$serv."&lang=".$lang."&page=stprecords&plid=".$data['Id']."\" class=\"celltext\">".$cp->toHTML($data['NickName'], false, true, 'all')."</a></td></td>";
		} else {
		echo "<td class=\"celltext\"><a href=\"?serv=".$serv."&lang=".$lang."&page=precords&plid=".$data['Id']."\" class=\"celltext\">".$cp->toHTML($data['NickName'], false, true, 'all')."</a></td></td>";
		}
		echo "<td class=\"celltext\">".$data['Login']."</td>";
		echo "<td class=\"celltext\">".$avg."</td>";
		echo "<td class=\"celltext\">".$time."</td>";
		echo "<td class=\"celltext\">".$lastvisited."</td>";
		echo "<td class=\"celltext\">".$data['Id']."</td>";
		if($data['Nation']){
			echo "<td class=\"celltext\"><img src=\"img/flags/".$data['Nation'].".png\" alt=\"".$data['Nation']."\" title=\"".$data['Nation']."\"></td>";
		} else {
			echo "<td class=\"celltext\"><img src=\"img/flags/UKN.png\" alt=\"Unknown\" title=\"Unknown\"></td>";
		}
	    if ($show_player_banners) print "<td class=\"celltext\"><a href=\"?serv=".$serv."&lang=".$lang."&page=playerstatsbox&plid=".$data['Id']."\"><img src=\"img/stats.gif\" border=\"0\"></a></td>";
	    echo "</tr>";
	}
}

?>

</table>

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 » 13 Dec 2011 10:42

Things are little different but still the problem with special chars.

Image

Yes i think is due to php 5.3.2 :(
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
oliverde8
solid chaser
solid chaser
Posts: 1135
Joined: 07 Oct 2006 07:03
Owned TM-games: TMU
Manialink(s): oliverde8
Location: Turkey
Contact:

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

Post by oliverde8 » 13 Dec 2011 18:48

I used it on my old server with php5.3 no problems.

Maybe you changed the charset of the files when saving them?
ImageImage
Manialink : oliverde8color>
Servers : STATS <> United | VeryShort | Made In Turkey

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 » 14 Dec 2011 21:23

oliverde8 wrote:I used it on my old server with php5.3 no problems.

Maybe you changed the charset of the files when saving them?
On top of this, maybe check how your db is encoded - and also, what operating system are you using?

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 » 15 Dec 2011 09:46

OS : Linux CentOS 6.1 x64
Php 5.3.3
Mysql db encodage : latin1_swedish_ci
Im using xstats since a lot of time on several servers (TMNF & TM2) with same configuration,
the only difference is the version of php and only this ranking page with php 5.3.3 isn't correct.

I read about a possibly bug in php-pdo...

To be continued ;)
-- 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 » 15 Dec 2011 10:29

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
BaMcRober
Image
Image

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 » 15 Dec 2011 10:32

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
And you have also the same problem as mine, incorrect nickname are displayed on ranking page
for special caracteres
-- 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 » 15 Dec 2011 10:39

sbone wrote:
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
And you have also the same problem as mine, incorrect nickname are displayed on ranking page
for special caracteres

For your problem I solved by putting this string in config.php

Code: Select all

mysql_query('set names utf8');
BaMcRober
Image
Image

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 » 15 Dec 2011 10:45

McRobert wrote:
sbone wrote:
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
And you have also the same problem as mine, incorrect nickname are displayed on ranking page
for special caracteres

For your problem I solved by putting this string in config.php

Code: Select all

mysql_query('set names utf8');
Thanks, it works ;)
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

Post Reply