Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,667
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Uridium

  1. Seems that most game sites now are using radio stations to keep their members occupied Ive been coding one now for about 2 years yep its a long time. but anyway ive finished it and its been tested. Whats it do. Your members can request tracks, send personal messages to the online DJ, Compete when Competitons are being aired. Full 24/7 DJ Rota to tell Users whos Djing at any given time..   Admin section.. Create new Dj's any at level Admin, Senior DJ, Junior DJ, In Training. DJ's can build a Profile for users to view. Dj's Can Ban Tracks that a user selects even before its been selected... Admin can ban Dj's and delete accounts. They can also Chat with each other ( ** Still building this feature) DJs can Book and Unbook their slots easily and once done is also altered via the members Timetable Panel All shoutcast server and SAM setup protocols are available for your DJ's to easily setup their Broadcasters with the Admin center.. Entire system is MYSQL driven with some files that need CHmodding Easy Installation with setep by step guide. Requests and Timetables are viewable and useable from inside the game... $25 for full package ** Chat when finalised and tested will be given to those that have purchased this mod Free of charge....
  2. Uridium

    Error Reporting...

    Re: Error Reporting... That isnt in any of the scripts ive done i was reading up on it on google and it was suggested altering the php.ini error_reporting(E_ALL) Problem is on the godaddy SSH it isnt an easy task.
  3. Uridium

    Error Reporting...

    My server seems to be going mental and is reporting every small error even though it can be run correctly example... my $_SESSION always reports faults and $_GET is also reporting faults.. Notice: Undefined variable: page in /home/ml/public_html/DJcenter/dj/delete.php on line 9 I have one page with 50+ Error reports.. Does anyone know how to alter the php.ini on a Godaddy Virtual Server with their Java SSH.... Notice: Use of undefined constant name - assumed 'name' in /home/ml/public_html/DJcenter/dj/showtimetable.php on line 26 Notice: Use of undefined constant name - assumed 'name' in /home/ml/public_html/DJcenter/dj/showtimetable.php on line 26 Notice: Use of undefined constant name - assumed 'name' in /home/ml/public_html/DJcenter/dj/showtimetable.php on line 26 Notice: Use of undefined constant name - assumed 'name' in /home/ml/public_html/DJcenter/dj/showtimetable.php on line 26 Notice: Use of undefined constant name - assumed 'name' in /home/ml/public_html/DJcenter/dj/showtimetable.php on line 26   Yet the script works fine... im using Godaddys Virtual server just need to alter the php.ini from the SSH which isnt an easy task with Godaddy has anyone got any tips on how to do this.
  4. Re: [MCcode V2] attack.php recode   Im having a long earned break :) still browsing the forums though.
  5. Re: [MCcode V2] attack.php recode   Your right about my Tables though ;) lol they even confused the hell out of me and i made them lol OOOPS nearly forgot HAPPY NEW YEAR ALLLLLLLL ;)
  6. Re: [MCcode V2] attack.php recode Nice to see the Images available on the new version.. would have also been nice to see the stalemate option applied and some of the newer inclusions added from the forums for the attack...
  7. Re: Staff Functions!   I am actually working on a better smenu.php layout as we speak lol its a vertical css dropdown menu... makes it a whole lot better than the original one. I will prolly post it when I get done with it..   I've been thinking about that, place them in catagories then drop down the main bits from it. When i did the dragndrop mainmenu i made one for the smenu aswell just never got round to posting it...
  8. Re: [mccode v2] streets.php includes image + ability to fight NPCS   in your streets.php find the lines for hospital and jail $db->query("UPDATE users SET hospital=0 WHERE userid=$userid",$c); and $db->query("UPDATE users SET jail=0 WHERE userid=$userid",$c);   mine is set to 0 so i could test the script just change 0 to a time you want your members to be in hospital or jail
  9. Re: V2 mail staff from mainmenu   Thats okies :) we all started out the same way :) Nice script though +1 :)
  10. Re: V2 mail staff from mainmenu   sorry about the QUOTE i couldnt see the final part of the script just remember to add Extra Carriage returns before ending the coding :)
  11. Re: Have any mod ideas post here! if its ideas your after ;) 1 = get rid of all the stupid get rich quick ways. 2 = get rid of the ability for users to able to refill everything 3 = better installer so you can rename the game currency 4 = sort the attack.php page out for one that actually works 5 = add ability for NPCS to attack users aswell as users attacking NPCS 6 = Stop over ranked players being able to attack ver low ranked players ;) 7 = better table structures so the users table isnt so stressed 8 = finally fix all the sql injections and loop holes 9 = stop 12 year old kids buying mcc and posting crap on here ;)
  12. Re: [mccode v2] Farming Gangsters and Mobsters are very busy these days :) I suppose farming helps them think :)
  13. probably wont mean much to some people lol but ive decided to call it a day with MCC Only been here a short while and ive learnt a lot off here and have had some help from some great script writers. those being Zero-Affect, Killah and Radio-Active. I only made my scripts free too Annoy those that was selling them at the time.. But ive come to understand the hard work thats involved and the time theyve given to produce some great works.. Well anyway.. enough from me have Fun and I hope Everyone has a great Xmas and prosperous new year.. Illusions..
  14. Re: [mccode v2] Parse The Parcel - [Re-Programmed]   This mod doesnt just need to be used for Xmas by changing the text you can alter it to become useful at any time of the year.
  15. Re: [MCCodes V2] - Parse The Parcel - [Re-Programmed] Whey hey i will be glad to see this running smoothly ive had sleepless nights with this one.. I kinda bit off more than i could chew with this idea but did my best to make it a reality.. Its kind of annoying when you get an idea in your head one that wont go away so you think I KNOW i'll put it on a script which is easier said than done. The Theme Creator idea came when i was fed up of looking at the same screen layout day in day out. which im pleased to say with the help of KILLAH yet again ;) it was born and works great. You can see now why i never sell my scripts one coz even i dont trust em lol and two id be gutted if it didnt work when someone had paid their cash for it.. I have too seriously thank Killah and radio-Active for their enormous help with this silly idea of mine.. what you see today is just a script on a forum what you gain from it tomorrow is entirely up to you....
  16. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy]   Waiting on MSN for ya
  17. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy]     which LINK are you pressing when you get the error
  18. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] I'll leave you too it obviously you seem to know more about it than me lol oh and regards the updated staff_parcel that you say ISNT correct how about using it and finding out :)
  19. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Sorry for the delay had to test it first...... the sqls are the same with one extra. open inventory.php or items.php ADD   $d=$db->query("SELECT * FROM users WHERE parcel=1",$c); $parceli=$db->fetch_row($d); if ($db->num_rows($parcel) == 0) { //Just kill me im not worth the space this line takes up aye } else { if ($db->num_rows($parcel) == 1) print"<h1>Your in Posession of a Parcel Click <h3>[url='wrapper.php?parcel=unwrap'] << here >></h3>[/url]<h1> to remove a layer</h1> <hr />"; } $inv=$db->query("SELECT iv.*,i.*,it.* FROM parcelinventory iv LEFT JOIN items i ON iv.parcelinv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.parcelinv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print ""; }   Thanks to Radio-Active for this script :) Call this file wrapper.php   <?php include "globals.php"; if($ir['parcel'] = 0) { die("You Dont have A Parcel"); exit; } $d = $db->query("SELECT `parcelinv_id`,`parcelinv_itemid`,`parcelinv_userid`,`parcelinv_qty` FROM parcelinventory WHERE parcelinv_qty = 1" ); $parcel=$db->fetch_row($d); switch($_GET['parcel']) { case 'unwrap': unwrap(); break; case 'unwrapdo': unwrapdo(); break; case 'takeprize': takeprize(); break; default: print "Error: This script requires an action."; break; } function unwrap() { global $db,$ir,$c,$userid,$parcelid; if($ir['parcel'] = 0) { die("You Dont have A Parcel"); exit; } $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($ir['parcel'] > 0) { echo " Come back when you have something to unwrap"; die("403"); exit; } global $db,$ir,$c,$userid,$parcelid; $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($ir['parcel'] = 0) { echo " Come back when you have something to unwrap"; //$h->endpage(); exit; } elseif ($ir['parcel'] = 1) { echo "<h3>Remove a Layer of Wrapping</h3> <form action='wrapper.php?parcel=unwrapdo' method='post'> <input type='hidden' name='unwrap'/> <input type='submit' value='Unwrap Present' /> </form>"; } } function unwrapdo() { global $db,$ir,$c,$userid,$parcelid; $d = $db->query("SELECT `parcelid`,`parcelamount` FROM parcel" ); $select = $db->fetch_row($d); $bh = $db->query('SELECT `userid`,`username`,`parcel` FROM `users`'); $nh= $db->num_rows($bh); $nj= $db->fetch_row($bh); $nk = rand(1,$nh); if($select['parcelamount'] > 1) { $parcel = "You removed a layer"; $db->query("DELETE FROM parcelinventory WHERE parcelinv_userid=$userid",$c); $db->query(sprintf("UPDATE `parcel` SET parcelamount = parcelamount - %d", 1 )); $db->query(sprintf("UPDATE users SET parcel = 0 WHERE userid = %d", $userid) ); $db->query(sprintf("UPDATE users SET parcel = %d WHERE userid = %d", 0, $nk ) ); $parcel = "You removed a layer"; } if($ir['parcel'] == 0) { echo " You dont have a parcel in your posession"; //$h->endpage(); exit; } else { echo " ".$parcel." "; } } function takeprize() { global $db,$ir,$c,$userid,$parcelid; if($ir['parcel'] = 0) { echo " You dont have a parcel in your posession"; $h->endpage(); exit; } else { $parcel = "You removed the last layer of the parcel, congratulations. Choose your prize <form action='wrapper.php?parcel=takeprize' method='post'> Your user ID: <input type='text' name='user' value='0' /> Choose Prize: ".item_dropdown($c,'item')." <input type='hidden' name='qty' value='1' /> <input type='submit' value='Accept Your Prize' /> <h1>WARNING!</h1> Do not refresh this page or you will lose your prize. </form>"; } $db->query(sprintf("INSERT INTO inventory (inv_id,inv_itemid,inv_userid,inv_qty) VALUES (%d,%u,%u,%d)", '', (int)$_POST['item'], (int)$_POST['item'], 1 ) ); $db->query(sprintf("UPDATE parcelinventory SET parcelinv_qty=0 WHERE parcelinv_userid = %d ", $userid ) ); echo "<h1>Check your Inventory for your Prize</h1>"; event_add($_POST['user'],"You Received {$_POST['qty']} parcel ID {$_POST['item']} to user ID {$_POST['user']}",$c); stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['item']} to user ID {$_POST['user']}"); $db->query(sprintf("UPDATE parcelinventory SET parcelinv_qty=0 WHERE parcelinv_userid= %d", $userid) ); } $h->endpage(); ?>   RESTRUCTURED staff panel for parcels call this file staff_parcel.php   <?php include "sglobals.php"; //This contains parcel stuffs switch($_GET['action']) { case 'newparcel': new_parcel_form(); break; case 'newparcelub': new_parcel_submit(); break; case 'giveparcel': give_parcel_form(); break; case 'giveparcelub': give_parcel_submit(); break; case 'killparcel': kill_parcel_form(); break; case 'killparcelub': kill_parcel_submit(); break; case 'editparcel': edit_parcel_begin(); break; case 'editparcelform': edit_parcel_form(); break; case 'editparcelub': edit_parcel_sub(); break; case 'newparceltype': newparceltype(); break; case 'editparceltype': editparceltype(); break; case 'editparceltypeform': editparceltypeform(); break; case 'editparceltypesub': editparceltypesub(); break; case 'delparceltype': delparceltype(); break; case 'delparceltypesub': delparceltypesub(); break; case 'whosgotit': whosgotit(); break; default: print "Error: This script requires an action."; break; } function new_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an parcel to the game</h3><form action='staff_parcel.php?action=newparcelub' method='post'> parcel ID: <input type='text' name='parcelid' value='' /> parcel Name: <input type='text' name='parcelname' value='' /> parcel Desc.: <input type='text' name='parceldesc' value='' /> wrapper Amount: <input type='text' name='parcelamount' /> parcel Prize: ".item_dropdown($c,'parcelprize')." [b]parcel Pics[/b] If you cannot find an Image put default.jpg in the text area <input type='text' name='parcelpic' value='default.jpg' /><hr /> <input type='submit' value='Add parcel To Game' /></form>"; } function new_parcel_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=newparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was added to the game."; stafflog_add("Created parcel {$_POST['parcelname']}"); } function give_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving parcel To User</h3> <form action='staff_parcel.php?action=giveparcelub' method='post'> User: ".user_dropdown($c,'user')." parcel: ".parcelgift_dropdown($c,'parcelgift')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give parcel' /></form>"; } function give_parcel_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO parcelinventory VALUES('',{$_POST['parcelgift']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"); } function kill_parcel_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting parcel</h3> The parcel will be permanently removed from the game. <form action='staff_parcel.php?action=killparcelub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Kill parcel' /></form>"; } function kill_parcel_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcel']}"); print "The {$parceli['parcelname']} parcel was removed from the game."; stafflog_add("Deleted parcel {$parceli['parcelname']}"); } function edit_parcel_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing parcel</h3> You can edit any aspect of this parcel. <form action='staff_parcel.php?action=editparcelform' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel' /></form>"; } function edit_parcel_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); print "<h3>Editing parcel</h3> <form action='staff_parcel.php?action=editparcelub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> parcel Name: <input type='text' name='parcelname' value='{$parceli['parcelname']}' /> parcel Desc.: <input type='text' name='parceldesc' value='{$parceli['parceldesc']}' /> wrapper Amount: <input type='text' name='parcelamount' value='{$parceli['parcelamount']}' /> parcel Prize: ".item_dropdown($c,'parcelprize',$parceli['parcelprize'])." [b]parcel Pics[/b] <input type='text' name='parcelpic' value='{$parceli['parcelpic']}' /><hr /> <input type='submit' value='Edit parcel' /></form> <center>parcel Image Available [img=parcelpics/{$parceli[]"; } function edit_parcel_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=editparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcelid']}",$c); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was edited successfully."; stafflog_add("Edited parcel {$_POST['parcelname']}"); } function newparceltype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO parceltypes VALUES(NULL, '{$_POST['name']}')"); print "parcel Type {$_POST['name']} added."; stafflog_add("Added parcel type {$_POST['name']}"); } else { print "<h3>Add parcel Type</h3><hr /> <form action='staff_parcel.php?action=newparceltype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add parcel Type' /></form>"; } } function editparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypeform' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltypeid']}"); $parcelt=$db->fetch_row($d); print "<h3>Edit parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypesub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> Name: <input type='text' name='parcelname' value='{$parcelt['parcelname']}' /> <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM parceltype WHERE parcelid={$_POST['parceltypeid']}"); $db->query("INSERT INTO parceltype VALUES('{$_POST['parceltypeid']}', '{$_POST['parceltypename']}')"); print "The parceltype {$_POST['parceltypename']} has been edited."; stafflog_add("Edited parceltype {$_POST['parceltypename']}"); } function delparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=delparceltypesub' method='post'> Name: ".parceltype_dropdown($c,'parceltype')." <input type='submit' value='Remove parcel Type' /></form> "; } function delparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); $db->query("DELETE FROM parceltypes WHERE parcelid={$_POST['parcelid']}"); print "The parceltype {$parcelt['parceltypename']} has been removed from the game."; stafflog_add("Deleted parceltype {$parcelt['parceltypename']}"); } function mass_give_parcel() { global $db,$ir,$c; print "<h3>Giving parcel To All Users</h3> <form action='staff_parcel.php?action=massparcelgivesub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_parcel_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['parcel']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"All users were given an parcel {$_POST['parcel']}, Click [url='inventory.php']Here[/url] to check.",$c); print "parcel Sent To {$r['username']}</br>"; } print " <font color=blue>Mass parcel sending complete!</br></font>"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcel']} to all users"); } function whosgotit() { global $db,$ir,$c,$userid; $q=mysql_query("SELECT parcelinv_qty=1 FROM parcelinventory WHERE parcelinv_userid=$userid",$c); while($r=$db->fetch_row($q)) { // Oh look a space aye } global $db,$ir,$c, $userid; $d=$db->query("SELECT parcelinv_qty=1 FROM parcelinventory WHERE parcelinv_userid=$userid",$c); $parcel=$db->fetch_row($d); } if($ir['parcel'] = 0) { die(" <h2><font color=yellow>Nobody has the Parcel</h2>"); } if($ir['parcel'] = 1) { die(" <h2><font color=yellow>{$ir['username']} Has The Parcel at the moment</h2>"); } $h->endpage(); ?>   add the following to your users tabel ALTER TABLE users ADD parcel INT (11) DEFAULT '0' No Need For a Cronjob..
  20. Re: [mccode v2] Themecreator 100% Completed Working Copy   the top and bottom values are Numerical only the middle is charcters so 1 new theme loook 1
  21. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Dont worry I havent forgot about this Post im still on the case ;) Big thanks to Radio_Active though for his generous help on the project :) Im hoping to have the working copy and i mean WORKING copy posted later today.. Probably wont have as many functions as i did declare thats coz MCC's crap.. lol and im a crap coder :) Reason for edit FAT FINGERS...
  22. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Sorry about that guys it was finished up until the point i found a bug which is causing issues I have removed the ability to get a reward from the above script until i can find a cure for it.. But adding the script as it is now will not harm anything and will be easier for you when ive completed the wrapper.php file..
  23. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] IGNORE THE staff_parcel.php Above and use this one....   <?php include "sglobals.php"; //This contains parcel stuffs switch($_GET['action']) { case 'newparcel': new_parcel_form(); break; case 'newparcelub': new_parcel_submit(); break; case 'giveparcel': give_parcel_form(); break; case 'giveparcelub': give_parcel_submit(); break; case 'killparcel': kill_parcel_form(); break; case 'killparcelub': kill_parcel_submit(); break; case 'editparcel': edit_parcel_begin(); break; case 'editparcelform': edit_parcel_form(); break; case 'editparcelub': edit_parcel_sub(); break; case 'newparceltype': newparceltype(); break; case 'editparceltype': editparceltype(); break; case 'editparceltypeform': editparceltypeform(); break; case 'editparceltypesub': editparceltypesub(); break; case 'delparceltype': delparceltype(); break; case 'delparceltypesub': delparceltypesub(); break; default: print "Error: This script requires an action."; break; } function new_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an parcel to the game</h3><form action='staff_parcel.php?action=newparcelub' method='post'> parcel ID: <input type='text' name='parcelid' value='' /> parcel Name: <input type='text' name='parcelname' value='' /> parcel Desc.: <input type='text' name='parceldesc' value='' /> wrapper Amount: <input type='text' name='parcelamount' /> parcel Prize: ".item_dropdown($c,'parcelprize')." [b]parcel Pics[/b] If you cannot find an Image put default.jpg in the text area <input type='text' name='parcelpic' value='default.jpg' /><hr /> <input type='submit' value='Add parcel To Game' /></form>"; } function new_parcel_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=newparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was added to the game."; stafflog_add("Created parcel {$_POST['parcelname']}"); } function give_parcel_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving parcel To User</h3> <form action='staff_parcel.php?action=giveparcelub' method='post'> User: ".user_dropdown($c,'user')." parcel: ".parcelgift_dropdown($c,'parcelgift')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give parcel' /></form>"; } function give_parcel_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO parcelinventory VALUES('',{$_POST['parcelgift']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['parcelgift']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcelgift']} to user ID {$_POST['user']}"); } function kill_parcel_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting parcel</h3> The parcel will be permanently removed from the game. <form action='staff_parcel.php?action=killparcelub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Kill parcel' /></form>"; } function kill_parcel_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcel']}"); print "The {$parceli['parcelname']} parcel was removed from the game."; stafflog_add("Deleted parcel {$parceli['parcelname']}"); } function edit_parcel_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing parcel</h3> You can edit any aspect of this parcel. <form action='staff_parcel.php?action=editparcelform' method='post'> parcel: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel' /></form>"; } function edit_parcel_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parcel WHERE parcelid={$_POST['parcel']}"); $parceli=$db->fetch_row($d); print "<h3>Editing parcel</h3> <form action='staff_parcel.php?action=editparcelub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> parcel Name: <input type='text' name='parcelname' value='{$parceli['parcelname']}' /> parcel Desc.: <input type='text' name='parceldesc' value='{$parceli['parceldesc']}' /> wrapper Amount: <input type='text' name='parcelamount' value='{$parceli['parcelamount']}' /> parcel Prize: ".item_dropdown($c,'parcelprize',$parceli['parcelprize'])." [b]parcel Pics[/b] <input type='text' name='parcelpic' value='{$parceli['parcelpic']}' /><hr /> <input type='submit' value='Edit parcel' /></form> <center>parcel Image Available [img=parcelpics/{$parceli[]"; } function edit_parcel_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['parcelname']) || !isset($_POST['parceldesc'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_parcel.php?action=editparcel']> Back[/url]"; $h->endpage(); exit; } $parcelname=$db->escape($_POST['parcelname']); $parceldesc=$db->escape($_POST['parceldesc']); $parceltype=$db->escape($_POST['parceltype']); $parcelamount=$db->escape($_POST['parcelamount']); $parcelprize=$db->escape($_POST['parcelprize']); $parcelpic=$db->escape($_POST['parcelpic']); $db->query("DELETE FROM parcel WHERE parcelid={$_POST['parcelid']}",$c); $m=$db->query("INSERT INTO parcel VALUES('','{$_POST['parcelid']}','$parcelname','$parceldesc','{$_POST['parcelamount']}', '{$_POST['parcelpic']}','{$_POST['parcelprize']}')"); print "The {$_POST['parcelname']} parcel was edited successfully."; stafflog_add("Edited parcel {$_POST['parcelname']}"); } function newparceltype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO parceltypes VALUES(NULL, '{$_POST['name']}')"); print "parcel Type {$_POST['name']} added."; stafflog_add("Added parcel type {$_POST['name']}"); } else { print "<h3>Add parcel Type</h3><hr /> <form action='staff_parcel.php?action=newparceltype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add parcel Type' /></form>"; } } function editparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypeform' method='post'> Name: ".parcel_dropdown($c,'parcel')." <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltypeid']}"); $parcelt=$db->fetch_row($d); print "<h3>Edit parcel Type</h3><hr /> <form action='staff_parcel.php?action=editparceltypesub' method='post'> <input type='hidden' name='parcelid' value='{$_POST['parcel']}' /> Name: <input type='text' name='parcelname' value='{$parcelt['parcelname']}' /> <input type='submit' value='Edit parcel Type' /></form> "; } function editparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM parceltype WHERE parcelid={$_POST['parceltypeid']}"); $db->query("INSERT INTO parceltype VALUES('{$_POST['parceltypeid']}', '{$_POST['parceltypename']}')"); print "The parceltype {$_POST['parceltypename']} has been edited."; stafflog_add("Edited parceltype {$_POST['parceltypename']}"); } function delparceltype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove parcel Type</h3><hr /> <form action='staff_parcel.php?action=delparceltypesub' method='post'> Name: ".parceltype_dropdown($c,'parceltype')." <input type='submit' value='Remove parcel Type' /></form> "; } function delparceltypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM parceltypes WHERE parceltypeid={$_POST['parceltype']}"); $parcelt=$db->fetch_row($d); $db->query("DELETE FROM parceltypes WHERE parcelid={$_POST['parcelid']}"); print "The parceltype {$parcelt['parceltypename']} has been removed from the game."; stafflog_add("Deleted parceltype {$parcelt['parceltypename']}"); } function mass_give_parcel() { global $db,$ir,$c; print "<h3>Giving parcel To All Users</h3> <form action='staff_parcel.php?action=massparcelgivesub' method='post'> parcel: ".parcel_dropdown($c,'parcel')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_parcel_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['parcel']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"All users were given an parcel {$_POST['parcel']}, Click [url='inventory.php']Here[/url] to check.",$c); print "parcel Sent To {$r['username']}</br>"; } print " <font color=blue>Mass parcel sending complete!</br></font>"; stafflog_add("Gave {$_POST['qty']} of parcel ID {$_POST['parcel']} to all users"); } $h->endpage(); ?>   ALSO add this to global_func.php   function parceltype_dropdown($connection,$ddname="parceltype",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM parceltypes ORDER BY parceltypename ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['parceltypeid']}'"; if ($selected == $r['parceltypeid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['parceltypename']}</option>"; }
  24. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Ive got the drop down settings wrong will fix it and repost.
  25. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy]   Not as yet still working on the part to update user inventory with parcel gift.. also the Cron needs re-touching.. Just after i posted I found an error so erased the unworking parts from the wrapper.php
×
×
  • Create New...