"|", "["=>"{", "]"=>"}", "~"=>"^"); $usernameCanonical = strtr($username, $ircLowerSymbols); $usernameCanonical = strtolower($usernameCanonical); } else { $username = ''; $usernameCanonical = ''; } if ($db && $username != '') { $q = $db->prepare('select tl.username as usrname, sum(tl2.t * (tl2.n / (select sum(num_answered) from triviauserlog where username_canonical=:username))) as count, sum(tl2.p * (tl2.n / (select sum(num_answered) from triviauserlog where username_canonical=:username))) as score, (select sum(points_made) from triviauserlog t3 where username_canonical=:username) as points, (select sum(num_answered) from triviauserlog t4 where username_canonical=:username) as q_asked, (select num_editted from triviausers where username_canonical=:username) as num_e, (select num_editted_accepted from triviausers where username_canonical=:username) as num_e_accepted, (select num_questions_added from triviausers where username_canonical=:username) as num_q, (select num_questions_accepted from triviausers where username_canonical=:username) as num_q_accepted, (select num_reported from triviausers where username_canonical=:username) as num_r from (select tl3.id as id2, tl3.average_time * 1.0 as t, tl3.average_score * 1.0 as p, tl3.num_answered * 1.0 as n from triviauserlog tl3) tl2 inner join triviauserlog tl on tl.username_canonical=:username and tl.id=tl2.id2'); $q->execute(array(':username'=>$usernameCanonical)); if ($q === false) { die("Error: database error: table does not exist\n"); } else { $result = $q->fetchAll(); if(sizeOf($result) > 0) { $result = $result[0]; } if(is_null($result['usrname'])) { $result['usrname'] = "Not found"; $result['count'] = 0; $result['score'] = 0; $result['points'] = 0; $result['q_asked'] = 0; $result['num_e'] = 0; $result['num_e_accepted'] = 0; $result['num_q'] = 0; $result['num_q_accepted'] = 0; $result['num_r'] = 0; } } } else { if(isset($err)) { die($err); } } ?> Players · TriviaTime

TriviaTime

Profile and user summary.

Averages

'; echo ''; echo ''; echo ''; } } ?>
Average Time/Question* Average Points/Question*
' . number_format($result['count'],2) . '' . number_format($result['score'],2) . '

Totals

'; echo ''; echo ''; echo ''; } } ?>
Total Points Number Answered*
' . number_format($result['points'],0) . '' . number_format($result['q_asked'],0) . '

Contributions

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } ?>
Number Edited Edits Accepted Questions Added Questions Accepted Reports Made
' . number_format($result['num_e'],0) . '' . number_format($result['num_e_accepted'],0) . '' . number_format($result['num_q'],0) . '' . number_format($result['num_q_accepted'],0) . '' . number_format($result['num_r'],0) . '

* These stats do not include KAOS