PageRenderTime 93ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/index.php

https://github.com/gak/acssr
PHP | 267 lines | 242 code | 18 blank | 7 comment | 23 complexity | dfa5c5964ed7d116b5033749259beaa1 MD5 | raw file
  1. <?
  2. require_once("include.php");
  3. htmlStart();
  4. echo '<table><tr><td class="column">';
  5. require('static/latestword.htm');
  6. if (0) {
  7. homeHeading('Donations');
  8. ?>
  9. <div class="articlebody">
  10. If you enjoy using ACSSR and would like to help support it, please consider making a donation to ACSSR. Your donation will be used for the costs of running, maintaining and upgrading ACSSR.
  11. <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  12. <input type="hidden" name="cmd" value="_s-xclick">
  13. <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
  14. <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHyQYJKoZIhvcNAQcEoIIHujCCB7YCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBZpY1tOqlbJdbkLqy+BiEIXZwj2P4xQBmnAAmSNRwx+SdqjbHjzV19YJVuNSkH0bs2kk8M5GsIghEunvKvawkY3MbEkeXaAp+owq4cILr68arVj1nJzRMMi9tZ3Qsr3Rfz5rOeEvKWCSD72jExQigLSccvucvQ0K1A/7hV6yY5qjELMAkGBSsOAwIaBQAwggFFBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECB76MGoc4wZQgIIBICXJL/DOQ88fAsdJhdnAa3gysuaKFY8FYnjPJwj74j0bf/IUqxy17dFcmdfYeq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  21. ?>
  22. <div class="articlebody" style="text-align: center;">
  23. <script type="text/javascript"><!--
  24. google_ad_client = "pub-9387561163499032";
  25. google_ad_width = 468;
  26. google_ad_height = 15;
  27. google_ad_format = "468x15_0ads_al";
  28. //2006-09-28: acssr - frontpage - text
  29. google_ad_channel ="0045222066";
  30. google_color_border = "0D5257";
  31. google_color_bg = "0D5257";
  32. google_color_link = "FFFFFF";
  33. google_color_text = "99FF66";
  34. google_color_url = "FFF600";
  35. //--></script>
  36. <script type="text/javascript"
  37. src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  38. </script>
  39. </div>
  40. <?
  41. }
  42. if (0) {
  43. //homeHeading('Advertisement');
  44. ?>
  45. <div class="articlebody" style="text-align: center;">
  46. <script type="text/javascript"><!--
  47. google_ad_client = "pub-9387561163499032";
  48. google_ad_width = 336;
  49. google_ad_height = 280;
  50. google_ad_format = "336x280_as";
  51. google_ad_type = "image";
  52. //2006-09-28: acssr - frontpage - square
  53. google_ad_channel ="1572704799";
  54. google_color_border = "006666";
  55. google_color_bg = "158289";
  56. google_color_link = "FFFFFF";
  57. google_color_text = "99FF66";
  58. google_color_url = "FFF600";
  59. //--></script>
  60. <script type="text/javascript"
  61. src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  62. </script>
  63. </div>
  64. <?
  65. }
  66. if (!isset($_SESSION) || !isset($_SESSION["user"])) {
  67. $user = null;
  68. homeHeading("Quick Access");
  69. ?>
  70. <div class="articlebody">
  71. <form method="POST" action="member.php">
  72. <div>Access your member profile below. Being an ACSSR member allows you to easily track your friends, vote for players and have a player profile banner. If you don't have a free ACSSR account, <a href="register.php">register here</a>!<br><br>
  73. <?
  74. if (isset($_GET["badlogin"])) {
  75. echo "<b style=\"color: red\">";
  76. switch($_GET["badlogin"]) {
  77. case 1:
  78. echo "Username not found!";
  79. break;
  80. case 2:
  81. echo "Your account is not activated. Did you check your e-mail?";
  82. break;
  83. case 3:
  84. echo "Your password is wrong";
  85. break;
  86. case 4:
  87. echo "Your session timed out. Try logging in again.";
  88. break;
  89. case 5:
  90. echo "You need to enable cookies to be able to log in.";
  91. break;
  92. default:
  93. }
  94. echo "</b><br><br>";
  95. }
  96. ?>
  97. Username: <input type="text" name="username">
  98. Password: <input type="password" name="password">
  99. <input type="submit" value="go">
  100. </div>
  101. </form>
  102. </div>
  103. <?
  104. } else {
  105. $user = $_SESSION["user"];
  106. $user->refresh();
  107. if (isset($user->playerid)) {
  108. $user->loadplayer();
  109. $s = "or player.id = {$user->player->id}";
  110. } else {
  111. $s = "";
  112. }
  113. if ($user->id > 0) {
  114. $resFriends = $db->query("
  115. $sqlgenselect
  116. ,server.name as servername
  117. ,server.id as serverid
  118. ,server.address as serveraddress
  119. FROM friends
  120. LEFT JOIN player ON friends.playerid = player.id
  121. LEFT JOIN server ON server.id = player.curserverid
  122. WHERE friends.userid = {$user->id}
  123. ORDER BY score DESC");
  124. } else {
  125. Header("Location: logout.php");
  126. }
  127. homeHeading("ACSSR Member Area - {$user->name}");
  128. echo "<div class=\"articlebody\">";
  129. if (!isset($user->playerid)) {
  130. echo "I don't know who you are in the rankings. <a href=\"memberfind.php\">Find Yourself Here</a>.<br><br>";
  131. } else {
  132. echo "Hello " . $user->player->ename . ". How are you today?<br><small>If the above isn't right, <a href=\"memberfind.php\">change it</a>!</small><br><br>";
  133. echo "You are currently ranked <b>" . $user->player->rank . "</b> with a score of <b>" . $user->player->score . "</b>. ";
  134. echo "You have <b>{$user->player->ppm}</b> points per minute, and have played for a total of <b>".humanTime($user->player->totaltime,true)."</b>. ";
  135. echo "You last played <b>".humanTime(time() - $user->player->lastserverwhen ,true)."</b> ago.<br>";
  136. echo "<small>For more details, check <a href=\"playerdetails.php?id={$user->playerid}\">your player details page</a>.</small><br><br>";
  137. }
  138. echo "You have <b>" . $db->count($resFriends) . "</b> friend(s).";
  139. echo ' Activate your <a href="" onclick="window.open(\'friendtracker.php\', \'friends\', \'width=480,height=300,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no\'); return false;"> friend tracker</a>, or use <a href="http://abb.slowchop.com/">Banana Bunch</a> to track friends on your Windows desktop.';
  140. echo "<br><small>Feeling lonely? Add a friend by clicking the <img src=\"img/add.png\" alt=\"\"> icon next to their name!</small><br><br>";
  141. if (isset($user->player)) {
  142. $vote = $db->query("select * from playervote where userid = {$user->id} group by playerid");
  143. $votedbyuser = $db->count();
  144. $vote = $db->query("select * from playervote where playerid = {$user->player->id} group by userid");
  145. $votedfromothers = $db->count();
  146. $votealign = $db->quickquery("select sum(playervotecategory.alignment * playervote.alignment) as a from playervote, playervotecategory where playervotecategory.id = playervote.playervotecategoryid and playerid = {$user->player->id}");
  147. $votealign->a += 0;
  148. if ($votealign->a > 0) $va = '<span style="color: #0F0">+'.$votealign->a.'</span>'; elseif ($votealign->a < 0) $va = '<span style="color: #F00">'.$votealign->a.'</span>'; else $va = $votealign->a;
  149. if ($votedfromothers != 1) $mem = "s that have"; else $mem = " that has";
  150. echo "There are <b>{$votedfromothers}</b> member$mem voted for your alignment to be <b>$va</b>. ";
  151. Echo "You have voted for <b>{$votedbyuser}</b> player(s).";
  152. echo "<br><br>";
  153. }
  154. echo "Configure your <a href=\"memberadvancedprofile.php\">player profile banner</a> to put in your forum signatures and web site.<br><br>";
  155. $datTag = $db->quickquery("select clantag, clanpos from user where id = {$user->id}");
  156. ?>
  157. If you are in a clan, specify your clan tag here to be listed in the clans section.<br>
  158. <form action="setclan.php" method="post">
  159. Clan tag: <input size="20" type="text" name="clantag" value="<?=$datTag->clantag?>">
  160. Tag alignment: <select name="clanpos">
  161. <option value="0"<?if ($datTag->clanpos==0)echo " SELECTED";?>>Left
  162. <option value="1"<?if ($datTag->clanpos==1)echo " SELECTED";?>>Right
  163. </select>
  164. <input type="submit" value="update">
  165. </form><small>Set to nothing if you want to remove the tag. Clan tags must be between 2 and 20 characters long and have a character that isn't a letter.</small><br><br>
  166. <?
  167. echo "Feel free to <a href=\"logout.php\">log out</a>. ACSSR should remember you for a week otherwise.";
  168. echo "</div>";
  169. }
  170. if (!$user) {
  171. homeHeading("About ACSSR");
  172. echo "<div class=\"articlebody\">";
  173. ?>
  174. ACSSR stands for <b>Australian Counter-Strike:Source Rankings</b>. It tracks <a href="servers.php">Australian servers</a> and collects statistics for players. Feel free to <a href="search.php">search for your player name</a> and check out your stats. I'm usually trolling around the <a href="forum/">forums</a> and answering any questions you may have.
  175. </div>
  176. <?
  177. }
  178. require('static/qs.htm');
  179. #require('static/olderwords.htm');
  180. echo "<td class=\"column\">";
  181. if (isset($user)) {
  182. if ($db->count($resFriends) == 0) {
  183. // echo "You currently have no friends :(<br><br>";
  184. } else {
  185. homeHeading("Friends");
  186. dumpTable($resFriends, array("servercut"=>true, "small"=>true, "frienddelete"=>true));
  187. }
  188. }
  189. if ($user) {
  190. require('static/top10user.htm');
  191. require('static/top10onlineuser.htm');
  192. require('static/clans_front.htm');
  193. } else {
  194. require('static/top10.htm');
  195. require('static/top10online.htm');
  196. require('static/clans_front.htm');
  197. }
  198. echo "</table>";
  199. htmlStop();
  200. ?>