Jump to content
MakeWebGames

peterisgb

Members
  • Posts

    818
  • Joined

  • Last visited

  • Days Won

    65

Everything posted by peterisgb

  1. Erm.... Get a copy of a default mccodes v2. go to register.php and go to line 288. default line of code
  2. Hi, For some reason my register.php isnt working right. It doesnt seem to post ID information into pdetails and userstats. Here is my register.php <?php session_start(); include "config.php"; include "language.php"; include "rfunctions.php"; if (filesize("config.php") <= 150) { header("Location: install.php"); } global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $q=$db->query("SELECT userid FROM users"); $membs=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE bankmoney>-1"); $banks=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Male'"); $male=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Female'"); $fem=$db->num_rows($q); $total=0; //thx to http://www.phpit.net/code/valid-email/ for valid_email function valid_email($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } session_start(); print <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Infamous-Wars Register</title> <meta property="og:title" content="Infamous-wars" /> <meta property="og:description" content=" Infamous-Wars - Online Space Game, fight other players, war with planets, racing, build your own weapons and loads more. " /> <meta name="author" content="Peter Greenacre" /> <meta name="copyright" content="Copyright World-wars 2010-2013" /> <meta property="og:image" content="http://www.infamous-wars.com/title.png" /> <link rel="SHORTCUT ICON" href="favicon.ico" /> <link href="css/login.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> var xmlHttp // xmlHttp variable function GetXmlHttpObject(){ // This function we will use to call our xmlhttpobject. var objXMLHttp=null // Sets objXMLHttp to null as default. if (window.XMLHttpRequest){ // If we are using Netscape or any other browser than IE lets use xmlhttp. objXMLHttp=new XMLHttpRequest() // Creates a xmlhttp request. }else if (window.ActiveXObject){ // ElseIf we are using IE lets use Active X. objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") // Creates a new Active X Object. } // End ElseIf. return objXMLHttp // Returns the xhttp object. } // Close Function function CheckPasswords(password){ // This is our fucntion that will check to see how strong the users password is. xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object. if (xmlHttp==null){ // If it cannot create a new Xmlhttp object. alert ("Browser does not support HTTP Request") // Alert Them! return // Returns. } // End If. var url="check.php?password="+escape(password) // Url that we will use to check the password. xmlHttp.open("GET",url,true) // Opens the URL using GET xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange = equal to 4 than that means the request is done. if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text. document.getElementById("passwordresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php } // End If. }; // Close Function xmlHttp.send(null); // Sends NULL insted of sending data. } // Close Function. function CheckUsername(password){ // This is our fucntion that will check to see how strong the users password is. xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object. if (xmlHttp==null){ // If it cannot create a new Xmlhttp object. alert ("Browser does not support HTTP Request") // Alert Them! return // Returns. } // End If. var url="checkun.php?password="+escape(password) // Url that we will use to check the password. xmlHttp.open("GET",url,true) // Opens the URL using GET xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange = equal to 4 than that means the request is done. if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text. document.getElementById("usernameresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php } // End If. }; // Close Function xmlHttp.send(null); // Sends NULL insted of sending data. } // Close Function. function CheckEmail(password){ // This is our fucntion that will check to see how strong the users password is. xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object. if (xmlHttp==null){ // If it cannot create a new Xmlhttp object. alert ("Browser does not support HTTP Request") // Alert Them! return // Returns. } // End If. var url="checkem.php?password="+escape(password) // Url that we will use to check the password. xmlHttp.open("GET",url,true) // Opens the URL using GET xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange = equal to 4 than that means the request is done. if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text. document.getElementById("emailresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php } // End If. }; // Close Function xmlHttp.send(null); // Sends NULL insted of sending data. } // Close Function. function PasswordMatch() { pwt1=document.getElementById('pw1').value; pwt2=document.getElementById('pw2').value; if(pwt1 == pwt2) { document.getElementById('cpasswordresult').innerHTML="<font color='green'>OK</font>"; } else { document.getElementById('cpasswordresult').innerHTML="<font color='red'>Not Matching</font>"; } } </script> <!-- Begin Main Content --> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("<b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b></body></html>"); } if($_POST['username']) { if($set['regcap_on']) { if(!$_SESSION['captcha'] or $_SESSION['captcha'] != $_POST['captcha']) { unset($_SESSION['captcha']); die("Captcha Test Failed<br /> ><a href='register.php'>Back</a>"); } unset($_SESSION['captcha']); } if(!valid_email($_POST['email'])) { die("Sorry, the email is invalid.<br /> ><a href='register.php'>Back</a>"); } if(strlen($_POST['username']) < 4) { die("Sorry, the username is too short.<br /> ><a href='register.php'>Back</a>"); } $sm=100; if($_POST['ref'] == "Referer ID Here") { $sm+=100; } $username=$_POST['username']; $username=str_replace(array("<", ">"), array("<", ">"), $username); $q=$db->query("SELECT * FROM users WHERE username='{$username}' OR login_name='{$username}'"); $q2=$db->query("SELECT * FROM users WHERE email='{$_POST['email']}'"); if($db->num_rows($q)) { print "Username already in use. Choose another.<br /> ><a href='register.php'>Back</a>"; } else if($db->num_rows($q2)) { print "E-Mail already in use. Choose another.<br /> ><a href='register.php'>Back</a>"; } else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again.<br /> ><a href='register.php'>Back</a>"; } else { $_POST['ref'] = abs((int) $_POST['ref']); $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=$db->query("SELECT * FROM users WHERE lastip='$IP' AND userid={$_POST['ref']}"); if($db->num_rows($q)) { die("No creating referral multies. Bad dog.<br /> ><a href='register.php'>Back</a>"); } if($_POST['ref']) { $q=$db->query("SELECT * FROM users WHERE userid={$_POST['ref']}"); $r=$db->fetch_row($q); } $zom2=$db->query("SELECT * FROM hvzstats"); $hvz=$db->fetch_row($zom2); if($hvz['hvz'] ==1) { $zom=1; } else { $zom=0; } $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup, humanorzombie, Random_key) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 1000, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP', $zom, '".random_string('alnum', 32)."')"); $db->query("UPDATE users SET lastwin=2"); $db->query("UPDATE users SET lastlost=2"); $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, '100', '100', '100', '100', '10')"); $db->query("INSERT INTO pdetails VALUES($i, '', '', 0, '', '', '', '', '', '')") or die(mysql_error()); if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+20000 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 20000 valuable Gold Coins!",$c); $db->query("INSERT INTO referals VALUES('$ia', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); $ia=$db->insert_id(); } // get data just entered $getUser = $db->query("SELECT userid, login_name, email, Random_key FROM users WHERE login_name = '{$username}'") or die(mysql_error()); $row = $db->fetch_assoc($getUser); // Send rego email $stamp = unix_timestamp; $to = $_POST['email']; $subject = "Infamous-Wars Account Activation"; $body = "Hello " . $username . ",\n\nThank you for registering at Infamous-Wars!\n\nClick this link to activate your account: http://www.infamous-wars.com/activate.php?ID=".$row['userid']."&key=".$row['Random_key']." \n\n -Lord Kernow"; $headers = "Infamous-Wars"; if (mail($to, $subject, $body, $headers)) {} print "You have signed up, enjoy the game.<br> > <a href='login.php'>Login</a> "; } } else { if($set['regcap_on']) { $chars="123456789"; $len=strlen($chars); $_SESSION['captcha']=""; for($i=0;$i<6;$i++) $_SESSION['captcha'].=$chars[rand(0, $len - 1)]; } print " <img src='title.jpg' height='0' width='0'> <!-- Begin Main Content --> <body> <table width='982' border='0' align='center' cellpadding='0' cellspacing='0' class='bg1'> <tr> <td><table width='982' border='0' align='center' cellpadding='0' cellspacing='0' class='bg2'> <tr> <td><table width='950' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td width='677'><center><img src='images/title.png' alt='' width='677' height='141'></center></td> </tr> <tr> <td colspan='2' class='bg3' style='height:50px;'> <table width='950' border='0' cellspacing='0' cellpadding='0' style='height:50px;'> <tr> <td width='33'> </td> <td valign='middle' class='text2'> <a href='#.' class='link1'></a><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a> <table border='0' cellspacing='0' cellpadding='0'> <tr> <td><a href='login.php' class='link1'>$home</a></td> <td><img src='images/subpage1_02.jpg' alt='' width='2' height='16' hspace='15'></td> <td><a href='register.php' class='link1'>$register</a></td> <td><img src='images/subpage1_02.jpg' alt='' width='2' height='16' hspace='15'></td> </tr> </table></td> <td width='108' align='right' class='text1'><script language='JavaScript' type='text/javascript' src='date.js'></script></td> <td width='32'> </td> </tr> </table></td> </tr> </table> <table width='950' border='0' align='center' cellpadding='0' cellspacing='0'> <tr valign='top'> <td width='181'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td class='text2' style='background-image:url(images/homepage09.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='166' class='text2'>$nav</td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='login.php' class='link1'>$login</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='register.php' class='link1'>$register</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='advertise.php' class='link1'>$adv</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='faq.php' class='link1'>$faq</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='tos.php' class='link1'>$tos</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='privacy_policy.php' class='link1'>$prvp</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='safety_tips.php' class='link1'>$saftip</a></td> </tr> </table> </td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='contact_us.php' class='link1'>$contus</a></td> </tr> </table></td> </tr> <tr/> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='http://ividen.toolbar.fm' class='link1' target='_blank'>Our Toolbar</a></td> </tr> </table> <tr> <td><img src='images/homepage11.jpg' alt='' width='181' height='8'></td> </tr> </table> <table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td style='background-image:url(images/); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> </tr> </table></td> </tr> </table></td> <td width='589'><table width='589' border='0' cellspacing='0' cellpadding='0'> <tr> <td style='background-image:url(images/homepage13.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='26' height='40'></td> <td width='166' class='text2'><h2><legend>Infamous-Wars</legend></h2> </td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td><table width='535' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td> "; print "<center><h3>{$set['game_name']} Registration</h3></center>"; print "<form action=register.php method=post><center> <table width='75%' class='table' cellspacing='1'> <tr> <center><td width='30%'>Username</td><center> <td width='40%'><input type=text name=username onkeyup='CheckUsername(this.value);' style='background-color:transparent;'></td> <td width='30%'><div id='usernameresult'></div></td> </tr> <tr> <td>Password</td> <td><input type=password id='pw1' name=password onkeyup='CheckPasswords(this.value);PasswordMatch();' style='background-color:transparent;'></td> <td><div id='passwordresult'></div></td> </tr> <tr> <td>Confirm Password</td><td><input type=password name=cpassword id='pw2' onkeyup='PasswordMatch();' style='background-color:transparent;'></td> <td><div id='cpasswordresult'></div></td> </tr> <tr> <th colspan='3'>E-Mail Address Must be Real And Valid to play this game.</th> </tr> <tr> <td>Email</td><td><input type=text name=email onkeyup='CheckEmail(this.value);' style='background-color:transparent;'></td> <td><div id='emailresult'></div></td> </tr> <tr> <th colspan='3'><small>Verification Link will be E-mailed to your E-mail Address</small></th> </tr> <tr> <td>Gender</td> <td colspan='2'><select name='gender' type='dropdown'> <option value='Male'>Male <option value='Female'>Female</select></td> </tr> <tr> <td>Referer ID</td><td colspan=2><input type=text name=promo style='background-color:transparent;'></td> </tr> <input type=hidden name=ref value='"; if($_GET['ref']) { print $_GET['ref']; } print "' />"; if($set['regcap_on']) { print "<tr> <td colspan=3><img src='captcha_verify.php?bgcolor=C3C3C3' /><br /> <input type='text' name='captcha' style='background-color:transparent;'/></td> </tr>"; } print " <tr> <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form><br /> > <a href='login.php'>Go Back</a>"; } print <<<OUT </td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td style='background-image:url(images/homepage13.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='26' height='40'></td> <td width='166' class='text2'><h2></h2></td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td><table width='535' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td width='218'><p class='text2'> </td> </table></td> </tr> </table> <br> <br></td> <td width='180'><table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='180' style='background-image:url(images/homepage20.jpg); height:40px;'><table width='180' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='166' class='text2'>$sitelog</td> </tr> </table></td> </tr> <tr> <td><form action='authenticate.php' method='post' name='login' onsubmit='return saveme();' > <table width='155' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2' class='text1' style='height:25px;'>$usname</td> </tr> <tr> <td colspan='2'><input type='text' name='username' style='background-color:transparent;'></td> </tr> <tr> <td colspan='2' class='text1' style='height:25px;'>$passv</td> </tr> <tr> <td colspan='2'><input type='password' name='password' style='background-color:transparent;'></td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td width='115'><a href='forgot_password.php'>$passfg</a> </td> <td width='43' align='center'><input type='submit' value='$login' align='right' ></td> </tr> <tr> <td colspan='2'> <br /><br /></td> </tr> </table> </form> </td> </tr> </table> <table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='180' style='background-image:url(images/homepage20.jpg); height:40px;'><table width='180' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='165' class='text2'>$gameinfo</td> </tr></td> </table></td> </table> <table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <br /> <style type='text/css'> .style1 { text-align: center; } </style> <div class='style1'> $players $membs <br> $mal $male <br> $fems $fem</div> <br /> <center> <img src='and.png' height='20' width='20'> Get our Android App <img src='and.png' height='20' width='20'> <br /> <a href='http://www.appsgeyser.com/getwidget/WorldWars'><img src='android.png'></a> </center> </td></tr> </table></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td class='style2' style='height:40px;'> </td> </tr> </table></td> </tr> </table> <table width='982' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td class='style2'><i><center>World-Wars. Game Copyright ©2011-2012 Peter Greenacre.({$db->num_queries}) queries. </center></i></td> </tr> <tr> <td class='style2'> </td> </tr> <tr> <td class='style2'> </td> </tr> <tr> <td class='style2'> </td> </tr> </table> <td colspan="3 <div class='dotted_faded_box_home'>"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <div class='dotted_faded_box_home'> <td class="dgradl"> </td> <td class="dgrad"><center><strong> <td class="dgradr"> <div class='dotted_faded_box_home'></td> </tr> </table> </td> </tr> </table> </div> </div> </div> </div> </body> </html> </body> </html> EOF; OUT; ?>
  3. oh erm..... yeah i did lol. what should i do lol.
  4. well i went through his script and changed it to mysqli and it still dont quite work. i know its set to mysqli in config as MTG coded my class for me.
  5. A while back i got Cronus workshop mod. i'm running a game on wamp and i was wondering if anyone has a upto date mysqli version of this and i changed mine to mysqli and it still dont work
  6. I know this is a late reply, but working on it slowly. Ive got this $file = ($_POST['episode']); $direc = ($_POST['dir']); $path_parts = pathinfo(''.$_POST['episode'].''); $dir = ($path_parts['dirname']); $base = ($path_parts['basename']); $ext = ($path_parts['extension']); $name = ($path_parts['filename']); $sql = "INSERT INTO `tvdir` (`id`, `directory`, `series`, `episode`, `name`, `desc`) VALUES (NULL, '{$_POST['episode']}', '{$dir}', '{$name}', '', '')"; if ($mysqli->query($sql)) { //echo "New Record has id ".$mysqli->insert_id; echo "<p>Entered Into Database!</p>"; } else { echo "<p>MySQL error no {$mysqli->errno} : {$mysqli->error}</p>"; exit(); }   which does place it into the database, but my knowledge isnt good enough to firgure out how to do them all at once.
  7. I did have this at one stage but no longer, sorry
  8. This was good however i have some bad news. goinstant.com is closing. Read more here https://goinstant.com/blog/time-to-say-farewell
  9.   I've been looking forward to this myself. cant wait.
  10. <?php include "globals.php"; include "bbcode.php"; include "bbcodestyle.css"; if($ir['mailban']) { printf("<span style='color:red;'><h3>ERROR</h3>You have been mail banned for {$ir['mailban']} days.<strong>Reason: {$ir['mb_reason']}</font></strong>"); $h->endpage(); exit; } $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(@intval($_GET['ID'])) : null; if($ir['pagetutorials'] == 'ON') { echo " <table width='75%' border='3' bordercolor='#BDBDBD' cellspacing='0' bgcolor='#FBFBE0' frame='border'> <tr> <td width='75'><img src='images/lightbulb.gif' alt='Lightbulb' /><br /><span style='color:#999;'><em>[<a href='preferences.php?action=pagetutorialschange'></a>]</em></span></td> <td><strong>Your Mailbox</strong><br /><span style='color:#000;font-size:3em;'>Hopefully, I shouldnt have to tell you how this works.</span></td> </tr> </table><br />"; } echo "<br /><hr /><br /><table width='87%' class='table' cellspacing='1' style='text-align:center;'> <tr> <td><a href='mailbox.php?action=inbox'><img src='images/indox.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=outbox'><img src='images/sent.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=compose'><img src='images/compose.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=delall'><img src='images/deleteall.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=archive'><img src='images/archiveall.gif' width='75px' height='79px'></a></td> <td><a href='contactlist.php'><img src='images/contacts.gif' width='75px' height='79px'></a></td> </tr> </table><br /><hr /><br />"; $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'inbox': mail_inbox(); break; case 'outbox': mail_outbox(); break; case 'compose': mail_compose(); break; case 'delete': mail_delete(); break; case 'delall': mail_delall(); break; case 'archive': mail_archive(); break; case 'del': mail_massdel(); break; case 'read': mail_view(); break; default: mail_inbox(); break; } function mail_inbox() { global $db, $ir, $c, $userid, $h; ?> <script><!-- HIDE function setCheckboxes(the_form, do_check) { var elts = (typeof(document.forms[the_form].elements['ID[]']) != 'undefined') ? document.forms[the_form].elements['ID[]'] : (typeof(document.forms[the_form].elements['ID[]']) != 'undefined') ? document.forms[the_form].elements['ID[]'] : document.forms[the_form].elements['ID[]']; var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0; if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; } // end for } else { elts.checked = do_check; } // end if... else return true; } // STOP HIDING --></script> Only the last 25 messages sent to you are visible. <form name='masssell' method='post' action='mailbox.php?action=del'> <table width='100%' class='table1' cellspacing='1' border='0'> <tr> <th>From</th> <th>Status</th> <th>Read</th> <th>Delete</th> </tr> <?php $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_from` = `u`.`userid`) " . "WHERE (`m`.`mail_to` = %d) " . "ORDER BY `m`.`mail_time` DESC LIMIT 25", $ir['userid'])); $i = 0; while($r = $db->fetch_row($q)) { printf("<tr class='d%d'>", $i & 1); $i++; echo "<td>"; echo $r['mail_from'] ? sprintf("<center><a href='viewuser.php?u=%d' style='color:%s;'>%s</a> (%s)", $r['mail_from'], stripslashes($r['colour']), stripslashes($r['username']), number_format($r['mail_from'])) : "<span style='color:yellow;font-weight:700;'>SYSTEM</span>"; echo "</center></td>"; printf("<td>%s</td>", !$r['mail_read'] ? "<span style='color:red;'>Unopened</span>" : "<span style='color:green;'>Read</span>"); printf("<td><a href='mailbox.php?action=read&ID=%d'>Open</a></td>", $r['mail_id']); printf("<td><a href='mailbox.php?action=delete&ID=%d'><img src='images/trash.gif' height='20' width='20' alt='Delete' /></a> <input type='checkbox' name='del%d' value='yes' /><input type='hidden' name='id%d' value='%d' /></td>", $r['mail_id'], $i, $i, $r['mail_id']); echo "</tr>"; } ?> <tr> <td colspan='5'><center><hr /><input name='sellmass' type='submit' id='sellmass' value='Delete selected' /><br /><a href='#' onClick='setCheckboxes("masssell",true); return false;'>Check All</a> | <a href='#' onClick='setCheckboxes("masssell",false); return true;'>Uncheck All </a></center></td> </tr> </table> </form><? } function mail_outbox() { global $db, $ir, $c, $userid, $h; ?>Only the last 25 messages you have sent are visible.<br /> <table width='75%' cellspacing='1' class='table'> <tr> <th>To</th> <th>Message</th> </tr><? $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_to` = `u`.`userid`) " . "WHERE (`m`.`mail_from` = %d) " . "ORDER BY `m`.`mail_time` DESC LIMIT 25", $ir['userid'])); while($r = $db->fetch_row($q)) { echo "<tr>"; printf("<td><a href='viewuser.php?u=%d' style='color:%s;'>%s</a> [%s]</td>", $r['mail_from'], $r['colour'], stripslashes($r['username']), number_format($r['mail_from'])); printf("<td>%s</td>", stripslashes($r['mail_subject'])); echo "</tr>"; echo "<tr>"; printf("<td>Sent at: %s</td>", date('F j, Y, g:i:s a', $r['mail_time'])); printf("<td>%s</td>", stripslashes($r['mail_text'])); echo "</tr>"; } echo '</table>'; } function mail_compose() { global $db, $ir, $db, $userid, $h; if(!isset($_POST['form'])) { ?><script type="text/javascript"> function insert(el,ins) { if (el.setSelectionRange){ el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length); } else if (document.selection && document.selection.createRange) { el.focus(); var range = document.selection.createRange(); range.text = ins + range.text; } } </script> <form action='mailbox.php?action=compose' method='post'> <input type='hidden' name='form' value='1' /> <table width='75%' border='0'> <tr> <th>ID to send to:</th> <td><input type='text' name='userid' value='<? echo $_GET['ID']; ?>' style='color: white; background-color:#2E2E2E' class='loginbox' /></td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <th>Message:</th> <td> <input type="button" class="bbcode_hover" onClick="insert(this.form.message,'[b][/b]'); return false;" value="" /> <input type="button" class="bbcode_hover0" onClick="insert(this.form.message,'[br]'); return false;" value="" /> <input type="button" class="bbcode_hover1" onClick="insert(this.form.message,'[i][/i]'); return false;" value="" /> <input type="button" class="bbcode_hover2" onClick="insert(this.form.message,'[u][/u]'); return false;" value="" /> <input type="button" class="bbcode_hover3" onClick="insert(this.form.message,'[url][/url]'); return false;" value="" /> <input type="button" class="bbcode_hover5" onClick="insert(this.form.message,'[img][/img]'); return false;" value="" /> <input type="button" class="bbcode_hover7" onClick="insert(this.form.message,'[color=#xxxxxx][/color]'); return false;" value="" /> <br /> <input type="image" src="smilies/smiley1.gif" alt="Smile" title="smile" onclick="insert(this.form.message,':)'); return false;" /> <input type="image" src="smilies/smiley2.gif" alt="Wink" title="Wink" onclick="insert(this.form.message,';)'); return false;" /> <input type="image" src="smilies/smiley3.gif" alt="Suprised" title="Suprised" onclick="insert(this.form.message,':o'); return false;" /> <input type="image" src="smilies/smiley4.gif" alt="Cheesy Grin" title="Cheesy Grin" onclick="insert(this.form.message,':D'); return false;" /> <input type="image" src="smilies/smiley5.gif" alt="Confused" title="Confused" onclick="insert(this.form.message,':s'); return false;" /> <input type="image" src="smilies/smiley6.gif" alt="Sad" title="Sad" onclick="insert(this.form.message,':('); return false;" /> <input type="image" src="smilies/smiley7.gif" alt="Angry" title="Angry" onclick="insert(this.form.message,':red'); return false;" /> <input type="image" src="smilies/smiley8.gif" alt="Clown" title="Clown" onclick="insert(this.form.message,':clown'); return false;" /> <input type="image" src="smilies/smiley9.gif" alt="Embarrassed" title="Embarrassed" onclick="insert(this.form.message,':bashful'); return false;" /> <input type="image" src="smilies/smiley10.gif" alt="Star" title="Star" onclick="insert(this.form.message,':x'); return false;" /> <input type="image" src="smilies/smiley11.gif" alt="Sick" title="Sick" onclick="insert(this.form.message,':green'); return false;" /> <input type="image" src="smilies/smiley12.gif" alt="Bored" title="Bored" onclick="insert(this.form.message,':|'); return false;" /> <input type="image" src="smilies/smiley13.gif" alt="Begging" title="Begging" onclick="insert(this.form.message,';('); return false;" /> <input type="image" src="smilies/smiley14.gif" alt="Smug" title="Smug" onclick="insert(this.form.message,':]'); return false;" /> <input type="image" src="smilies/smiley15.gif" alt="Horny" title="Horny" onclick="insert(this.form.message,':horny'); return false;" /> <input type="image" src="smilies/smiley16.gif" alt="Cool" title="Cool" onclick="insert(this.form.message,':cool'); return false;" /><br /> <textarea name='message' rows='10' cols='70' style='color: white; background-color: #2E2E2E' class="loginbox"></textarea> </td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2' class='center'><center><input type='image' src='images/mailsend.jpeg' id='btn' name='submit' /></center></td> </tr> </table> </form><? if($_GET['ID']) { echo "<br /><hr /><br /> <table width='75%' border='0'> <tr> <th colspan='2'>Your last 5 mails to/from this person:</th> </tr>"; $q = $db->query(sprintf("SELECT `m`.*, `u1`.`username` AS `sender` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u1` ON (`m`.`mail_from` = `u1`.`userid`) " . "WHERE (((`m`.`mail_from` = %d) AND (`m`.`mail_to` = %d)) OR ((`m`.`mail_to` = %d) AND (`m`.`mail_from` = %d))) " . "ORDER BY `m`.`mail_time` DESC LIMIT 5", $ir['userid'], $_GET['ID'], $ir['userid'], $_GET['ID'])); if(!$db->num_rows($q)) { echo "<tr><td colspan='2' class='center'>No messages exist</td></tr>"; } else { while($r = $db->fetch_row($q)) { echo "<tr>"; printf("<td>%s</td>", date('F j, Y, g:i:s a', $r['mail_time'])); printf("<td><strong><span style='color:%s;'>%s</span> [%s] wrote:</strong> %s</td>", stripslashes($r['colour']), stripslashes($r['sender']), number_format($_GET['ID']), stripslashes($r['mail_text'])); echo "</tr>"; } } echo '</table>'; } } else { $_POST['userid'] = isset($_POST['userid']) && ctype_digit($_POST['userid']) ? abs(@intval($_POST['userid'])) : null; if(empty($_POST['userid'])) { echo "You didn't select a valid player to send a message to"; $h->endpage(); exit; } $selectPlayer = $db->query(sprintf("SELECT `username` FROM `users` WHERE (`userid` = %d)", $_POST['userid'])); if(!$db->num_rows($selectPlayer)) { echo "That player doesn't exist"; $h->endpage(); exit; } $subj = str_replace("\n", "<br />", strip_tags($_POST['subject'])); $codes = array( ":)", ";)", ":o", ":D", ":s", ":(", ":red", ":clown", ":bashful", ":x", ":green", ":|", ";(", ":]", ":horny", ":cool", "(LK)", "(O)" ); $images = array( "<img src='smilies/smiley1.gif' />", "<img src='smilies/smiley2.gif' />", "<img src='smilies/smiley3.gif' />", "<img src='smilies/smiley4.gif' />", "<img src='smilies/smiley5.gif' />", "<img src='smilies/smiley6.gif' />", "<img src='smilies/smiley7.gif' />", "<img src='smilies/smiley8.gif' />", "<img src='smilies/smiley9.gif' />", "<img src='smilies/smiley10.gif' />", "<img src='smilies/smiley11.gif' />", "<img src='smilies/smiley12.gif' />", "<img src='smilies/smiley13.gif' />", "<img src='smilies/smiley14.gif' />", "<img src='smilies/smiley15.gif' />", "<img src='smilies/smiley16.gif' />", "<img src='lk.png' />", "<img src='one.png' />" ); $newmsg = $db->escape(str_replace($codes, $images, $_POST['message'])); $to = $_POST['userid']; $db->query(sprintf("INSERT INTO `mail` VALUES ('', 0, %d, %d, %s, '%s', '%s')", $ir['userid'], $to, time(), $subj, $newmsg)); $db->query(sprintf("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE (`userid` = %d)", $to)); printf("Your message to %s has been sent", stripslashes($player)); } } function mail_delete() { global $db, $ir, $c, $userid, $h; if(empty($_GET['ID'])) { echo "You didn't select a valid message to delete"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT `mail_id` FROM `mail` WHERE ((`mail_id` = %d) AND (`mail_to` = %d))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($select)) { echo "Either that message doesn't exist, or it's not yours"; $h->endpage(); exit; } $db->query(sprintf("DELETE FROM `mail` WHERE (`mail_id` = %d)", $_GET['ID'])); echo "Message deleted.<br /><a href='mailbox.php'>> Back</a>"; } function mail_view() { global $db, $ir, $c, $userid, $h; ?><table width='100%' class='table' border='0' cellspacing='1'> <tr> <th width='25%'>From</th> <th width='75%'>Message</th> </tr><? $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_from` = `u`.`userid`) " . "WHERE ((`m`.`mail_id` = %d) AND (`m`.`mail_to` = %d))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($q)) { echo "Either that message doesn't exist, or it's not yours"; $h->endpage(); exit; } $r = $db->fetch_row($q); echo "<tr>"; printf("<td>%s</td>", $r['mail_from'] ? sprintf("<a href='viewuser.php?u=%d' style='color:%s;'>%s</a> [%s]", $r['mail_from'], stripslashes($r['colour']), stripslashes($r['username']), number_format($r['mail_from'])) : "SYSTEM"); printf("<td>%s</td>", stripslashes($r['mail_subject'])); echo "</tr>"; echo "<tr>"; printf("<td>Sent at: %s<br /><br /><a href='mailbox.php?action=compose&ID=%d'>Reply</a><br /><a href='mailbox.php?action=delete&ID=%d'>Delete</a><br /><a href='preport.php?ID=%d'>Report</a></td>", date('F j, Y, g:i:s a', $r['mail_time']), $r['mail_from'], $r['mail_id'], $r['mail_from']); printf("<td>%s</td>", stripslashes($r['mail_text'])); echo "</tr>"; echo "</table>"; if($r['mail_text'] == 'You have just been mailed bomb, damm unlucky.') { $db->query(sprintf("UPDATE `users` SET `hospital` = `hospital` + %d, `hospreason` = 'Mailbombed' WHERE (`userid` = %d)", mt_rand(10, 140), $ir['userid'])); } if(!$r['mail_read']) { $db->query(sprintf("UPDATE `mail` SET `mail_read` = 1 WHERE (`mail_id` = %d)", $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `new_mail` = `new_mail` - 1 WHERE (`userid` = %d)", $ir['userid'])); } } function mail_delall() { global $db, $ir; if(!isset($_GET['ans'])) { echo "This will delete all the messages in your inbox.<br />There is <strong>NO</strong> undo, so be sure.<br /><a href='mailbox.php?action=delall&ans=yes'>> Yes, delete all messages</a><br /><a href='mailbox.php'>> No, go back</a>"; } else { $db->query(sprintf("DELETE FROM `mail` WHERE (`mail_to` = %d)", $ir['userid'])); printf("%s message%s ha%s been deleted", $db->affected_rows(), ($db->affected_rows() == 1) ? '' : 's', ($db->affected_rows() == 1) ? 's' : 've'); } } function mail_archive() { echo "This tool will download an archive of all your messages.<br /><a href='dlarchive.php?a=inbox'>> Download Inbox</a><br /><a href='dlarchive.php?a=outbox'>> Download Outbox</a>"; } function mail_massdel() { global $db, $ir, $c, $userid, $h; $counter = 1; $deleted = 0; while($counter < 25) { $dodel = "del" . $counter; if($_POST[$dodel] == "yes") { $delid = "id" . $counter; $db->query(sprintf("DELETE FROM `mail` WHERE ((`mail_to` = %d) AND (`mail_id` = %d))", $ir['userid'], $_POST[$delid])); $deleted++; } $counter++; } printf("%s message%s ha%s been deleted", $deleted, ($deleted == 1) ? '' : 's', ($deleted == 1) ? 's' : 've'); } echo "<br /><br />Mail count mixed up? Click <a href='fix.php?fix=1'>Here</a> to fix"; $h->endpage(); ?>   http://pastebin.com/9jwzQnra Thanks goes to MTG for coding this for me ages. Please do give thanks. Oh and dont forget to edit the code to suit your game.
  11.   ok thats a fair enough point.
  12. yup MTG recoded it for me. never said i made it, just posted up here a working edition. I removed it as i didnt get no thanks or anything for posting it up, it had over 500 views.
  13. I have removed this now, 214 views and not one thank you. so yeah
  14.   Mccodes and Ravan is the Same Script. Just Ravans is stolen code.
  15. hmmm, well i have tried a few login systems out there but i havent found one simple enough and aint good enough to do it myself. Best i could do is strip down mccodes and use that which is a bad idea.....
  16. Yes it does sound like a good idea but it'll take ages to put all the files into the database. But there are a few hundred avi files which seems like alot of hard work when this code grabs all the files needed in the dir I've attached a screeny of my work so far. neither am i any good at creating my own login system to suit my needs.
  17.   No database, The first line $texts = glob($directory ."tv/walkingdead/*/*.flv"); $image = glob($directory ."tv/walkingdead/*/*.jpg"); Selects all Videos and Pictures on the dir of the file manager
  18. wrong board?
  19. Well i tried to put the loops in with eachother then tried to put them together, but i wasnt very good or successfull at doing it. I'm an ok coder but i know what i know and not much other than that, which is why its bad lol. getting there tho. would you be able to put up a demo or somthing with 2 loops in one, i tried to google it but couldnt find what i needed it.
  20. well i have 2 foreach on there which makes this harder i think
  21. Thanks, what a star.
  22. well Here is a Screeny. Basically i want the "Input radio, <-->, Episode Name, the Picture" all on one line. as you can see from the screeny it doesnt line up.
  23. peterisgb

    Help with tables

    Hi i am working on this video script for my local network and i am stuck with the tables, i cant figure out which way round it all goes. i spent all last night untill 5am trying to figuring it out, please help, thanks   <?php include "head.php"; $texts = glob($directory ."tv/walkingdead/*/*.flv"); $image = glob($directory ."tv/walkingdead/*/*.jpg"); echo '<form action="watch.php" method="post"> <table border="0" width="600" cellpadding="0"> <tr><td> '; foreach($texts as $text) { $video="$text"; $file = basename($video, ".flv"); echo '<table border="0" width="300" cellpadding="0"> <tr width="300" height="200"> <td><INPUT type="radio" name="episode" value="'.$video.'"></td> <td><--></td> <td>'.$video.'</td></tr></table> '; } echo '</td><td>'; foreach($image as $imge) { $images="$imge"; $file = basename($images, ".jpg"); echo '<table border="0"> <tr width="300" height="200"> <td><img src="'.$images.'" width="300" height="200"></td> </tr></table>'; } echo '</td> </tr></table> <input type="submit" value="Watch"/></form>'; echo '<br /><br /><br /><br /><a href="index.php">Home </button>'; include "foot.php"; ?>
  24. I like the idea of this. good work. thos i think i would have to agree with Sniko, But as its free i think that if anyone is going to use it they should make it into there own table. Might use this.
  25. Yea the Design is nice, i believe chaotic wars use this exact basis on there game.
×
×
  • Create New...