Jump to content
MakeWebGames

Karlos

Members
  • Posts

    951
  • Joined

  • Last visited

    Never

Everything posted by Karlos

  1. Re: [mccodes V2] my verry first log in page And to shut Crazy-T up:   <?php session_start(); include_once (DIRNAME(__FILE__) . '/config.php'); global $_CONFIG; define("MONO_ON", 1); include_once (DIRNAME(__FILE__) . '/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(); $SelectSettings = $db->query("SELECT * FROM settings"); while($r = $db->fetch_row($SelectSettings)) { $Set[$r['conf_name']] = $r['conf_value']; } echo ' <html> <head> <title>Game title</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie("player") != null) { usr.value = GetCookie("username") pw.value = GetCookie("password") if (GetCookie("save") == "true") { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie("username", usr.value, expdate); SetCookie("password", pw.value, expdate); SetCookie("save", "true", expdate); } if (sv[1].checked) { DeleteCookie("username"); DeleteCookie("password"); DeleteCookie("save"); } } else { alert("You must enter a username/password."); return false; } } </script> <style> body { font-family:Century gothic;font-size:9pt;color: black; background-color:Silver; scrollbar-base-color: #000000; scrollbar-arrow-color: #000000; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <td><center>[img=banner.jpg]<table width=50% border=1><td valign=top> <FORM METHOD="LINK" ACTION="register.php"><length=5><center> <INPUT TYPE="submit" VALUE="Register"></form> <center><td valign=top><FORM METHOD="LINK" ACTION="toc.php"><length=5><center> <INPUT TYPE="submit" VALUE="Currently Unavailable"> </form> <center><td valign=top><FORM METHOD="LINK" ACTION="gamestats.php"><length=5><center> <INPUT TYPE="submit" VALUE="Currently Unavailable"> </FORM> </table> <center><table width=50% border=1><td valign=top> Welcome to the Camper. Camper is full of criminals from all around the world. If you wanna be the biggest, badest and richest in the game you will have to fight for it. Grab your weapon, Create or join a gang, Become number one by fear and power. Do you dare to cross the line? </table> <h3><center>Camper Log In</h3> <center><table width=20% border=1><tr><td width=50%><fieldset><font size=+2><center><legend>Camper</legend><form action=authenticate.php method=post name=login onsubmit="return saveme();">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> [i]<center>Copyright © 2008 Oliver.</center>[/i]</body></html> '; ?>
  2. Re: [mccodes V2] my verry first log in page   I just posted the php version.... didn't say i edited alot.... (Btw, you shouldn't illegally download engines (wondering what im on about? MSN Chats so dw))   i know but as i said i made it php for thehacker07's sake.
  3. Re: [mccode v2] Faction with Armoury on that file find where it says real_escape_string and make it mysql_real_escape_string
  4. Re: [mccodes V2] my verry first log in page i made it php to shut thehacker07 up :-P
  5. Re: [mccodes V2] my verry first log in page   <?php echo ' <html> <head> <title>Game title</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie("player") != null) { usr.value = GetCookie("username") pw.value = GetCookie("password") if (GetCookie("save") == "true") { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie("username", usr.value, expdate); SetCookie("password", pw.value, expdate); SetCookie("save", "true", expdate); } if (sv[1].checked) { DeleteCookie("username"); DeleteCookie("password"); DeleteCookie("save"); } } else { alert("You must enter a username/password."); return false; } } </script> <style> body { font-family:Century gothic;font-size:9pt;color: black; background-color:Silver; scrollbar-base-color: #000000; scrollbar-arrow-color: #000000; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <td><center>[img=banner.jpg]<table width=50% border=1><td valign=top> <FORM METHOD="LINK" ACTION="register.php"><length=5><center> <INPUT TYPE="submit" VALUE="Register"></form> <center><td valign=top><FORM METHOD="LINK" ACTION="toc.php"><length=5><center> <INPUT TYPE="submit" VALUE="Currently Unavailable"> </form> <center><td valign=top><FORM METHOD="LINK" ACTION="gamestats.php"><length=5><center> <INPUT TYPE="submit" VALUE="Currently Unavailable"> </FORM> </table> <center><table width=50% border=1><td valign=top> Welcome to the Camper. Camper is full of criminals from all around the world. If you wanna be the biggest, badest and richest in the game you will have to fight for it. Grab your weapon, Create or join a gang, Become number one by fear and power. Do you dare to cross the line? </table> <h3><center>Camper Log In</h3> <center><table width=20% border=1><tr><td width=50%><fieldset><font size=+2><center><legend>Camper</legend><form action=authenticate.php method=post name=login onsubmit="return saveme();">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> [i]<center>Copyright © 2008 Oliver.</center>[/i]</body></html> '; ?>
  6. Re: InnoDB or MyISAM @ CtrlFreq: If what your saying is accurate.. then   DROP TABLE IF EXISTS `members_attack_stats`; CREATE TABLE `members_attack_stats` ( `AS_ID` INT(7) UNSIGNED NOT NULL DEFAULT '0', `AS_Strength` DECIMAL(20, 2) NOT NULL DEFAULT '0.00', `AS_Defence` DECIMAL(20, 2) NOT NULL DEFAULT '0.00', `AS_Speed` DECIMAL(20, 2) NOT NULL DEFAULT '0.00', `AS_Dexterity` DECIMAL(20, 2) NOT NULL DEFAULT '0.00' ) ENGINE = InnoDB;   Would be the best suited choice for the engine?
  7. Re: [mccode] Staff Positions Mod   Ever heard html tags are faster than echo? Depends actually... if using HTML and no php then yea.   Yea, i found that out so i have stopped doing it.
  8. Re: [mccode] Staff Positions Mod Ever heard echo was faster? :-P   <?php include_once (DIRNAME(__FILE__) . '/globals.php'); echo ' <table width=75% cellspacing=1 class="table"> <tr style="background:gray"> <th>Staff Position</th> <th>Name</th> <th>Staff Level</th> </tr> <tr> <td>position</td> <td>[url="viewuser.php?u=id here"]user name and id[/url]</td> <td>Owner</td> </tr> <tr> <td> position</td> <td>[url="viewuser.php?u=id here"] user name and id[/url]</td> <td>Admin</td> </tr> <tr> <td>position</td> <td>[url="viewuser.php?u=id here"]user name and id[/url]</td> <td>Assistant</td> </tr> </table>'; $h->endpage(); ?>
  9. Re: Houses Lvls Maxed Exp is decimal (11, 4) I believe..
  10. Re: change names... crystals, will, brave, ect global_func.php
  11. Re: Simple MySQL optimization Just curiosity really. Just an idea I never though of asking but this seemed like the right thread so I thought I'll have ago
  12. Re: Simple MySQL optimization Well... if(isset($_POST['NotesUpdate'])) { $UpdatePad = sprintf( "UPDATE `users` SET `user_notepad` = '%s' WHERE `userid` = '%u'", mysql_real_escape_string($_POST['NotesUpdate']), $userid); $db->query($UpdatePad); @header('Redirect: 1; index.php'); }   would work the same without ` like:   if(isset($_POST['NotesUpdate'])) { $UpdatePad = sprintf( "UPDATE users SET user_notepad = '%s' WHERE userid = '%u'", mysql_real_escape_string($_POST['NotesUpdate']), $userid); $db->query($UpdatePad); @header('Redirect: 1; index.php'); }   So would this affect it or not?
  13. Re: Simple MySQL optimization So does this count for ` ? e.g (Sorry for it being an extract out of index.php) if(isset($_POST['NotesUpdate'])) { $UpdatePad = sprintf( "UPDATE `users` SET `user_notepad` = '%s' WHERE `userid` = '%u'", mysql_real_escape_string($_POST['NotesUpdate']), $userid); $db->query($UpdatePad); @header('Redirect: 1; index.php'); }
  14. Re: [mccode v2] Events Page Updated.   Hmmm, funny, a look at the code shows it will error... right about here... "<center><h2>Thahacker07 Say's Hello</h2></center>" Plus further more, testing it... it effectivelly errors... on that exact place. Dude... Thats not on mine. Get it right.
  15. Re: [mccode] Religions Mod Try "enum" for the SQL.... Helps alot.
  16. Re: [mccode v2] Events Page Updated. That also worked fine for me..
  17. Re: [mccode v2] Events Page Updated.   care to explain? I have it running on a WAMP server... error_reporting(E_ALL); and have a guess.. no errors what so ever..... explain how it wont...
  18. Re: [mccode v2] Events Page Updated.   <?php include_once (DIRNAME(__FILE__). '/globals.php'); //Create Page Number's. $limit = 10; $page = abs(@intval($_GET['page'])); $page = !isset($page) ? $_GET['page'] : 1; $by = 'evTIME'; $order = 'DESC'; $rows = mysql_query("SELECT `evID` FROM `events` WHERE `evUSER` = ".$ir['userid']); $rows = mysql_num_rows($rows); $pages = ceil($rows/$limit); if($rows % $limit == 0) { $pages++; } if(isset($_POST['del_all'])) { mysql_query("DELETE FROM `events` WHERE `evUSER` = ".$ir['userid']) or die(mysql_error()); echo 'All events have been deleted.'; } if(isset($_GET['del'])) { $id = abs(@intval($_GET['del'])); mysql_query("DELETE FROM `events` WHERE `evID` = ".$id." AND `evUSER` = ".$ir['userid']); echo 'Event deleted.'; } if(isset($_POST['checkbox'])) { for($i = 0; $i < count($_POST['checkbox']); $i++) { mysql_query("DELETE FROM `events` WHERE `evID` IN(".$_POST['checkbox'][$i].") AND `evUSER` = ".$ir['userid']); $result = 1; } if($result == 1) { echo $i.' event(s) have been deleted.'; } else { echo 'Error occured while trying to delete the event(s).'; } } $pg = 'Page: '; echo '<h2>Events</h2> [b]Note:[/b] If you click on the check box and go to next page. The checkbox will be cleared. So delete the event\'s you want to delete before going to next page. <form action="'.$_SERVER['PHP_SELF'].'" method="post">'.$pg; for($i = 1; $i <= $pages; $i++) { $next = ($i * $limit); if ($i != 0) { echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$next.'"]'.$i.'[/url] - '; } } echo ' <table border="1" cellspacing="0" cellpadding="0" class="table" width="80%"> <tr> <th>Time</th> <th>Event</th> <th>Links</th> </tr>'; if ($page >= 10) { $page=$page-10; } $myEvents = mysql_query("SELECT `evTIME`, `evREAD`, `evTEXT`, `evID` FROM `events` WHERE `evUSER` = ".$ir['userid']." ORDER BY ".$by." ".$order." LIMIT ".$page.",".$limit); while($soc = mysql_fetch_assoc($myEvents)) { $time = date('F j Y, g:i:s a', $soc['evTIME']); if(!$soc['evREAD']) { $new = ' [b]New![/b]'; } echo ' <tr> <td>'.$time.' '.isset($new).'</td> <td>'.$soc['evTEXT'].'</td> <td> <input type="checkbox" name="checkbox[]" value="'.$soc['evID'].'"> | '; if(isset($_GET['page']) ) { echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$_GET['page'].'&del='.$soc['evID'].'"]Delete[/url]'; } else { echo '[url="'.$_SERVER['PHP_SELF'].'?del='.$soc['evID'].'"]Delete[/url]'; } echo ' </td> </tr> <tr>'; } echo ' </tr> </table> '.$pg; for($i = 1; $i <= $pages; $i++) { $next = ($i * $limit); if ($i != 0) { echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$next.'"]'.$i.'[/url] - '; } } echo ' <input type="submit" value="Delete Selected Events"> | <input name="del_all" id="del_all" type="button" value="Delete All Events"> </form>'; if(isset($ir['new_events']) > 0) { mysql_query("UPDATE `events` SET `evREAD` = 1 WHERE `evUSER` = ".$ir['userid']); mysql_query("UPDATE `users` SET `new_events` = 0 WHERE `userid` = ".$ir['userid']); } $h->endpage(); ?>   "Paging" starts at 1... No errors.... yet... And it works... How much better do you need? :-P
  19. Re: Changing Whole Header when in hospital I didn't copy and paste yours... i just grabbed alabama's code.
  20. Re: Changing Whole Header when in hospital Incorrect Killah.. You may see that Alabama Doesn't use * So if you want Jail And Hosp aswell try:   <?php /*--------------------------------- -- MCCodes 2.0 -- By Dabomstew ---------------------------------*/ session_start(); ob_start(); if(get_magic_quotes_gpc() == 0) { die("Fatal error: MCCode cannot function without MagicQuotes GPC being turned on in PHP.INI."); } require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.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; $hospital_check = sprintf("SELECT hospital, jail FROM users WHERE userid = %u",($userid)); $check = mysql_query($hospital_check); $hc = mysql_fetch_array($check); if($hc['hospital'] != 0) { require "hospheader.php"; } if($hc['jail'] != 0) { require "jailheader.php"; } else { require "header.php"; }
  21. Re: Profile picture in header   CORRECT!
  22. Re: [mccode v2] Events Page Updated.   Why you say I won't read the manual to find out? I like to learn new stuff and actually I do read manuals because that how I learnt the majority of what I know, sometimes with a little bit of input from someone else, but overall I do use the manual to read and learn new stuff, maybe I won't understand it fully but this is why I joined CE, to learn new stuff. But I see why you said that because most people on here don't read manuals but others do aswell.
  23. Re: [mccode V2] Ajax Shoutbox. [$12.00] Use an icon? -.- Arguing over something pathetic.
  24. Re: wont run? Run It Manually :wink:
  25. Re: [mccode v2] Events Page Updated.   <?php require_once (DIRNAME(__FILE__) . '/globals.php'); if( isset($_POST['del_all']) ) { mysql_query("DELETE FROM `events` WHERE `evUSER` = ".$ir['userid']) or die(mysql_error()); echo 'All events have been deleted.'; } if( isset($_GET['del']) ) { $id = abs(@intval($_GET['del'])); mysql_query("DELETE FROM `events` WHERE `evID` = ".$id." AND `evUSER` = ".$ir['userid']); echo 'Event deleted.'; } if( isset($_POST['checkbox']) ) { for($i = 0; $i < count($_POST['checkbox']); $i++) { mysql_query("DELETE FROM `events` WHERE `evID` IN(".$_POST['checkbox'][$i].") AND `evUSER` = ".$ir['userid']); $result = 1; } if($result == 1) { echo $i.' event(s) have been deleted.'; } else { echo 'Error occured while trying to delete the event(s).'; } } //Create Page Number's. $limit = 10; $page = abs(@intval($_GET['page'])); $page = isset($page) ? $_GET['page'] : 1; $by = 'evTIME'; $order = 'DESC'; $rows = mysql_query("SELECT `evID` FROM `events` WHERE `evUSER` = ".$ir['userid']); $rows = mysql_num_rows($rows); $pages = abs(@intval($rows / $limit)); if($rows % $limit == 0) { $pages--; } $pg = 'Pages: - '; echo '<h2>Events</h2> [b]Note:[/b] If you click on the check box and go to next page. The checkbox will be cleared. So delete the event\'s you want to delete before going to next page. <form action="'.$_SERVER['PHP_SELF'].'" method="post"> '.$pg; for($i = 1; $i <= $pages; $i++) { $next = ($i * $limit); echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$next.'"]'.$i.'[/url] - '; } echo ' <table border="1" cellspacing="0" cellpadding="0" class="table" width="80%"> <tr> <th>Time</th> <th>Event</th> <th>Links</th> </tr>'; $myEvents = mysql_query("SELECT `evTIME`, `evREAD`, `evTEXT`, `evID` FROM `events` WHERE `evUSER` = ".$ir['userid']." ORDER BY ".$by." ".$order." LIMIT ".$page.",".$limit); while($soc = mysql_fetch_assoc($myEvents)) { $time = date('F j Y, g:i:s a', $soc['evTIME']); if(!$soc['evREAD']) { $new = ' [b]New![/b]'; } echo ' <tr> <td>'.$time.' '.isset($new).'</td> <td>'.$soc['evTEXT'].'</td> <td> <input type="checkbox" name="checkbox[]" value="'.$soc['evID'].'"> | '; if( isset($_GET['page']) ) { echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$_GET['page'].'&del='.$soc['evID'].'"]Delete[/url]'; } else { echo '[url="'.$_SERVER['PHP_SELF'].'?del='.$soc['evID'].'"]Delete[/url]'; } echo ' </td> </tr> <tr>'; } echo ' </tr> </table> '.$pg; for($i = 1; $i <= $pages; $i++) { $next = ($i * $limit); echo '[url="'.$_SERVER['PHP_SELF'].'?page='.$next.'"]'.$i.'[/url] - '; } echo ' <input type="submit" value="Delete Selected Events"> <input name="del_all" id="del_all" type="button" value="Delete All Events"> </form>'; if( isset($ir['new_events']) > 0) { mysql_query("UPDATE `events` SET `evREAD` = 1 WHERE `evUSER` = ".$ir['userid']); mysql_query("UPDATE `users` SET `new_events` = 0 WHERE `userid` = ".$ir['userid']); } $h->endpage(); ?>   Page Bug Fixed.
×
×
  • Create New...