if ($totalgames <= 0) { $totalpercentage = 0.000; } else { $totalpercentage = $totalwins / $totalgames; } $streakwins = $row["streakwins"]; $streaklosses = $row["streaklosses"]; if ($streakwins >= 1) { $streak = "+$streakwins"; } else if ($streaklosses >= 1) { $streak = "-$streaklosses"; } else { $streak = 0; } $versions = $row['versions']; $positionPlayer = getPlayerPosition($name, $version); $favteam1 = $row['favteam1']; $favteam2 = $row['favteam2']; $statusLinks[] = array('/cards.php?id='.$player_id, 'show_warnings_bans', 'show warnings and bans'); ?> <?php echo getOuterBoxTop($subNavText . getRaquo() . getSubNavigation($subpage, $name), ""); ?> <table class="layouttable"> <tr><td width="50%" valign="top"> <?php echo getBoxTop("Player Profile", "", false, $statusLinks);
if ($cookieSessionId != null && $cookieSessionId != "") { $sql = "SELECT * FROM {$playerstable} WHERE pwd='{$cookieSessionId}'"; $result = mysql_query($sql); if ($row = mysql_fetch_array($result)) { $cookie_name = $row['name']; } } } $loggedIn = $cookie_name != ""; if ($maintenance == 'yes') { die($leaguename . " down for update. We're back in a bit."); } if ($loggedIn) { $defaultversion = $row['defaultversion']; $ladder = getLadderForVersion($defaultversion); $positionPlayer = getPlayerPosition($cookie_name, $defaultversion); $wins = $row[getWinsFieldForVersion($defaultversion)]; $losses = $row[getLossesFieldForVersion($defaultversion)]; $points = $row[getPointsFieldForVersion($defaultversion)]; $draws = $row['draws']; $invalidEmail = $row['invalidEmail'] == 1; $mail = $row['mail']; $rejected = $row['rejected']; $rejectReason = $row['rejectReason']; $signup = $row['signup']; $signupSent = $row['signupSent']; $hash6 = $row['hash6']; $s_win = ""; $s_loss = ""; $s_draw = ""; if ($wins != 1) {
$sql = "SELECT * from {$playerstable} where name = '{$name}'"; //echo $sql; $result = mysql_query($sql); $row = mysql_fetch_array($result); $version = $row["defaultversion"]; //echo $version; $wins = $row[getWinsFieldForVersion($version)]; $losses = $row[getLossesFieldForVersion($version)]; $draws = $row['draws']; $points = $row[getPointsFieldForVersion($version)]; $imageurl = "/var/www/yoursite/http/gfx/sig_template.png"; $font_line1 = 3; $font_line1_right = 1; $font_line2 = 2; $offset_left = 13; $offset_left_line1_right = 340; $offset_line1_right = 10; $offset_line1 = 8; $offset_line2 = 26; $string_line1 = $leaguename . ".com statistics for " . $name; $string_line1_right = "season " . $season; $string_line2 = "rank: " . getPlayerPosition($name, $version) . " points: " . $points . " Wins: " . $wins . " Draws: " . $draws . " Defeats: " . $losses; $name = mysql_real_escape_string($_GET['name']); $im = imagecreatefrompng($imageurl); $fontcolor_normal = imagecolorallocate($im, 0, 0, 0); // $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, $font_line1, $offset_left, $offset_line1, $string_line1, $fontcolor_normal); imagestring($im, $font_line1_right, $offset_left_line1_right, $offset_line1_right, $string_line1_right, $fontcolor_normal); imagestring($im, $font_line2, $offset_left, $offset_line2, $string_line2, $fontcolor_normal); imagepng($im); imagedestroy($im);