require("include/top.php");
$who = $_GET["who"];
$usercustom=$user;
//var_dump($usercustom);
if(!is_numeric($who)) {
$result = mysql_query_debug("SELECT id FROM users");
while($tmp = mysql_fetch_row($result)) {
$ids[]=$tmp[0];
}
$who=$ids[mt_rand(0,count($ids)-1)];
}
function htmlcleanonerow($inhtml){
$inhtml= str_replace( "<", "&" . "lt;", $inhtml);
$inhtml= str_replace( ">", "&" . "gt;", $inhtml);
$inhtml= str_replace( "\"", "&" . "quot;", $inhtml);
$inhtml= str_replace( "\n", " ", $inhtml);
return $inhtml;
}
$timetest = microtime_float();
$result = mysql_query_debug("SELECT * FROM users WHERE id=".$who);
$user = mysql_fetch_array($result);
$sceneIDData = array();
if (!$user["sceneIDData"] || (time() - strtotime($user["sceneIDLastRefresh"])) > 60 * 60 * 12)
{
$returnvalue = $xml->parseSceneIdData("getUserInfo", array("userID" => $who));
if(is_array($returnvalue["user"])&&is_array($user)) {
$r = $returnvalue["user"];
$sceneIDData = $r;
}
mysql_query("update users set sceneIDLastRefresh = now(), sceneIDData='".mysql_real_escape_string(serialize($returnvalue["user"]))."' where id=".$who);
} else {
$sceneIDData = unserialize( $user["sceneIDData"] );
}
unset( $sceneIDData["nickname"] );
$user = array_merge($user, $sceneIDData);
debuglog(var_export($returnvalue,true));
$time["getuserdata"] = microtime_float() - $timetest;
$timetest = microtime_float();
// total thumb ups / down
$result=mysql_query_debug("SELECT rating, SUM(rating) AS total FROM comments WHERE who=".$user["id"]." GROUP BY rating");
while($tmp=mysql_fetch_array($result)) {
if($tmp["rating"]==1) $total_ups=$tmp["total"];
else if($tmp["rating"]==-1) $total_downs=-1*$tmp["total"];
}
// glops count
$result=mysql_query_debug("SELECT count(0) FROM prods WHERE added=".$user["id"]);
$nbprods = mysql_result($result,0);
$result=mysql_query_debug("SELECT count(0) FROM groups WHERE added=".$user["id"]);
$nbgroups = mysql_result($result,0);
$result=mysql_query_debug("SELECT count(0) FROM parties WHERE added=".$user["id"]);
$nbparties = mysql_result($result,0);
$result=mysql_query_debug("SELECT count(0) FROM screenshots WHERE user=".$user["id"]);
$nbscreenshots = mysql_result($result,0);
$result=mysql_query_debug("SELECT count(0) FROM nfos WHERE user=".$user["id"]);
$nbnfos = mysql_result($result,0);
$result=mysql_query_debug("SELECT COUNT(DISTINCT which) FROM comments WHERE who=".$user["id"]);
$nbcomments = mysql_result($result,0);
// average rating
$query="SELECT SUM(rating)/count(0) FROM comments WHERE who=".$user["id"];
$result=mysql_query_debug($query);
$avg_rating=mysql_result($result,0);
$time["averages"] = microtime_float() - $timetest;
//$glops=4*count($prods)+3*count($groups)+2*count($partys)+count($comments)+$ud;
// Count only the logos of this user which have been voted in by the pouet users
$result=mysql_query_debug("SELECT count(0) FROM logos WHERE author1=".$user["id"]." || author2=".$user["id"]);
$nblogos = mysql_result($result,0);
$result=mysql_query_debug("SELECT count(0) FROM logos WHERE vote_count>0 and (author1=".$user["id"]." || author2=".$user["id"].")");
$nb_good_logos = mysql_result($result,0);
/*
$nb_good_logos = 0;
if ($logos) foreach($logos as $l)
{
if($l['vote_count'] > 0)
{
$nb_good_logos++;
}
}
*/
$glops=20*$nb_good_logos+2*$nbprods+$nbgroups+$nbparties+$nbscreenshots+$nbnfos+$ud+$nbcomments;
$timetest = microtime_float();
if($user["id"]==$_SESSION["SCENEID_ID"])
{
mysql_query_debug("UPDATE users SET glops=".$glops." WHERE id=".$user["id"]);
}
$time["update"] = microtime_float() - $timetest;
debuglog(var_export($time,true));
?>
if ($user["level"]): ?>
" width="16" height="16">
|
|
if(strlen(trim($user["nickname"]))): ?>
print($user["nickname"]); ?> information
else: ?>
print($user["login"]); ?> information
endif; ?>
|
print($glops); ?> glöps
|
|
level:
|
print($user["level"]); ?>
|
if(strlen($user["nickname"])): ?>
nickname:
|
print($user["nickname"]); ?>
|
endif; ?>
if(strlen($user["firstname"])): ?>
firstname:
|
print($user["firstname"]); ?>
|
endif; ?>
if(strlen($user["lastname"])): ?>
lastname:
|
print($user["lastname"]); ?>
|
endif; ?>
if(strlen($user["country"])): ?>
country:
|
print($user["country"]); ?>
|
endif; ?>
if(strlen($user["email"])): ?>
email:
|
if(isset($_SESSION['SESSION'])&&strcasecmp($xml->hidden, "yes")): ?>
"> print($user["email"]); ?>
else: ?>
hidden
endif; ?>
|
endif; ?>
if((strlen($user["url"])>0)&&($user["url"]!="http://")): ?>
website:
|
"> print($user["url"]); ?>
|
endif; ?>
if($user["im_id"] && $user["im_type"]): ?>
=$user["im_type"]?>:
|
print($user["im_id"]." "); ?>
|
endif; ?>
if($user["ojuice"]): ?>
ojuice:
|
print("profile "); ?>
|
endif; ?>
if($user["slengpung"]): ?>
slengpung:
|
" target=_blank>pictures
|
endif; ?>
if ($user["csdb"]): ?>
csdb:
|
" target=_blank>profile
|
endif; ?>
if ($user["zxdemo"]): ?>
zxdemo:
|
" target=_blank>profile
|
endif; ?>
for($i=0;$i
coup de coeur:
|
".stripslashes($cdc[$i]["name"])); ?>
if ($cdc[$i]["groupname1"]) print(" by ".stripslashes($cdc[$i]["groupname1"])."");
if ($cdc[$i]["groupname2"]) print(" and ".stripslashes($cdc[$i]["groupname2"])."");
if ($cdc[$i]["groupname3"]) print(" and ".stripslashes($cdc[$i]["groupname3"])."");
?>
|
endfor; ?>
average rating:
|
if($avg_rating>0)
$thumbgfx="gfx/rulez.gif";
elseif($avg_rating==0)
$thumbgfx="gfx/isok.gif";
else
$thumbgfx="gfx/sucks.gif";
?>
=$avg_rating?>
|
[demoblog view]
|
|
" width="160" height="160">
|
if($_GET["show"]) {
switch($_GET["show"]) {
case "prods": {
?>
latest added prods print($nbprods." x 2 = ".($nbprods*2)) ?> glöps
|
$query="SELECT prods.id,prods.name,prods.type,prods.group1,prods.group2,prods.group3,".
"g1.name as groupname1,g1.acronym as groupacron1,".
"g2.name as groupname2,g2.acronym as groupacron2,".
"g3.name as groupname3,g3.acronym as groupacron3 ".
" FROM users_cdcs, prods ".
" LEFT JOIN groups AS g1 ON prods.group1 = g1.id".
" LEFT JOIN groups AS g2 ON prods.group2 = g2.id".
" LEFT JOIN groups AS g3 ON prods.group3 = g3.id".
" WHERE users_cdcs.cdc=prods.id and users_cdcs.user=".$who;
$result=mysql_query_debug($query);
while($prods = mysql_fetch_assoc($result)) {
?>
|
}
}
}
} else {
?>
if($nblogos): ?>
added =$nblogos?> logos print($nb_good_logos." x 20 = ".($nb_good_logos*20)) ?> glöps
|
endif; ?>
if($nbprods>0): ?>
latest added prods print($nbprods." x 2 = ".($nbprods*2)) ?> glöps
[&show=prods">show]
|
endif; ?>
if($nbgroups>0): ?>
latest added groups print($nbgroups); ?> glöps
|
endif; ?>
if($nbscreenshots>0): ?>
latest added screenshots print($nbscreenshots); ?> glöps
|
endif; ?>
if($nbnfos>0): ?>
latest added nfos print($nbnfos); ?> glöps
|
endif; ?>
if($nbcomments>0): ?>
latest 1st comments print($nbcomments); ?> glöps
|
endif; ?>
if ($total_ups): ?>
top thumb up agreers (total =$total_ups?>)
|
endif; ?>
if ($total_downs): ?>
top thumb down agreers (total =$total_downs?>)
|
endif; ?>
}
?>
account created on the print($user["quand"]); ?>
|
|
else: ?>
print("aiiiiiiiiii cookiiieee\n la cuenta de este utilizador ha sido comida de una langosta ciega guapa
*clicki clicki clacki* (\/) - - (\/) *clacki clacki clicki*
ciega ciega ciega frikki!!"); ?>
endif; ?>
$user["bottombar"]=$usercustom["bottombar"];
require("include/bottom.php"); ?>