Advertisement
Guest User

Untitled

a guest
May 30th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. <!--
  2. Jordan Thomson/John Shiels 2010
  3. project members:ben thomson,michael lee,jordan thomson,john shiels
  4. collage project: mafia game
  5.  
  6. any edits please leave comment here stating your name and edit done.
  7.  
  8. also if anyone picks up a error, post the error code + line error is on
  9. thanks
  10. -->
  11.  
  12. <!--
  13. first edit jordan
  14. added banned feature
  15. added bullets function
  16. added layout choice
  17. added ip check function for dupes?
  18. -->
  19.  
  20. <!--
  21. second edit jordan
  22. added some structure to the site
  23. added online checking
  24. added messaging function still to be hard coded yet
  25. -->
  26.  
  27. <!--
  28. third edit jordan
  29. added layout function choice
  30. -->
  31.  
  32. <!--
  33. Fourth edit John
  34. Proof-checking
  35. Code fixes
  36. Misspellings
  37. Reworked some tags, else statements
  38. Fixed layout
  39. -->
  40.  
  41. <?
  42. include_once "includes/db_connect.php";
  43. $online= time();
  44. $current=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE online > '$online'"),0,0);
  45. $total=mysql_result(mysql_query("SELECT count(*) FROM users"),0,0);
  46. $most=mysql_fetch_row(mysql_query("SELECT online FROM site_stats WHERE id='1'"));
  47.  
  48. $dead=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE status='Dead'"),0,0);
  49. $alive=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE status='Alive'"),0,0);
  50. $messages=mysql_result(mysql_query("SELECT COUNT(*) FROM inbox"),0,0);
  51.  
  52. $moneys = mysql_query("SELECT money, bank FROM users WHERE userlevel='0' AND status='Alive'");
  53. $money = 0;
  54. while($row=mysql_fetch_array($moneys)){
  55. $money+=round($row[0]+$row[1]);
  56. }
  57.  
  58. $totbuls = mysql_query("SELECT bullets FROM users WHERE userlevel='0' AND status='Alive'");
  59. $bultot = 0;
  60. while($tot=mysql_fetch_row($totbuls)){
  61. $bullets+=round($tot[0]);
  62. }
  63.  
  64. if (strip_tags($_GET['logout']) == "true"){
  65. mysql_query("UPDATE users SET online='0' WHERE username='$username'");
  66. session_destroy();
  67. echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
  68. }elseif (isset($_SESSION['username'])){
  69. if ($fetch->style == "4"){
  70. include "../choose.php";
  71. }elseif ($fetch->style == "1"){
  72. include "../choose.php";
  73. }
  74. exit();
  75. }
  76.  
  77. $timenow=time();
  78.  
  79. if ($_POST['enter'] && strip_tags($_POST['user']) && strip_tags($_POST['pass'])){
  80. $username = addslashes(strip_tags($_POST['user']));
  81. $password = addslashes(strip_tags($_POST['pass']));
  82.  
  83. $ip = $REMOTE_ADDR;
  84. $date = gmdate('y-m-d h:i:s');
  85.  
  86. $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1' LIMIT 1");
  87.  
  88. $login_check = mysql_num_rows($sql);
  89. $inf = mysql_fetch_object($sql);
  90. if ($login_check == "0"){
  91. $message="Incorrect username or password.";
  92. }elseif ($login_check != "0"){
  93.  
  94. if ($inf->status == "Dead"){
  95. include_once"dead.php";
  96. exit();
  97. }
  98.  
  99. $checkkk=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE online > '$timenow' AND l_ip='$ip'"),0,0);
  100. if ($checkkk > "2"){
  101. }
  102.  
  103.  
  104.  
  105. if ($inf->status == "Banned"){
  106. $encoded=md5(strtolower($username));
  107. $message= "Your Banned: <a href='banned.php?banned=$username&encoded=$encoded'>Click Here For Info</a>";
  108. }elseif ($inf->status != "Banned"){
  109.  
  110. session_register('username');
  111. $_SESSION['username'] = $inf->username;
  112. $timestamp = time()+60;
  113. mysql_query("UPDATE users SET online='$timestamp' WHERE username='$username'");
  114. mysql_query("UPDATE users SET l_ip='$ip' WHERE username='$username'");
  115. mysql_query("INSERT INTO `ip_logs` ( `id` , `username` , `ip`, `date`)
  116. VALUES ('', '$username', '$ip', '$date');") or die (mysql_error());
  117. if ($inf->style == "4"){
  118. header ("Location: choose.php");
  119. }elseif ($inf->style == "1"){
  120. header ("Location: choose.php");
  121. }}else{
  122. $message= "Unable to Login.<br />";
  123. }}}}
  124. ?>
  125.  
  126. <html>
  127. <head>
  128. <title>Scottish Mafia</title>
  129. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  130. <link href="css/styles.css" rel="stylesheet" type="text/css">
  131. </head>
  132.  
  133. <form action="" method="POST">
  134.  
  135. <center>
  136. <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="preloadImages();">
  137.  
  138. <table id="Table_01" width="775" height="681" border="0" cellpadding="0" cellspacing="0">
  139.  
  140. <tr>
  141. <td rowspan="9">&nbsp;</td>
  142. <td><a href="index.php"><center><font color="#000000"><br>Home</font></center></a></td>
  143. <td colspan="2"><a href="register.php"><center><font color="#000000"><br>Register</font></center></a></td>
  144. <td colspan="3"><a href="lostpass.php"><center><font color="#000000"><br>Lost Password</font></center></a></td>
  145. <td colspan="3"><a href="contact.php"><center><font color="#000000"><br>Contact Us</font></center></a></td></td>
  146. <td colspan="2"><a href="index.php"><center><font color="#000000"><br>Help Forum</font></center></td>
  147. <td colspan="3"><a href="index.php"><center><font color="#000000"><br></font>another function here?</center></a></td>
  148. <td rowspan="9">&nbsp;</td>
  149. </tr>
  150.  
  151. <tr>
  152. <td colspan="14">&nbsp;</td>
  153. </tr>
  154.  
  155. <tr>
  156. <td colspan="2" rowspan="2">&nbsp;</td>
  157. <td colspan="5">&nbsp;</td>
  158. <td rowspan="2">&nbsp;</td>
  159. <td colspan="4">&nbsp;</td>
  160. <td colspan="2" rowspan="2">&nbsp;</td>
  161. </tr>
  162.  
  163. <tr>
  164. <td colspan="5" align="left" valign="top"><? if ($_POST){ ?>
  165. <br><?php echo "<b>$message</b>"; ?> <? } ?><br><p><span class="text1">Type in your Username and Password to login.</span><br>
  166. <br>
  167. Username: <input type="text" value='Username..' onFocus="if(this.value=='Username..')this.value=''" onBlur=" if(this.value=='')this.value='Username..'" name="user" id="user"><br>
  168. Password: <input type="password" value='Password' onFocus="if(this.value=='Password')this.value=''" onBlur=" if(this.value=='')this.value='Password'" name="pass" id="pass"> <input type="submit" value="Enter.." name="enter" id="enter" class="input"></p></td>
  169. <td colspan="4" align="left" valign="top" width="181" height="111"><p><span class="text2">00.00.2010</span><br>
  170. *updates here need function coded will do later!* </td>
  171. </tr>
  172. </form>
  173. <tr>
  174. <td colspan="14">&nbsp;</td>
  175. </tr>
  176.  
  177. <tr>
  178. <td colspan="2" rowspan="2">&nbsp;</td>
  179. <td colspan="3" align="left" valign="top"><p>Latest Members</p></td>
  180. <td colspan="5" rowspan="2" align="left" valign="top">&nbsp;</td>
  181. <td colspan="3" align="left" valign="top">&nbsp;</td>
  182. <td rowspan="2">&nbsp;</td>
  183. </tr>
  184.  
  185. <tr>
  186. <td colspan="3" align="left" valign="top"><p>
  187. <?
  188. $c=mysql_query("SELECT * FROM users ORDER BY id DESC LIMIT 5");
  189. while($d=mysql_fetch_object($c)){
  190. echo "$d->username <br> <span class='text1'>$d->regged</span><br>
  191. "; } ?></p></td>
  192. <td colspan="3" align="left" valign="top" width="176" height="147"></td>
  193. </tr>
  194.  
  195. <tr>
  196. <td colspan="14">&nbsp;</td>
  197. </tr>
  198.  
  199. <tr>
  200. <td colspan="4" align="center" valign="middle" bgcolor="#FFFFFF" class="text3" width="237" height="67">Copyright &copy;project name???? <br>
  201. </td>
  202. <td colspan="10" align="center" valign="middle" bgcolor="#FFFFFF" class="text3" width="410" height="67"><a href="index.php">Home</a> | <a href="register.php">Register</a> | <a href="lostpass.php">Lost Password</a> | <a href="contact.php">Contact Us</a> | <a href="index.php">Help Forum</a></td>
  203. </tr>
  204.  
  205. <tr>
  206. <td><img src="images2/spacer.gif" width="64" height="1" alt=""></td>
  207. <td><img src="images2/spacer.gif" width="97" height="1" alt=""></td>
  208. <td><img src="images2/spacer.gif" width="52" height="1" alt=""></td>
  209. <td><img src="images2/spacer.gif" width="57" height="1" alt=""></td>
  210. <td><img src="images2/spacer.gif" width="31" height="1" alt=""></td>
  211. <td><img src="images2/spacer.gif" width="65" height="1" alt=""></td>
  212. <td><img src="images2/spacer.gif" width="9" height="1" alt=""></td>
  213. <td><img src="images2/spacer.gif" width="76" height="1" alt=""></td>
  214. <td><img src="images2/spacer.gif" width="34" height="1" alt=""></td>
  215. <td><img src="images2/spacer.gif" width="2" height="1" alt=""></td>
  216. <td><img src="images2/spacer.gif" width="39" height="1" alt=""></td>
  217. <td><img src="images2/spacer.gif" width="72" height="1" alt=""></td>
  218. <td><img src="images2/spacer.gif" width="68" height="1" alt=""></td>
  219. <td><img src="images2/spacer.gif" width="36" height="1" alt=""></td>
  220. <td><img src="images2/spacer.gif" width="9" height="1" alt=""></td>
  221. <td><img src="images2/spacer.gif" width="64" height="1" alt=""></td>
  222. </tr>
  223.  
  224. </table>
  225. </body>
  226. </center>
  227. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement