query (" SELECT unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName, hlstats_Players.game FROM hlstats_Players WHERE hlstats_Players.playerId = $player "); if ($db->num_rows() != 1) { error("No such player '$player'."); } $playerdata = $db->fetch_array(); $pl_name = $playerdata['lastName']; if (strlen($pl_name) > 10) { $pl_shortname = substr($pl_name, 0, 8) . '...'; } else { $pl_shortname = $pl_name; } $pl_name = htmlspecialchars($pl_name, ENT_COMPAT); $pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT); $game = $playerdata['game']; $db->query (" SELECT hlstats_Games.name FROM hlstats_Games WHERE hlstats_Games.code = '$game' "); if ($db->num_rows() != 1) { $gamename = ucfirst($game); } else { list($gamename) = $db->fetch_row(); } pageHeader ( array ($gamename, 'Chat History', $pl_name), array ( $gamename=>$g_options['scripturl'] . "?game=$game", 'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game", 'Player Details'=>$g_options['scripturl'] . "?mode=playerinfo&player=$player", 'Chat History'=>'' ), $playername ); flush(); $table = new Table ( array ( new TableColumn ( 'eventTime', 'Date', 'width=16' ), new TableColumn ( 'message', 'Message', 'width=44&sort=no&append=.&embedlink=yes' ), new TableColumn ( 'serverName', 'Server', 'width=24' ), new TableColumn ( 'map', 'Map', 'width=16' ) ), 'eventTime', 'eventTime', 'serverName', false, 50, 'page', 'sort', 'sortorder' ); $surl = $g_options['scripturl']; $whereclause="hlstats_Events_Chat.playerId = $player "; $filter=isset($_REQUEST['filter'])?$_REQUEST['filter']:""; if(!empty($filter)) { $whereclause.="AND MATCH (hlstats_Events_Chat.message) AGAINST ('" . $db->escape($filter) . "' in BOOLEAN MODE)"; } $result = $db->query (" SELECT hlstats_Events_Chat.eventTime, IF(hlstats_Events_Chat.message_mode=2, CONCAT('(Team) ', hlstats_Events_Chat.message), IF(hlstats_Events_Chat.message_mode=3, CONCAT('(Squad) ', hlstats_Events_Chat.message), hlstats_Events_Chat.message)) AS message, hlstats_Servers.name AS serverName, hlstats_Events_Chat.map FROM hlstats_Events_Chat LEFT JOIN hlstats_Servers ON hlstats_Events_Chat.serverId = hlstats_Servers.serverId WHERE $whereclause ORDER BY $table->sort $table->sortorder, $table->sort2 $table->sortorder LIMIT $table->startitem, $table->numperpage "); $resultCount = $db->query (" SELECT COUNT(*) FROM hlstats_Events_Chat LEFT JOIN hlstats_Servers ON hlstats_Events_Chat.serverId = hlstats_Servers.serverId WHERE $whereclause "); list($numitems) = $db->fetch_row($resultCount); ?>