-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: [mccode v2] Index.php Update Im just grateful that people have the time to post Mods. Although i hate people that say i can do better and you never get to see what theyve actually achieved now that really annoys me lol One thing ive learnt from this Forum is.. No matter what you achieve even from a simple script theres always a dictator in the background lol
-
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals Mail me a link to your game plz -
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals When you start a course for the first time that counts as 1 click it will renew when your cron has expired to display the click here function again... -
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals Yep had to dig them out ;) SQLS ALTER TABLE `courses` ADD `crCRYSTALS` INT( 11 ) NOT NULL DEFAULT '0' , ALTER TABLE `courses` ADD `crCLICKS` INT( 11 ) NOT NULL DEFAULT '0' ; and ALTER TABLE `users` ADD `cclicks` INT( 11 ) NOT NULL DEFAULT '0' , ALTER TABLE `users` ADD `taken` INT( 11 ) NOT NULL DEFAULT '0' ; WHATS IT DO ? When you create a course you can EITHER Create a Course to Accept Crystals as payment or money.. Create a Course to Accept days or number of clicks before course is complete... or add all 4 together to Accept all options... Its up to your what you add your cron as either hourly or every 30 mins... Courses will be complete in the same way as normal.... EXCEPT The clicks option must be physically taken and will only be updated whilst a user is online to take them.. No need to alter any of your exsisting courses they will work with ths addition... -
ALWAYS BACKUP YOUR OLD COPIES BEFORE INSTALLING THIS MOD Files to backup are as follows. staff_courses.php education.php Call this file staff_courses.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains course stuffs switch($_GET['action']) { case "addcourse": addcourse(); break; case "editcourse": editcourse(); break; case "delcourse": delcourse(); break; default: print "Error: This script requires an action."; break; } function addcourse() { global $db, $ir, $c, $h, $userid; $cost=abs((int) $_POST['cost']); $crystals=abs((int) $_POST['crystals']); $energy=abs((int) $_POST['energy']); $days=abs((int) $_POST['days']); $clicks=abs((int) $_POST['clicks']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); if($_POST['name'] && $_POST['desc'] ) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '$cost', '$crystals', '$energy', '$days', '$clicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added."; stafflog_add("Added course {$_POST['name']}"); } else { print "<h3>Add Course</h3><hr /> <form action='staff_courses.php?action=addcourse' method='post'> Name : <input type='text' name='name' value=''/> Description : <input type='text' name='desc' value=''/> Cost (Money) : <input type='text' name='cost' value='0'/> Cost (Energy) : <input type='text' name='energy' value='0'/> Length (Days) : <input type='text' name='days' value='0'/> Cost (Crystals) : <input type='text' name='crystals' value='0'/> Length (Clicks) : <input type='text' name='clicks' value='0'/> Strength Gain : <input type='text' name='str' value='0'/> Agility Gain : <input type='text' name='agil' value='0'/> Guard Gain : <input type='text' name='gua' value='0'/> Labour Gain : <input type='text' name='lab' value='0'/> IQ Gain : <input type='text' name='iq' value='0'/> <input type='submit' value='Add Course' style='border:1px solid #3366CC; font-family:Arial; font-size:14pt; letter-spacing:1; color:#3366CC; background-color:#FFFFFF' style='font-family: Arial; font-size: 10pt; letter-spacing: 1; color: #3366CC; border: 3px solid #dedede; background-color: #FFFFFF'/></form>"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $days=abs((int) $_POST['days']); $clicks=abs((int) $_POST['clicks']); $crystals=abs((int) $_POST['crystals']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE courses SET crNAME='$name', crDESC='{$_POST['desc']}', crCOST=$cost, crENERGY=$energy, crCRYSTALS=$crystals, crDAYS=$days, crCLICKS=$clicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "Course $name was edited successfully. [url='staff_courses.php']<h2>Return to Courses page</h2>[/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> Name: <input type='text' name='name' value='{$old['crNAME']}' /> Description: <input type='text' name='desc' value='{$old['crDESC']}' /> Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> Cost (Crystals): <input type='text' name='crystals' value='{$old['crCRYSTALS']}' /> Length (Days): <input type='text' name='days' value='{$old['crDAYS']}' /> Length (Clicks): <input type='text' name='clicks' value='{$old['crCLICKS']}' /> Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> <input type='submit' value='Edit Course' /></form>"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form> [url='staff_courses.php']<h2>Return to Courses page</h2>[/url]"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cclicks=0, cdays=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM courses WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted."; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_courses.php']<h2>Return to Courses page</h2>[/url]"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_courses.php']<h2>Return to Courses page</h2>[/url]"; } $h->endpage(); ?> Call this file education.php <?php include "globals.php"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); print " You are currently doing the <h1>{$coud['crNAME']}</h1> course, you have <h1>{$ir['cdays']}</h1> DAYS remaining."; } else { if($_GET['cstart']) { $_GET['cstart'] = abs((int) $_GET['cstart']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['cstart']}"); if($db->num_rows($cd) == 0) { print "You are trying to start a non-existant course!"; } else { $coud=$db->fetch_row($cd); $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid={$_GET['cstart']}"); if($ir['money'] < $coud['crCOST']) { print " <h1>You don't have enough money to start this course.</h1> [url='education.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } if($ir['crystals'] < $coud['crCRYSTALS']) { print " <h1>You don't have enough Crystals to start this course.</h1> [url='education.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print " <h1>You have already done this course.</h1> [url='education.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['cstart']},cdays={$coud['crDAYS']},cclicks={$coud['crCLICKS']},money=money-{$coud['crCOST']},crystals=crystals-{$coud['crCRYSTALS']} WHERE userid=$userid"); print " You have started the <h2>{$coud['crNAME']}</h2> course, it will take <h2>{$coud['crCLICKS']}</h2> CLICKS or <h2>({$coud['crDAYS']})</h2> DAYS to complete."; } } else { //list courses print " <h1>Here is a list of available courses.</h1>"; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table' border-color='#dedede'><tr style='background:gray;'><th>Course</th><th> Description</th><th> Cost</th><th> Crystals</th><th> Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='education.php?cstart={$r[']Take[/url]"; } print " <tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td> {$r['crCRYSTALS']}</td><td> $do</td></tr>"; } print "</table>"; } } $h->endpage(); exit; print "<h3>Slave Traders Academy</h3>"; $cn=$db->query("SELECT taken FROM users WHERE userid=$userid"); $taken=$db->fetch_row($cn); if($taken['taken'] > 0) { die(" Your clicks have not been Renewed yet.. <h1> Sorry come back later</h1> Clicks Remaining,,,<h1>{$ir['cclicks']}</h1>"); } { if($ir['cclicks'] > 0) $ce=$db->query("SELECT cclicks='{$happy['cclicks']}' FROM users WHERE userid=$userid"); $happy=$db->fetch_row($ce); $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET cclicks=cclicks-1 WHERE userid=$userid"); $db->query("UPDATE users SET taken=1 WHERE userid=$userid"); print " You currently have <h1>{$ir['cclicks']}</h1> CLICKS Left before this Tutition has completed. [url='education.php']<h3>Take This Tuition</h3>[/url]"; $h->endpage(); exit; } $h->endpage(); ?> call this file school_cron.php << This is to reset the clicks data <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } 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; $db->query("UPDATE users SET taken=0 WHERE course > 0"); $q=$db->query("SELECT * FROM users WHERE cclicks=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cclicks=0"); ?> PART 2 SQLS...
-
Re: [mccode v2] Itempedia Yep unfortunatley there are people like that.. more robust name for them is SAD ;)
-
[mccode V2} Web Templates Converted
Uridium replied to shaved92bravada's topic in General Discussion
Re: [mccode V2} Web Templates Converted Personally i have to agree with Killah on this one.. I like the layout theres probably things on there that people have wanted on a template for ages.. -
[Mccodes V2] improved schooling works off clicks not days
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes V2] improved schooling works off clicks not days not really ive used the old SQl so you just add the updated tables and the updated staff_courses then just fill in the parts that are missing you can still keep your exsisting Courses... -
[Mccodes V2] improved schooling works off clicks not days
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes V2] improved schooling works off clicks not days Finally completed.. Added some more features. now includes.. from admin Creating a course,,, 1 course type 2 choose payment type for course (cash or crystals) 3 Item Multiplier Effect 4 Armor Multiplier Effect 5 Energy cost for schooling level 6 Ammend Course 7 Delete Course,,, 8 Upgrade Course. 9 Entwine a Course ( has the same affect of combining 2 or more courses ) 10 View users Currently taking Courses. 11 Course points available in game (on/off) allows users to exchange Crystals for extra turns... 12 Auto Complete Course. (Allows staff to Auto Complete a Course) Users Section 1 choose payment type for course (cash or crystals) 2 shows percentage of course completed + number of clicks currently taken. 3 Stop a course...( No refund ) 4 cost of energy to take the course.. Course completion Depending on what youve set the multiplier for items they will gain extra stats for that user.. Will post working copy later today..... -
Re: [mccode v2] Shop Picture now your just confusing the poor lad
-
Re: [mccode v2] Shop Picture oh my god how crazy is that being commented for a simple html... Even ths staff are getting pathetic time for a change of scenery i think....
-
Re: [V2] Shop Picture shouldnt <td>{$r['shopPIC']}</td> be <td></td>
-
Re: [mccode v2] House Images KEV Either you want help or we can send messages back and forth on here all day just create a test account for me on your site. and pm me the details
-
Re: [mccode v2] House Images right click on the blank image and goto Properties does it give the correct folder for the houses to go into
-
Re: [mccode v2] House Images send me your game link and i'll have a look
-
Re: [mccode v2] PJIRC Chat Mod Sounds like youve got an over excited Anti Virus programe some AV's are a pain in a way that they detect even a safe file and say its a virus...
-
[mccode v2] Themecreator 100% Completed Working Copy
Uridium replied to Uridium's topic in Free Modifications
Re: [mccode v2] Themecreator 100% Completed Working Copy remember when adding a ID and the theme DATA they need to be the same value you dont need to add 1.css to the theme DATA just add 1... -
Re: [mccode V2] Item Descryption. My old 32explore page used the same hing whereby if you hover over a link it would give the image Pic... however i did lose that when my host closed i may have it burried somewhere on the pc though will dig it out..
-
Re: [mccodes v2] Profile Image Uploader That usually means your using the same instances in 2 files that are calling for the same thing.. Would need to know which files your setting the sessions for
-
Needed... v2 forums sql queries for the db
Uridium replied to ajgraves's topic in General Discussion
Re: Needed... v2 forums sql queries for the db Just give him the SQLS dabomstew cant be that bothered about this project or otherwise he would have secured it enough so people coulnt steal it and use it on other sites.... or he would have used PHPSHIELD to protect it.. -
Re: [mccode V2] Item Descryption. Very nice :) +1
-
[Mccodes V2] improved schooling works off clicks not days
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes V2] improved schooling works off clicks not days I may have taken on more than i can chew with this one. it wont beat me however the problems im having are.. 1 = if a session is started after a previous session then they both are renewed after an hour.. Example course 1 started at 1:34 and course 2 started at 1:59 soon as 2:34 is up both sessions are renewed.. but the 1:59 shouldnt be available until 2:59. I dont want to use different types of cron sessions for each so how would i get round this... -
[Mccodes V2] improved schooling works off clicks not days
Uridium replied to Uridium's topic in Free Modifications
Re: [Mccodes V2] improved schooling works off clicks not days yep the idea came from RV i cant deny that :)