Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,701
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by Uridium

  1. Re: [Mccodes V2] Easter Egg Events   This just the basis of the holiday even creator where by you can change your seasonal event to do what ever you want. its merely a sript to keep your members happy for a few days over the holidays its up to you what you want it to do and how its run. Example The streets.php offers a player between 25-50 searches a day finding items going to hosp or jail. You can include the $ functions from the holiday creator so members can find eggs for easter or presents for xmas although they dont gain anything from finding these items it just adds a bit of fun to your games/
  2. Re: [MCCODES V2] Reset password + Secret question before password is sent. Update for Preferences.php Open up preferences.php find..   case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break;   Underneath Add..   case 'questionchange2': do_squestion_change(); break; case 'questionchange': squestion_change(); break;   Still in prefs find   $db->query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid"); print "Password changed!"; } }   Underneath add   function squestion_change() { print "<h3>Secret Question Change</h3> <form action='preferences.php?action=questionchange2' method='post'>Current Secret Question: <input type='Secret Question' name='oldsquestion' /> New Secret Question: <input type='text' name='newsquestion' /> Confirm: <input type='text' name='newsquestion2' /> <input type='submit' value='Change Secret Question' /></form>"; } function do_squestion_change() { global $db,$ir,$c,$userid,$h; if(($_POST['oldsquestion']) != $ir['squestion']) { echo '<script>alert("The question we have on our database for you doesnt match the one youve given");</script>'; echo '<script>history.back(1);</script>'; exit; } else if($_POST['newsquestion'] !== $_POST['newsquestion2']) { echo '<script>alert("Sorry neither of the new Questions you entered Matched try again");</script>'; echo '<script>history.back(1);</script>'; exit; } if ($_POST['newsquestion'] == '') { echo '<script>alert("You Must Enter a New Secret Question dont leave the field blank");</script>'; echo '<script>history.back(1);</script>'; exit; } if ($_POST['newsquestion2'] == '') { echo '<script>alert("You cannot leave the Confirmt field blank");</script>'; echo '<script>history.back(1);</script>'; exit; } else { $db->query("UPDATE users SET squestion='{$_POST['newsquestion']}' WHERE userid=$userid"); echo '<script>alert("Success New Secret Question has been Updated Thank You");</script>'; echo '<script>history.back(1);</script>'; exit; } }   Finally Add   [url='preferences.php?action=questionchange']Change Secret Question[/url]   With the rest of the links in preferences.
  3. Re: [Mccodes V2] Easter Egg Events Holiday Creator call this file holiday_creator.php   <?php include "sglobals.php"; //This contains Holiday layouts //Illusions 2009 switch($_GET['action']) { case 'createholiday_event': create_holiday_event(); break; case 'createholiday_eventsub': create_holiday_event_sub(); break; case 'editholiday_event': edit_holiday_event(); break; case 'editholiday_eventform': edit_holiday_event_form(); break; case 'editholiday_eventsub': edit_holiday_event_sub(); break; case 'deleteholiday_event': delete_holiday_event(); break; default: print "Error: This script requires an action."; break; } function htmlspcl($in) { return str_replace("'", "'", htmlspecialchars($in)); } function create_holiday_event() { global $db,$ir, $c; if($ir['user_level'] != 2) { die("Access Denied"); } print "Create New Holiday holiday_event. <table width='75%' class='table' cellspacing='1'> <form action='holiday_creator.php?action=createholiday_eventsub' method='post'> <tr> <th colspan='2'><h2>Holiday Event System Setup </h2></th> </tr> <tr> <td align='center'>holiday event ID Number Keeps Note of ID's added</td> <td><input type='text' name='holiday_event_id' value='' /></td> </tr> <tr> <td align='center'>Holiday Event Name Give your holiday event a name</td> <td><input type='text' name='holiday_event_name' value='Easter' /></td> </tr> <tr> <td align='center'>Holiday Event Description Brief Description about this Holiday Event.</td> <td><textarea rows='6' cols='40' name='holiday_event_description'></textarea></td> </tr> <tr> <td align='center'>Page Linking Which Page are you linking this event to example attack.php If no Event page is required call it index.php </td> <td><input type='text' name='holiday_event_page' value='attack.php' /></td> </tr> <tr> <td align='center'>Page Action ? Does the page above require an Action if so use the action specified by the page Example ?ID=\$r['userid'] If the page doesnt require an action just leave the field blank</td> <td><input type='text' name='holiday_event_action' value='?ID=\$ir[userid]' /></td> </tr> <tr> <td align='center'>Message for Winning Events Enter the message for a winning event</td> <td><input type='text' name='holiday_winning_message_1' value='Congratulations you found a' /></td> </tr> <tr> <td align='center'>Message for Failed Events Enter the message for a Failed event</td> <td><input type='text' name='holiday_failed_message_1' value='Sorry Unlucky this time' /></td> </tr> <tr> <td align='center'>Prize name for Event 1 </td> <td><input type='text' name='holiday_event_message_1' value='golden_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 2 </td> <td><input type='text' name='holiday_event_message_2' value='chicken_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 3 </td> <td><input type='text' name='holiday_event_message_3' value='chocolate_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 4 </td> <td><input type='text' name='holiday_event_message_4' value='ruby_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 5 </td> <td><input type='text' name='holiday_event_message_5' value='spectrum_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 6 </td> <td><input type='text' name='holiday_event_message_6' value='spotted_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 7 </td> <td><input type='text' name='holiday_event_message_7' value='flowered_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 8 </td> <td><input type='text' name='holiday_event_message_8' value='royal_egg_blue' /></td> </tr> <tr> <td align='center'>Prize name for Event 9 </td> <td><input type='text' name='holiday_event_message_9' value='royal_egg_red' /></td> </tr> <tr> <td align='center'>Prize name for Event 10 </td> <td><input type='text' name='holiday_event_message_10' value='flambouyant_egg' /></td> </tr> <tr> <td colspan='2' align='center'><input type='submit' value='Create New Holiday' /></td> </tr> </table></form></center>"; } function create_holiday_event_sub() { global $db,$ir,$c,$userid; if($ir['user_level'] != 2) { die("Access Denied"); } if(!isset($_POST['holiday_event_id']) || !isset($_POST['holiday_event_name'])) { print "You missed one or more of the required fields. Please go back and try again. [url='holiday_creator.php?action=createholiday_event']> Back[/url]"; $h->endpage(); exit; } $Get = $db->query(sprintf("SELECT `holiday_event_id` FROM `holiday_event_settings` WHERE `holiday_event_id`='%s'", addslashes($_POST['holiday_event_id']))); if($db->num_rows($Get)) { print "<h1>Sorry ID {$_POST['holiday_event_id']} is already In Use.</h1><h1>DO YOU WANT TO</h1> [url='holiday_creator.php?action=createholiday_event']1 Try Include another Holiday[/url] [url='holiday_creator.php?action=editholiday_event']2 Edit An Existing Holiday[/url] [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"; exit; } $db->query("INSERT INTO holiday_event_settings VALUES('{$_POST['holiday_event_id']}', '{$_POST['holiday_event_name']}', '{$_POST['holiday_event_description']}', '{$_POST['holiday_event_page']}', '{$_POST['holiday_event_action']}', '{$_POST['holiday_winning_message_1']}','{$_POST['holiday_failed_message_1']}', '{$_POST['holiday_event_message_1']}', '{$_POST['holiday_event_message_2']}', '{$_POST['holiday_event_message_3']}', '{$_POST['holiday_event_message_4']}', '{$_POST['holiday_event_message_5']}', '{$_POST['holiday_event_message_6']}', '{$_POST['holiday_event_message_7']}', '{$_POST['holiday_event_message_8']}', '{$_POST['holiday_event_message_9']}', '{$_POST['holiday_event_message_10']}')"); $i=mysql_insert_id($c); print "<h1>{$_POST['holiday_event_name']}</h1> Was Successfully Created <h1>DO YOU WANT TO</h1> <a href='holiday_creator.php?action=createholiday_eventsub'>1 Create Another Holiday <a href='holiday_creator.php?action=editholiday_event'>2 Edit An Exsisting Holiday [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"; stafflog_add("Created new Holiday {$_POST['holiday_event_name']} [$i]"); } function edit_holiday_event() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("Access Denied"); } print "<h3>Editing Holiday</h3> You can edit any aspect of this Holiday. <form action='holiday_creator.php?action=editholiday_eventform' method='post'> Holiday: ".holiday_dropdown($c,'holiday_event_id')." <input type='submit' value='Edit Holiday' /></form> OR enter a Holiday ID to edit: <form action='holiday_creator.php?action=editholiday_eventform' method='post'> Holiday: <input type='text' name='holiday_event_id' value='0' /> <input type='submit' value='Edit Holiday' /></form>"; } function edit_holiday_event_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("Access Denied"); } $d=$db->query("SELECT * FROM holiday_event_settings WHERE holiday_event_id={$_POST['holiday_event_id']}"); $holi=$db->fetch_row($d); print "<h3>Editing Holiday</h3> <table width='75%' class='table' cellspacing='1'> <form action='holiday_creator.php?action=editholiday_eventsub' method='post'> <tr> <th colspan='2'><h2>Holiday Event System Setup </h2></th> </tr> <tr> <td align='center'>holiday event ID Number Your Editing ID {$holi['holiday_event_id']}</td> <td><input type='hidden' name='holiday_event_id' value='{$holi['holiday_event_id']}' /></td> </tr> <tr> <td align='center'>Holiday Event Name Give your holiday event a name</td> <td><input type='text' name='holiday_event_name' value='{$holi['holiday_event_name']}' /></td> </tr> <tr> <td align='center'>Holiday Event Description Brief Description about this Holiday Event.</td> <td><textarea rows='6' cols='40' name='holiday_event_description'>{$holi['holiday_event_description']}</textarea></td> </tr> <tr> <td align='center'>Page Linking Which Page are you linking this event to example attack.php If no Event page is required call it index.php </td> <td><input type='text' name='holiday_event_page' value='{$holi['holiday_event_page']}' /></td> </tr> <tr> <td align='center'>Page Action ? Does the page above require an Action if so use the action specified by the page Example ?ID=\$r['userid'] If the page doesnt require an action just leave the field blank</td> <td><input type='text' name='holiday_event_action' value='{$holi['holiday_event_action']}' /></td> </tr> <tr> <td align='center'>Message for Winning Events Enter the message for a winning event</td> <td><textarea rows='6' cols='40' name='holiday_winning_message_1'>{$holi['holiday_winning_message_1']}</textarea></td> </tr> <tr> <td align='center'>Message for Failed Events Enter the message for a Failed event</td> <td><textarea rows='6' cols='40' name='holiday_failed_message_1'>{$holi['holiday_failed_message_1']}</textarea></td> </tr> <tr> <td align='center'>Prize name for Event 1 </td> <td><input type='text' name='holiday_event_message_1' value='{$holi['holiday_event_message_1']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 2 </td> <td><input type='text' name='holiday_event_message_2' value='{$holi['holiday_event_message_2']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 3 </td> <td><input type='text' name='holiday_event_message_3' value='{$holi['holiday_event_message_3']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 4 </td> <td><input type='text' name='holiday_event_message_4' value='{$holi['holiday_event_message_4']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 5 </td> <td><input type='text' name='holiday_event_message_5' value='{$holi['holiday_event_message_5']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 6 </td> <td><input type='text' name='holiday_event_message_6' value='{$holi['holiday_event_message_6']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 7 </td> <td><input type='text' name='holiday_event_message_7' value='{$holi['holiday_event_message_7']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 8 </td> <td><input type='text' name='holiday_event_message_8' value='{$holi['holiday_event_message_8']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 9 </td> <td><input type='text' name='holiday_event_message_9' value='{$holi['holiday_event_message_9']}' /></td> </tr> <tr> <td align='center'>Prize name for Event 10 </td> <td><input type='text' name='holiday_event_message_10' value='{$holi['holiday_event_message_10']}' /></td> </tr> <tr> <td colspan='2' align='center'><input type='submit' value='Edit This Holiday' /></td> </tr> </table></form></center>"; } function edit_holiday_event_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("Access Denied"); } $db->query("UPDATE `holiday_event_settings` SET 'holiday_event_name' = '{$_POST['holiday_event_name']}', 'holiday_event_description' = '{$_POST['holiday_event_description']}', 'holiday_event_page' = '{$_POST['holiday_event_page']}', 'holiday_event_action' = '{$_POST['holiday_event_action']}', 'holiday_winning_message_1' = '{$_POST['holiday_winning_message_1']}', 'holiday_failed_message_1' = '{$_POST['holiday_failed_message_1']}', 'holiday_event_message_1' = '{$_POST['holiday_event_message_1']}', 'holiday_event_message_2' = '{$_POST['holiday_event_message_2']}', 'holiday_event_message_3' = '{$_POST['holiday_event_message_3']}', 'holiday_event_message_4' = '{$_POST['holiday_event_message_4']}', 'holiday_event_message_5' = '{$_POST['holiday_event_message_5']}', 'holiday_event_message_6' = '{$_POST['holiday_event_message_6']}', 'holiday_event_message_7' = '{$_POST['holiday_event_message_7']}', 'holiday_event_message_8' = '{$_POST['holiday_event_message_8']}', 'holiday_event_message_9' = '{$_POST['holiday_event_message_9']}', 'holiday_event_message_10' = '{$_POST['holiday_event_message_10']}' WHERE `holiday_event_id` = '{$_POST['holiday_event_id']}'"); stafflog_add("Edited Holiday {$_POST['holiday_event_name']} [{$_POST['holiday_event_id']}]"); print "<h1>Holiday {$_POST['holiday_event_name']} Updated</h1> <a href='holiday_creator.php?action=createholiday_eventsub'>1 Create Another Holiday <a href='holiday_creator.php?action=editholiday_event'>2 Edit An Exsisting Holiday [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"; } function delete_holiday_event() { global $ir,$c,$h,$userid,$db; if($ir['user_level'] != 2) { die("Access Denied"); } $undeletable = array('1'); // add more IDs here, such as NPCs switch ($_GET['step']) { default: echo "<h3>Deleting Holiday Event</h3> Here you can delete a Holiday. <form action='holiday_creator.php?action=deleteholiday_event&step=2' method='post'> Delete Holiday: ".holiday_dropdown($c,'holiday_event_id')." <input type='submit' value='Delete Holiday' /></form> OR enter a Holiday ID to Delete: <form action='holiday_creator.php?action=deleteholiday_event&step=2' method='post'> Delete Holiday: <input type='text' name='holiday_event_id' value='0' /> <input type='submit' value='Delete Holiday' /></form>"; break; case 2: $target = $_POST['holiday_event_id']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) //print" <a href='holiday_creator.php?action=createholiday_eventsub'>1 Create A New Holiday <a href='holiday_creator.php?action=editholiday_event'>2 Edit An Exsisting Holiday [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"; { die(' <h1>You cannot delete this Holiday its a Fixed Base Sorry try editing it.<h1>'); } $d=$db->query("SELECT holiday_event_id FROM holiday_event_settings WHERE holiday_event_id='$target'"); $holi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete Holiday ".$holi["holiday_event_id"]."? <form action='holiday_creator.php?action=deleteholiday_event&step=3' method='post'> <input type='hidden' name='holiday_event_id' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='holiday_creator.php?action=deleteholiday_event';\" /></form>"; break; case 3: $target = $_POST['holiday_event_id']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) { die('You cannot delete this Holiday.'); } if($_POST['yesorno']=='No') { die("<h1>Holiday {$holi['holiday_event_name']} has not been deleted.</h1> <a href='holiday_creator.php?action=createholiday_eventsub'>1 Create A New Holiday <a href='holiday_creator.php?action=editholiday_event'>2 Edit An Existing Holiday [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"); } if ($_POST['yesorno'] != ("No" || "Yes")) die('Eh'); $d=$db->query("SELECT holiday_event_id FROM holiday_event_settings WHERE holiday_event_id='$target'"); $holi=$db->fetch_row($d); $db->query("DELETE FROM holiday_event_settings WHERE holiday_event_id='$target'"); echo "<h1>Holiday {$holi['holiday_event_name']} Successfully Deleted.</h1> <a href='holiday_creator.php?action=createholiday_eventsub'>1 Create A New Holiday <a href='holiday_creator.php?action=editholiday_event'>2 Edit An Exsisting Holiday [url='holiday_creator.php?action=deleteholiday_event']3 Delete an existing Holiday[/url]"; stafflog_add("Deleted holiday_event {$holi['holiday_event_name']} [{$_POST['holiday_event_id']}]"); break; } } $h->endpage(); ?>   Now open up global_func.php and just after...   <?php function money_formatter($muny,$symb='$') { return $symb.number_format($muny); }   ADD THIS   function holiday_dropdown($connection,$ddname="holiday_event_id",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM holiday_event_settings ORDER BY holiday_event_name DESC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['holiday_event_id']}'"; if ($selected == $r['holiday_event_id'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['holiday_event_name']}</option>"; } $ret.="\n</select>"; return $ret; }   Now open up smenu.php and add   print "> [url='holiday_creator.php?action=createholiday_event']Create New Holiday Game[/url] > [url='holiday_creator.php?action=editholiday_event']Edit A Holiday[/url] > [url='holiday_creator.php?action=deleteholiday_event']Delete A Holiday[/url] ";   And your done This is just the Creator for the Holidays you will need to Alter your scripts if you want an event to take part,,,,
  4. Re: [Mccodes V2] Easter Egg Events INSTALLER FIRST SQLS ( DONT SEND DIRECTLY TO PHPMYADMIN JUST UPLOAD TO YOUR SITE AS holiday_event.sql )   CREATE TABLE IF NOT EXISTS `holiday_event_settings` ( `holiday_event_id` int(11) NOT NULL AUTO_INCREMENT, `holiday_event_name` varchar(255) NOT NULL, `holiday_event_description` varchar(255) NOT NULL, `holiday_event_page` varchar(255) NOT NULL, `holiday_event_action` varchar(255) NOT NULL, `holiday_winning_message_1` varchar(255) NOT NULL, `holiday_failed_message_1` varchar(255) NOT NULL, `holiday_event_message_1` varchar(255) NOT NULL, `holiday_event_message_2` varchar(255) NOT NULL, `holiday_event_message_3` varchar(255) NOT NULL, `holiday_event_message_4` varchar(255) NOT NULL, `holiday_event_message_5` varchar(255) NOT NULL, `holiday_event_message_6` varchar(255) NOT NULL, `holiday_event_message_7` varchar(255) NOT NULL, `holiday_event_message_8` varchar(255) NOT NULL, `holiday_event_message_9` varchar(255) NOT NULL, `holiday_event_message_10` varchar(255) NOT NULL, PRIMARY KEY (`holiday_event_id`) ) ENGINE=MyISAM ; ALTER TABLE `users` ADD `holiday_event_turns` INT( 11 ) NOT NULL; ALTER TABLE `users` ADD `holiday_event_wins` INT( 11 ) NOT NULL;   Call this file holiday_event.php   <?php session_start(); ob_start(); 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; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Illusions Installer</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 type="text/css"> <!-- body { background-color: #DEDEDE; margin-top: 0px; margin-bottom: 0px; font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; } .table2 { } .lgrad { background-image:url(lgrad.jpg); background-repeat:repeat-y; width:19px; } .linegrad { background-image:url(linegrad.PNG); background-repeat:repeat-y; background-align: center; width:2px; } .rgrad { background-image:url(rgrad.jpg); background-repeat:repeat-y; width:19px; } .dgrad { background-image:url(dgrad.jpg); background-repeat:repeat-x; height:38px; } .dgradl { background-image:url(dgradl.jpg); background-repeat:no-repeat; height:38px; width:38px; } .dgradr { background-image:url(dgradr.jpg); background-repeat:no-repeat; height:38px; width:38px; } .center { width:932px; background-color:#FFFFFF; vertical-align:top; text-align:center; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style></head> <body onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center">[img=title.jpg] <h2>Illusions 2009 Installer</h2> <?php switch($_GET['code']) { case "install": install(); break; case "config": config(); break; default: diagnostics(); break; } function menuprint($highlight) { $items=array( 'diag' => '1. Diagnostics', 'input' => '2. Configuration', 'sql' => '3. Installation & Extras', ); $c=0; print "<hr />"; foreach($items as $k => $v) { $c++; if($c > 1) { print " > "; } if($k==$highlight) { print "<font color='black'>{$v}</font>"; } else { print "<font color='gray'>{$v}</font>"; } } print "<hr />"; } function diagnostics() { menuprint("diag"); if (version_compare(phpversion(), '4.2.0') < 0) { $pv="<font color='red'>Failed</font>"; $pvf=0; } else { $pv="<font color='green'>OK</font>"; $pvf=1; } if(is_writable('./')) { $wv="<font color='green'>OK</font>"; $wvf=1; } else { $wv="<font color='red'>Failed</font>"; $wvf=0; } if(function_exists('mysql_connect') || function_exists('mysqli_connect')) { $dv="<font color='green'>OK</font>"; $dvf=1; } else { $dv="<font color='red'>Failed</font>"; $dvf=0; } if(str_replace('holiday_event.php','',$_SERVER['SCRIPT_NAME']) == "/") { $av="<font color='green'>OK</font>"; $avf=1; } else { $av="<font color='red'>Failed</font>"; $avf=0; } print "<h3>Basic Diagnostic Results:</h3> <table width='80%' class='table' cellspacing='1'> <tr> <td>PHP version >= 4.2.0</td> <td>{$pv}</td> </tr> <tr> <td>Game folder writable</td> <td>{$wv}</td> </tr> <tr> <td>MySQL support in PHP present</td> <td>{$dv}</td> </tr> <tr> <td>Game installed at root level of domain or subdomain</td> <td>{$av}</td> </tr> </table>"; if($pvf+$wvf+$dvf+$avf < 4) { print "<hr /><font color='red'>One of the basic diagnostics failed, so Setup cannot continue. Please fix the ones that failed and try again.</font><hr />"; } else { print "<hr />> [url='holiday_event.php?code=config']Next Step[/url]<hr />"; } } function config() { menuprint("input"); print "<h3>holiday_event_ System Setup:</h3> <center> <form action='holiday_event.php?code=install' method='post'> <table width='75%' class='table' cellspacing='1'> <tr> <th colspan='2'>Database Config</th> </tr> <tr> <td align='center'>MySQL Driver</td> <td><select name='driver' type='dropdown'>"; if(function_exists('mysql_connect')) { print "<option value='mysql'>MySQL Standard</option>"; } if(function_exists('mysqli_connect')) { print "<option value='mysql'>MySQLi Enhanced</option>"; } print "</select></td> </tr> <tr> <td align='center'>Hostname This is usually localhost</td> <td><input type='text' name='hostname' value='localhost' /></td> </tr> <tr> <td align='center'>Username The user must be able to use the database</td> <td><input type='text' name='username' value='' /></td> </tr> <tr> <td align='center'>Password</td> <td><input type='text' name='password' value='' /></td> </tr> <tr> <td align='center'>Database Name The database should not have any other software using it.</td> <td><input type='text' name='database' value='' /></td> </tr> <tr> <th colspan='2'><h2>Holiday Event System Setup </h2></th> </tr> <tr> <td align='center'>holiday event ID Number This will be set by default as 1</td> <td><input type='hidden' name='holiday_event_id' value='1' /></td> </tr> <tr> <td align='center'>Holiday Event Name Give your holiday event a name</td> <td><input type='text' name='holiday_event_name' value='Easter' /></td> </tr> <tr> <td align='center'>Holiday Event Description Brief Description about this Holiday Event.</td> <td><textarea rows='6' cols='40' name='holiday_event_description'></textarea></td> </tr> <tr> <td align='center'>Page Linking Which Page are you linking this event to example attack.php If no Event page is required call it index.php </td> <td><input type='text' name='holiday_event_page' value='attack.php' /></td> </tr> <tr> <td align='center'>Page Action ? Does the page above require an Action if so use the action specified by the page Example ?ID=\$r['userid'] If the page doesnt require an action just leave the field blank</td> <td><input type='text' name='holiday_event_action' value='?ID=\$ir[userid]' /></td> </tr> <tr> <td align='center'>Message for Winning Events Enter the message for a winning event</td> <td><input type='text' name='holiday_winning_message_1' value='Congratulations you found a' /></td> </tr> <tr> <td align='center'>Message for Failed Events Enter the message for a Failed event</td> <td><input type='text' name='holiday_failed_message_1' value='Sorry Unlucky this time' /></td> </tr> <tr> <td align='center'>Prize name for Event 1 </td> <td><input type='text' name='holiday_event_message_1' value='golden_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 2 </td> <td><input type='text' name='holiday_event_message_2' value='chicken_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 3 </td> <td><input type='text' name='holiday_event_message_3' value='chocolate_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 4 </td> <td><input type='text' name='holiday_event_message_4' value='ruby_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 5 </td> <td><input type='text' name='holiday_event_message_5' value='spectrum_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 6 </td> <td><input type='text' name='holiday_event_message_6' value='spotted_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 7 </td> <td><input type='text' name='holiday_event_message_7' value='flowered_egg' /></td> </tr> <tr> <td align='center'>Prize name for Event 8 </td> <td><input type='text' name='holiday_event_message_8' value='royal_egg_blue' /></td> </tr> <tr> <td align='center'>Prize name for Event 9 </td> <td><input type='text' name='holiday_event_message_9' value='royal_egg_red' /></td> </tr> <tr> <td align='center'>Prize name for Event 10 </td> <td><input type='text' name='holiday_event_message_10' value='flambouyant_egg' /></td> </tr> <tr> <td align='center'>Number of Turns Per Player Enter Number of Turns for each player Default is 10</td> <td><input type='text' name='holiday_event_turns' value='10' /></td> </tr> <tr> <td align='center'>Number of Wins for players Enter Number of Wins Needed before a player is Successful Default is 10</td> <td><input type='text' name='holiday_event_wins' value='10' /></td> </tr> <tr> <td colspan='2' align='center'><input type='submit' value='Install' /></td> </tr> </table></form></center>"; } function install() { menuprint("sql"); { print "<h2><font color=green>Config writing Bypassed.</h2></font> "; define('MONO_ON', 1); require "class/class_db_mysql.php"; $db=new database; $db->configure($_POST['hostname'], $_POST['username'], $_POST['password'], $_POST['database'], 0); $db->connect(); $c=$db->connection_id; print "<h2>Connection Successful.</h2> "; $fo=fopen("holiday_event.sql","r"); $query=""; $lines=explode("\n",fread($fo,1024768)); fclose($fo); foreach($lines as $line) { if(!(strpos($line,"--") === 0) && trim($line) != "") //check for commented lines or blankies { $query.=$line; if(!(strpos($line,";") === FALSE)) { $db->query($query); $query=""; } } } print "Main MySQL data was written. Now write Extra MySQL data. "; //$username=$_POST['a_username']; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; // START MAIN EVENTS FOR SQL BASE // $db->query("INSERT INTO holiday_event_settings VALUES( '{$_POST['holiday_event_id']}', '{$_POST['holiday_event_name']}', '{$_POST['holiday_event_description']}', '{$_POST['holiday_event_page']}', '{$_POST['holiday_event_action']}', '{$_POST['holiday_winning_message_1']}', '{$_POST['holiday_failed_message_1']}', '{$_POST['holiday_event_message_1']}', '{$_POST['holiday_event_message_2']}', '{$_POST['holiday_event_message_3']}', '{$_POST['holiday_event_message_4']}', '{$_POST['holiday_event_message_5']}', '{$_POST['holiday_event_message_6']}', '{$_POST['holiday_event_message_7']}', '{$_POST['holiday_event_message_8']}', '{$_POST['holiday_event_message_9']}', '{$_POST['holiday_event_message_10']}')"); // OK TIME TO ADD THE EXTRA USERS PART TO THE TABLE // $db->query("UPDATE users SET holiday_event_turns='{$_POST['holiday_event_turns']}'"); $db->query("UPDATE users SET holiday_event_wins='{$_POST['holiday_event_wins']}'"); $path=$_SERVER['HTTP_HOST']; print " <h2>[b]Holiday Event Installation Was Successful![/b]</h2><hr /> <center><h1><font color='green'>SETUP COMPLETE</h1></font></center> Goto your Admin Panel to ADD, DELETE, EDIT your s"; } } ?> </td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"> </td> <td class="dgrad"> </td> <td class="dgradr"> </td> </tr> </table> </td> </tr> </table> </body> </html>   Now goto your site and run the holiday_event.php remember the holiday_event.sql needs to be on your server PART 2 BELOW
  5. Re: [MCCODES V2] Reset password + Secret question before password is sent. Once ive done the part for preferences.php those that are already regd on the game can set a new Secret Question via settings For those that havent had hance to set a new secret question and cant access the login page will have to use other means IE mail to staff
  6. Re: [MCCODES V2] Reset password + Secret question before password is sent.   well if ya edit it and make it better dont forget to share :)
  7. Re: [Mccodes V2] Easter Egg Events Dont worry i havent forgotten about this mod just fixing some bugs
  8. Re: [MCCODES V2] Reset password + Secret question before password is sent. I suppose thats the beauty of CE forums whatever ive lost i can usually track down what ive posted on here..
  9. Re: [MCCODES V2] Reset password + Secret question before password is sent.   I dont have an old copy of it i lost quite a lot of files on a reformat so im back to the basic MCC V2 at moment
  10. Re: [MCCODES V2] Reset password + Secret question before password is sent. Open up register.php and find   else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again. >[url='register.php']Back[/url]"; }   Underneath add   else if($_POST['squestion'] != $_POST['csquestion']) { print "<h1>ERROR! The Questions Dont Match</h1> >[url='register.php']Back[/url]"; }   Same file Alter this line from   $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) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')");   To this one   $db->query("INSERT INTO users (username, login_name, userpass, squestion, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), '{$_POST['squestion']}', 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')");   Same File Again find   <tr> <td><div align='center'>Password:</div></td> <td><div align='center'> <input type='password' name='password' /> </div></td> </tr> <tr> <td><div align='center'>Confirm Password: </div></td> <td><div align='center'> <input type='password' name='cpassword' /> </div></td> </tr>   Underneath Add   <tr> <td><div align='center'>Secret Question</div></td> <td><div align='center'> <input type='text' name='squestion' /> </div></td> </tr> <tr> <td><div align='center'>Re-type Secret Question</div></td> <td><div align='center'> <input type='text' name='csquestion' /> </div></td> </tr>   And Thats it i havent added this to the preferences.php file yet but will do over time.
  11. Re: [MCCODES V2] Reset password + Secret question before password is sent. Okies here goes SQL   ALTER TABLE `users` ADD `squestion` VARCHAR( 255 ) NOT NULL ;   call this file resend.php   <? 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; $set=array(); $settq=$db->query("SELECT * FROM settings"); ?> <html> <style> body { background: #1E1E1E; color: #fff; font-size: 11px; font-family: Verdana; } td { color: #fff; font-size: 11px; font-family: Verdana; } #foot { color: #fff; font-size: 11px; font-family: Verdana; width: 808px; height: 24px; background: #1E1E1E; } a, a:visited { color: #D9C5C5; font-weight: bold; text-decoration: none; } a:hover, a:active { color: #fff; font-weight: bold; text-decoration: none; } #head { background: #1E1E1E url(title.jpg) no-repeat; width: 808px; height: 154px; font-size: 11px; font-family: Verdana; } #menu { background: #1E1E1E; width: 808px; height: 30px; font-size: 11px; font-family: Verdana; padding-top: 6px; padding-left: 16px; } #body { background: #1E1E1E; width: 580px; height: 500px; font-size: 11px; font-family: Verdana; padding-top: 10px; padding-left: 20px; } #body-right { background: #1E1E1E; width: 208px; height: 500px; font-size: 11px; font-family: Verdana; } input, select { font-size: 11px; } </style> </HEAD> <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <TABLE align=center width='808' BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD colspan='2' valign='top' id='head'> </TD> </TR> <TR> <TD colspan='2' valign='top' id='menu'> [url='login.php']Login[/url] | [url='register.php']Join the game[/url] | [url='resend.php']Lost pass?[/url] </TD> </TR> <TR> <TD valign='top' align='left' id='body'> <? if(isset($_POST['resend'])) { $email = mysql_real_escape_string($_POST["email"]); if ($email == '') { echo '<script>alert("Not sure what happened there did you actually give me an address to lookup ?");</script>'; echo '<script>history.back(1);</script>'; exit; } if((!strstr($email , "@")) || (!strstr($email , "."))) { echo '<script>alert("Sorry the Address type was not recognised.");</script>'; echo '<script>history.back(1);</script>'; exit; } $q = mysql_query("SELECT * FROM users WHERE email = '$email'") or die(mysql_error()); if(mysql_num_rows($q) > 0) { $q2 = mysql_fetch_assoc($q); $username = $q2[username]; //$pass = $q2[pass]; } else { echo '<script>alert("Sorry that Email Address was not found in our Database");</script>'; echo '<script>history.back(1);</script>'; exit; } function makePassword($len = 8) // << Change for greater lengh { $vowels = array('a', 'e', 'i', 'o', 'u'); //Bang in some Vowels cos we love em $confusing = array('I', 'l', '1', 'Z', '0'); //Confuse the array even more with some capitals $replacements = array('A', 'k', '3', 'U', '9'); //If not happy with Vowels or Confuse then add replacemnts for the happy chappy $choices = array(0 => rand(0, 1), 1 => rand(0, 1), 2 => rand(0, 2)); $parts = array(0 => '', 1 => '', 2 => ''); if ($choices[0]) $parts[0] = rand(1, rand(9,99)); if ($choices[1]) $parts[2] = rand(1, rand(9,99)); $len -= (strlen($parts[0]) + strlen($parts[2])); for ($i = 0; $i < $len; $i++) { if ($i % 2 == 0) $parts[1] .= chr(rand(97, 122)); else $parts[1] .= $vowels[array_rand($confusing)]; } if ($choices[2]) $parts[1] = ucfirst($parts[1]); if ($choices[2] == 2) $parts[1] = strrev($parts[1]); $r = $parts[0] . $parts[1] . $parts[2]; $r = str_replace($confusing, $replacements, $r); return $r; } $p = makePassword(8); // <<< Change value for lenght of password given $pass = md5($p); $squestion = mysql_real_escape_string($_POST["squestion"]); $q1 = mysql_query("SELECT * FROM users WHERE squestion = '$squestion'") or die(mysql_error()); if(mysql_num_rows($q1) < 0) { $q3 = mysql_fetch_assoc($q1); $username = $q3[username]; } if ($squestion == '') { echo '<script>alert("Please go back and check your Secret Question Again it doesnt seem to be the same as the one we have in our database");</script>'; echo '<script>history.back(1);</script>'; exit; } if ($squestion !== $question) $query = mysql_query( "UPDATE users SET userpass = '$pass' WHERE email = '$email' AND username = '$username'" ) or die(mysql_error()); $send = mail($email , "Password retrieval" , "You or someone using your mail has requested a password reset.\r\nYour data is:\r\nusernamename: $username\r\nPassword: $p\n\r\n\rYou can now login, thank you.", "FROM: [email][email protected][/email];"); if($query && $send) { echo ' <div class="info"> <center><h1>Success!!</h1></center> Your new password has been sent to the mail address you provided.</p> Once you get it, click [url="index.php"]here[/url] to login.</p> </div> '; } else { echo ' <div> Accept our apologies, we have encountered some problems.</p> ',$question.'</p> Your data is not lost, no need to worry. [b]<h2>Account Data Found For Username:<font color=lightgreen> '.$username.'</font>[/b]</h2>[b]<h2>New Password Changed To:<font color=yellow> '.$p.'</font>[/b]</h2> Your MD5 pass is <h2>'.$pass.'</h2></p> Try again later.</p> </div> '; } } else { ?> <div>[b]Re-New Password Request[/b]</div> We will Require your Email and Secret Password you used to Join the Game with.</p> <form method="post" action="resend.php"> Email: <input name="email" type="text" class="textBox"> Secret Question you gave when you signed up: <input name="squestion" type="text" class="textBox"> <input name="resend" type="submit" class="textBox" id="resend" value="Resend email"> </form> </p> After you enter your e-mail and Secret Question Correctly we will check if it exists in the database We will then send a Temporary Password to you. So you can Login to your Account You Can change this Password from the Settings Menu</div> <? } ?>   Part 2 to follow could put it here but incase i mess it up lol
  12. Re: [MCCODES V2] Reset password + Secret question before password is sent. good thinking :) i'll do it so both questions have to match
  13. I liked the idea of a Password Retrivel system on a game but it dawned on me that as players get to know one another and sometimes fall out they may give their email addy away to a friend quite harmlessley only to find with the Password Retrieval from old they could just Pissss people off by entering their Addy all the time to send out new passwords...... So whys this one better ? Well this one still uses the email system as before but on registration users Now have to enter a Secret question so they can retrieve passwords. Even if a user gets their email address correct and the Secret Question Wrong then No email will be sent to a user saying a password reset occured.. Both the email and the secret Question have to be exact.. Will post in a few moments when i get the files ive adjusted together.....
  14. Re: Battle ladder [Mccodes V2] Yep gotta agree the Editing of posts is a bit silly i would recommend 24 hours from posting the script so you can fine tune faults you find later... But to add my script again would just confuse anyone who hasnt read this post page and is just working from say page 2 or 3....
  15. Re: [Mccodes V2] Easter Egg Events screenie setup
  16. Re: [Mccodes V2] Easter Egg Events Ok i kinda went a bit mental i was sat here working out the sqls when i decided to alter it a bit and save me a lot of time doing a mod for every festivity of the year. So the updated version will let you name your festivity event example easter, christmas, blah, blah, blah. Pages can be linked to any page that you already have on your game. even if your pages require an action. I'll post up an image in about 5 mins so you get the idea. as always ive included an installer for easy installation.
  17. Thought id do an Easter Egg event seeing as its drawing near Very basic uses the Streets system. The cron will give each user 10 egg Tokens The player then searches the Basket with their 10 tokens to try dig out the 10 eggs Hidden in the basket some results are Red Herrings and others will reward the player with an egg after the 24 hour even the person with the most eggs collected will be rewarded with a desired item chosen by the game admin. Its about 75% complete just making a few improvements
  18. Re: [MCCODES V2]My First Mod (Flash Games)   pointless or not its here its free and its available for others giving someone Crappy feedback like that isnt going to inspire them to do better and be creative. The guy has seen an opportunity for a bit of free entertainment and shared it. All my mods are crap they dont give money they dont give crystals but they do give users entertainment. so im going to give him +1 just to piss you off ;)
  19. Re: V2 index.php The amount of files MCC could be cut down to half if people were to do things like you have just done. The attack uses 5 files and 4 are just wasted they could all be put into one script and you could save server space.. The files for staff could also be reduced to 2 files that being staff.php and smenu.php
  20. Re: V2 index.php Nice to see some people thinking out side the box :) Nice work gideon.... Can i just mention though thst you add the ability for those that are in hosp or jail not to be able to see the bank... Just add if($ir['jail'] or $ir['hospital']) { die("Your Bank cannot be accessed while in jail or hospital."); } Before your bank routine :) +1
  21. Re: Businesses Mod [Mccode V2]   Check your script for extra Quotation Marks " these should only be found on the script your using with PRINT" and "; in your explore .php if you find any that are not like the above example like here Business listings change to Business listings
  22. Re: [MCCODES V2] Updated Jail now lets users Offer rescue Price   What is your problem the above script is NOT yours and any edits from this script were not taken from yours. I dont steal from people on here and never have done. if yours is called rescue.php and mine is called rescue.php that is purely coincidental.
  23. Re: [MCCODES V2] Updated Jail now lets users Offer rescue Price Thanks for adding back this post MD
  24. Re: [Mccodes V2] Item Sell Update [Javascript!] Yet another Quality product from Iamwicked +1
  25. Re: Contact Staff Through Email Eternal can you explain what errors you fixed so the postee knows for future reference :)
×
×
  • Create New...