Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Jordan Thomson/John Shiels 2010
- project members:ben thomson,michael lee,jordan thomson,john shiels
- collage project: mafia game
- any edits please leave comment here stating your name and edit done.
- also if anyone picks up a error, post the error code + line error is on
- thanks
- -->
- <!--
- first edit jordan
- added banned feature
- added bullets function
- added layout choice
- added ip check function for dupes?
- -->
- <!--
- second edit jordan
- added some structure to the site
- added online checking
- added messaging function still to be hard coded yet
- -->
- <!--
- third edit jordan
- added layout function choice
- -->
- <!--
- Fourth edit John
- Proof-checking
- Code fixes
- Misspellings
- Reworked some tags, else statements
- Fixed layout
- -->
- <?
- include_once "includes/db_connect.php";
- $online= time();
- $current=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE online > '$online'"),0,0);
- $total=mysql_result(mysql_query("SELECT count(*) FROM users"),0,0);
- $most=mysql_fetch_row(mysql_query("SELECT online FROM site_stats WHERE id='1'"));
- $dead=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE status='Dead'"),0,0);
- $alive=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE status='Alive'"),0,0);
- $messages=mysql_result(mysql_query("SELECT COUNT(*) FROM inbox"),0,0);
- $moneys = mysql_query("SELECT money, bank FROM users WHERE userlevel='0' AND status='Alive'");
- $money = 0;
- while($row=mysql_fetch_array($moneys)){
- $money+=round($row[0]+$row[1]);
- }
- $totbuls = mysql_query("SELECT bullets FROM users WHERE userlevel='0' AND status='Alive'");
- $bultot = 0;
- while($tot=mysql_fetch_row($totbuls)){
- $bullets+=round($tot[0]);
- }
- if (strip_tags($_GET['logout']) == "true"){
- mysql_query("UPDATE users SET online='0' WHERE username='$username'");
- session_destroy();
- echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
- }elseif (isset($_SESSION['username'])){
- if ($fetch->style == "4"){
- include "../choose.php";
- }elseif ($fetch->style == "1"){
- include "../choose.php";
- }
- exit();
- }
- $timenow=time();
- if ($_POST['enter'] && strip_tags($_POST['user']) && strip_tags($_POST['pass'])){
- $username = addslashes(strip_tags($_POST['user']));
- $password = addslashes(strip_tags($_POST['pass']));
- $ip = $REMOTE_ADDR;
- $date = gmdate('y-m-d h:i:s');
- $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1' LIMIT 1");
- $login_check = mysql_num_rows($sql);
- $inf = mysql_fetch_object($sql);
- if ($login_check == "0"){
- $message="Incorrect username or password.";
- }elseif ($login_check != "0"){
- if ($inf->status == "Dead"){
- include_once"dead.php";
- exit();
- }
- $checkkk=mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE online > '$timenow' AND l_ip='$ip'"),0,0);
- if ($checkkk > "2"){
- }
- if ($inf->status == "Banned"){
- $encoded=md5(strtolower($username));
- $message= "Your Banned: <a href='banned.php?banned=$username&encoded=$encoded'>Click Here For Info</a>";
- }elseif ($inf->status != "Banned"){
- session_register('username');
- $_SESSION['username'] = $inf->username;
- $timestamp = time()+60;
- mysql_query("UPDATE users SET online='$timestamp' WHERE username='$username'");
- mysql_query("UPDATE users SET l_ip='$ip' WHERE username='$username'");
- mysql_query("INSERT INTO `ip_logs` ( `id` , `username` , `ip`, `date`)
- VALUES ('', '$username', '$ip', '$date');") or die (mysql_error());
- if ($inf->style == "4"){
- header ("Location: choose.php");
- }elseif ($inf->style == "1"){
- header ("Location: choose.php");
- }}else{
- $message= "Unable to Login.<br />";
- }}}}
- ?>
- <html>
- <head>
- <title>Scottish Mafia</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link href="css/styles.css" rel="stylesheet" type="text/css">
- </head>
- <form action="" method="POST">
- <center>
- <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="preloadImages();">
- <table id="Table_01" width="775" height="681" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td rowspan="9"> </td>
- <td><a href="index.php"><center><font color="#000000"><br>Home</font></center></a></td>
- <td colspan="2"><a href="register.php"><center><font color="#000000"><br>Register</font></center></a></td>
- <td colspan="3"><a href="lostpass.php"><center><font color="#000000"><br>Lost Password</font></center></a></td>
- <td colspan="3"><a href="contact.php"><center><font color="#000000"><br>Contact Us</font></center></a></td></td>
- <td colspan="2"><a href="index.php"><center><font color="#000000"><br>Help Forum</font></center></td>
- <td colspan="3"><a href="index.php"><center><font color="#000000"><br></font>another function here?</center></a></td>
- <td rowspan="9"> </td>
- </tr>
- <tr>
- <td colspan="14"> </td>
- </tr>
- <tr>
- <td colspan="2" rowspan="2"> </td>
- <td colspan="5"> </td>
- <td rowspan="2"> </td>
- <td colspan="4"> </td>
- <td colspan="2" rowspan="2"> </td>
- </tr>
- <tr>
- <td colspan="5" align="left" valign="top"><? if ($_POST){ ?>
- <br><?php echo "<b>$message</b>"; ?> <? } ?><br><p><span class="text1">Type in your Username and Password to login.</span><br>
- <br>
- 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>
- 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>
- <td colspan="4" align="left" valign="top" width="181" height="111"><p><span class="text2">00.00.2010</span><br>
- *updates here need function coded will do later!* </td>
- </tr>
- </form>
- <tr>
- <td colspan="14"> </td>
- </tr>
- <tr>
- <td colspan="2" rowspan="2"> </td>
- <td colspan="3" align="left" valign="top"><p>Latest Members</p></td>
- <td colspan="5" rowspan="2" align="left" valign="top"> </td>
- <td colspan="3" align="left" valign="top"> </td>
- <td rowspan="2"> </td>
- </tr>
- <tr>
- <td colspan="3" align="left" valign="top"><p>
- <?
- $c=mysql_query("SELECT * FROM users ORDER BY id DESC LIMIT 5");
- while($d=mysql_fetch_object($c)){
- echo "$d->username <br> <span class='text1'>$d->regged</span><br>
- "; } ?></p></td>
- <td colspan="3" align="left" valign="top" width="176" height="147"></td>
- </tr>
- <tr>
- <td colspan="14"> </td>
- </tr>
- <tr>
- <td colspan="4" align="center" valign="middle" bgcolor="#FFFFFF" class="text3" width="237" height="67">Copyright ©project name???? <br>
- </td>
- <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>
- </tr>
- <tr>
- <td><img src="images2/spacer.gif" width="64" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="97" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="52" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="57" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="31" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="65" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="9" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="76" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="34" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="2" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="39" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="72" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="68" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="36" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="9" height="1" alt=""></td>
- <td><img src="images2/spacer.gif" width="64" height="1" alt=""></td>
- </tr>
- </table>
- </body>
- </center>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement