-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: Businesses Mod [Mccode V2] Dont you just love those that complain. Any mod that deals with cash on large basis which im sure this one does is bound to have a few snags. So it would be a decent gesture to explain the problem rather than making it a public spectacle....
-
Re: Stop people from using IE on website If your going to this lengh to stop IE users viewing your page. I suppose i could stop FF users viewing mine as i dont use FF. But overall FF and IE are not that hard to implement so they are viewed by either browser.
-
Re: New MainMenu Nice mod but my only concern is with the menu being so wide wouldnt hat making the vewing area smaller Another possible method would be to implement an Ajax Menu where by it retracts to the left when not in use and when you hover over it then it would become visible Thus making the whole game area screen wider,
-
Re: New MainMenu Invest in a Program Called snagit 7 lets you take area screen shots and keeps them clear.
-
[MCCODES V2+V1] Easiest Editing System you will ever need...
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2+V1] Easiest Editing System you will ever need... This is a blank Version use it for what ever ya want $query='SELECT * FROM items'; // Alter for your table name $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='0' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'>Item Id</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Type</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Name</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Desc</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Pic</font></th> </tr>"; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'itmid'); $f2=mysql_result($result,$i,'itmtype'); $f3=mysql_result($result,$i,'itmname'); $f4=mysql_result($result,$i,'itmdesc'); $f5=mysql_result($result,$i,'itmpic'); // Add as many as these as you want print"<tr> <td><font face='Arial, Helvetica, sans-serif'>$f1;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f2;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f3;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f4;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f5;</font></td> </tr>"; $i++; } print ""; } If your adding more dont forget to change the bolder part to the next number IE $f6 $f7 and so on <td><font face='Arial, Helvetica, sans-serif'>$f5;</font></td> -
[MCCODES V2+V1] Easiest Editing System you will ever need...
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2+V1] Easiest Editing System you will ever need... Same as above but this ones for the staff_users.php function edit_user_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } $query='SELECT * FROM users'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='0' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'>User Id</font></th> <th><font face='Arial, Helvetica, sans-serif'>User Name</font></th> <th><font face='Arial, Helvetica, sans-serif'>Login Name</font></th> <th><font face='Arial, Helvetica, sans-serif'>Last Ip</font></th> </tr> "; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'userid'); $f2=mysql_result($result,$i,'username'); $f3=mysql_result($result,$i,'login_name'); $f4=mysql_result($result,$i,'lastip_login'); print"<tr> <td><form action='staff_users.php?action=edituserform' method='post'> <input type='hidden' name='user' value='$f1;' /> <input type='submit' value='Edit This User' /></form></td> <font face='Arial, Helvetica, sans-serif'>[url='staff_users.php?action=edituserform'][/url]</font></td> <td><font face='Arial, Helvetica, sans-serif'>[b]$f2;[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f3;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f4;</font></td> </tr>"; $i++; } print ""; } -
This may come in handy for those that have Masses of items in their game.. I was chatting with Richard and decided that the normal Dropdown for editing items or item types was a pain. Well unless you had a good head for number.... so here goes lol open up staff_items.php function edit_item_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $query='SELECT * FROM items'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='0' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'>Item Id</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Type</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Name</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Desc</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Pic</font></th> </tr>"; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'itmid'); $f2=mysql_result($result,$i,'itmtype'); $f3=mysql_result($result,$i,'itmname'); $f4=mysql_result($result,$i,'itmdesc'); $f5=mysql_result($result,$i,'itmpic'); print"<tr> <td><form action='staff_items.php?action=edititemform' method='post'> <input type='text' name='item' value='$f1;' /> <input type='submit' value='Edit By ID' /></form> <font face='Arial, Helvetica, sans-serif'>[url='staff_items.php?action=edititemform'][/url]</font></td> <td><form action='staff_items.php?action=edititemform' method='post'> <input type='text' name='item' value='$f2;' /> <input type='submit' value='Edit By Type' /></form> <font face='Arial, Helvetica, sans-serif'>[url='staff_items.php?action=edititemform'][/url]</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f3;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f4;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f5;</font></td> </tr>"; $i++; } print ""; } function edit_item_form() { And place that where your Edit would usually be... Screenie
-
[mccode] Instant Messenger for Your Game! [$50.00]
Uridium replied to Poldar's topic in Paid Modifications
Re: [mccode] Instant Messenger for Your Game! [$50.00] Im not one to judge people or scripts So what happens after 12 months is up do you just vanish ? As it was mentioned there are TONS of php messenger scripts out thjere that will do the exact same as yours PHP121 have a totally free version that would surpass your messenger. Youve probably coded something great but im not sure that these forus are the place to be selling it. -
Re: NO DONATION.. to Get your game to install on a subfolder openup installer.php and find if($pvf+$wvf+$dvf+$avf < 4) change it to if($pvf+$wvf+$dvf < 3) Ignore the failed message and just click NEXT to start installing
-
Re: Filter Badwords! FREE! Dont think im trying to put your script off Crazy but with so many variations of different swear words and the ingenious replacements for them wouldnt this script take quite a few words for just one word......? Example B A S T A R D B4ST4RD B4574RD B.A.S.T.A.R.D theres 4 just for one word and could really even account for more.
-
[mccode v2] Freeze & Reactivate a Users Bank Account
Uridium replied to Uridium's topic in Free Modifications
Re: [mccode v2] Freeze & Reactivate a Users Bank Account Just to fix the Error of the SQl not updating Open up staff_users.php FIND. $db->query("UPDATE users SET username='{$_POST['username']}', level={$_POST['level']}, money={$_POST['money']}, crystals={$_POST['crystals']}, energy=$energy, brave=$nerve, maxbrave=$nerve, maxenergy=$energy, hp=$hp, maxhp=$hp, hospital={$_POST['hospital']}, jail={$_POST['jail']}, duties='{$_POST['duties']}', staffnotes='{$_POST['staffnotes']}', mailban={$_POST['mailban']}, mb_reason='{$_POST['mb_reason']}', forumban={$_POST['forumban']}, fb_reason='{$_POST['fb_reason']}', hospreason='{$_POST['hospreason']}', jail_reason='{$_POST['jail_reason']}', login_name='{$_POST['login_name']}', will=$will, maxwill=$maxwill WHERE userid={$_POST['userid']}"); And Replace with.... $db->query("UPDATE users SET username='{$_POST['username']}', level={$_POST['level']}, money={$_POST['money']}, crystals={$_POST['crystals']}, frozen={$_POST['frozen']},energy=$energy, brave=$nerve, maxbrave=$nerve, maxenergy=$energy, hp=$hp, maxhp=$hp, hospital={$_POST['hospital']}, jail={$_POST['jail']}, duties='{$_POST['duties']}', staffnotes='{$_POST['staffnotes']}', mailban={$_POST['mailban']}, mb_reason='{$_POST['mb_reason']}', forumban={$_POST['forumban']}, fb_reason='{$_POST['fb_reason']}', hospreason='{$_POST['hospreason']}', jail_reason='{$_POST['jail_reason']}', login_name='{$_POST['login_name']}', will=$will, maxwill=$maxwill WHERE userid={$_POST['userid']}"); Your Frozen Accounts shoul now be updated... ALSO in the imadd.php and itmsell.php Overwrite what i had before which was if($ir['frozen']>0) { die(" <h1>Sorry you cannot Add or Sell Items whilst your Account is Frozen</h1>"); } with this one if($ir['frozen']>0) { echo '<script>alert("Your Bank Account Has Been Frozen you cannot sell items.");</script>'; echo '<script>history.back(1);</script>'; exit; } -
[mccode v2] Enhanced Hall of fame COMPLETED!
Uridium replied to Haunted Dawg's topic in Free Modifications
Re: [mccode v2] Enhanced Hall of fame COMPLETED! Most of the time colours dont show due to the way the CSS is laid out on your header.php so on header instead of using a colour for text try using Transparent -
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/
-
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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. -
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,,,,
-
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
-
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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 -
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] Reset password + Secret question before password is sent. well if ya edit it and make it better dont forget to share :) -
Re: [Mccodes V2] Easter Egg Events Dont worry i havent forgotten about this mod just fixing some bugs
-
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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.. -
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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 -
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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. -
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
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 -
mccode-v2 Reset password + Secret question before password is sent.
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] Reset password + Secret question before password is sent. good thinking :) i'll do it so both questions have to match -
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.....