-
Posts
2,667 -
Joined
-
Last visited
-
Days Won
75
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
[MCCODES V2] Fighting stats just cleaned up
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] Fighting stats just cleaned up Cheeers Badgril :) I was just trying to space it out abit as most people find spaced Scripting easier to read. But i dont think yours would quite work hun. Have a look at your script again and you'll see what i mean. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Add this to your hourly cron $db->query("UPDATE users SET clickend=0 where clickend > '0'"); $db->query("UPDATE users SET minus_clicks=0 where minus_clicks >'0'"); And this to your daily cron $db->query("UPDATE users SET course_clicks=18"); -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling ooops i made an error on the User sqls sorry i must have not been paying attention ALTER TABLE users ADD cpercent INT ( 11 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD course_clicks INT ( 11 ) NOT NULL DEFAULT 18; ALTER TABLE users ADD minus_clicks INT ( 11 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD clickend INT ( 11 ) NOT NULL DEFAULT 0; How the above Works cpercent is the whole percentage the user has to achieve course_clicks is the amount of daily clicks they are allowed per day minus_clicks is the amount of clicks per session before the come back in an hour message is displayed endclicks works with minus_clicks so users dont exceed their hourly allowance. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling SQLS for courses. including my setup CREATE TABLE IF NOT EXISTS `courses` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crSTARTING` text NOT NULL, `crCOMPLETED` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crCASHPRIZE` int(11) NOT NULL default '0', `crITEM` int(11) NOT NULL default '0', `crQTY` int(11) NOT NULL default '0', `crCOMPPERCENT` int(11) NOT NULL default '0', `crPERCENT` int(11) NOT NULL default '0', `crCLICKS` int(11) NOT NULL default '0', `crPERCLICKS` int(11) NOT NULL default '0', `crSTR` int(11) NOT NULL default '0', `crGUARD` int(11) NOT NULL default '0', `crLABOUR` int(11) NOT NULL default '0', `crAGIL` int(11) NOT NULL default '0', `crIQ` int(11) NOT NULL default '0', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- Dumping data for table `courses` -- INSERT INTO `courses` (`crID`, `crNAME`, `crDESC`, `crSTARTING`, `crCOMPLETED`, `crCOST`, `crENERGY`, `crCASHPRIZE`, `crITEM`, `crQTY`, `crCOMPPERCENT`, `crPERCENT`, `crCLICKS`, `crPERCLICKS`, `crSTR`, `crGUARD`, `crLABOUR`, `crAGIL`, `crIQ`) VALUES (1, 'Human Bodies', 'Now to find your Agility Boost', 'You start running and your master seems very impressed with you', '0', 10, 10, 2000, 1, 0, 300, 1, 18, 0, 10, 10, 10, 10, 10), (2, 'Herbology', 'Learn to Clense yourself Better', 'Your master throws you into a pit of lions its up to you how you survive this.', 'Your Master is so impressed with the Outcome he rewards you with.', 5, 5, 1000, 1, 0, 100, 3, 18, 0, 5, 5, 5, 5, 5), (3, 'test', 'Just testing', 'kill him', '"Weldone you have proved without a doubt you are a worthy fighter"', 1, 1, 0, 1, 1, 10000, 1, 18, 0, 1, 1, 1, 1, 1), (4, 'Harry Pothead', 'Time to kill bogeyed boy', 'You see Harry Pothead and start taking potshots with your air rifle', 'Congratulation the little sod is dead weldone', 1, 1, 1000, 1, 1, 100, 90, 18, 0, 1, 1, 1, 1, 1), (5, 'TESTING 123', 'STILL TESTING 123', ' CARRY ME HOME MOMMA', 'THATS THE WAY IT IS', 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1); USERS SQLS ALTER TABLE users ADD cpercent INT ( 11 ) NOT NULL DEFAULT 18; ALTER TABLE users ADD course_clicks INT ( 11 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD minus_clicks INT ( 11 ) NOT NULL DEFAULT 0; ALTER TABLE users ADD clickend INT ( 11 ) NOT NULL DEFAULT 0; -
open up index.php and add this code before the endpage statement $cd=$db->query("SELECT strength, agility, guard, labour, IQ FROM userstats Where userid={$ir['userid']}"); $fstats=$db->fetch_row($cd); echo '<h2>Fighting Stats</h2> <table border="1" width="100%" class="table" cellspacing="3" cellpadding="4"> <tr> <th>Strength</th> <th>Agility</th> <th>Guard</th> <th>Labour</th> <th>Total Stats</th> </tr> <tr>'; echo ' <td>'.$fstats['strength'].'</td> <td>'.$fstats['agility'].'</td> <td>'.$fstats['guard'].'</td> <td>'.$fstats['labour'].'</td> <td>'.($fstats['strength'] + $fstats['agility'] + $fstats['strength'] + $fstats['strength']).'</td> </tr> </table>';
-
mccode-v1 Stock Market. Working + Secured
Uridium replied to Haunted Dawg's topic in Free Modifications
Re: [mccode v2] Stock Market. Working + Secured HAUNTED just gets an Instant +1 without me even adding his script cos the Chances of it NOT working are very slim Great mod pal :) -
Re: [MCCODES ALL] IE8 Fix for visual Errors Ive seen this issue before cant quite remember how it was solved. i am sure though it was a header.php file problem.
-
Not sure if anyone noticed any glitches on their Internet Explorer 8 where by some things just didnt seem right. On mine it was mainly the CSS and Javascript it would act up at times... So heres a small fix.. for those using IE8 open up header.php Just under <? Add header('X-UA-Compatible: IE=EmulateIE7'); This should make IE8 Emulate IE7 which was fine for me. Reason for EDIT fat fingers
-
Re: [mccode V2] Search Islands Nice script :) However if you put your mind to this you could use it to yur advantage instead of a one off system that just finds whats available make an admin center to create pre defined finds.... example........ and this is just me thinking out-side the box yet again ;) LOCATION SETUP What will user find at chance 1 = What will user find at chance 2 = What will user find at chance 3 = What will user find at chance 4 = What will user find at chance 5 = What will user find at chance 6 = What will user find at chance 7 = What will user find at chance 8 = What will user find at chance 9 = What will user find at chance 10 = Then on your script you would only need 1 chance but rand it by 10
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Ooops sorry about that Inferno yes hes right the USERS should be cpercent Thanks matey :) -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling can you set me up an admin account on your game and PM me the details I wont Messwith anything other than the schooling. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling yeah that can be done also i didnt add hp or brave as my desicion was that people would just abuse the system for their own gains. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling in the admin panel when adding a new course you must specify an item from the list you want to use as a prize. i did test this about 20 times before i made it public and it worked every time. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Anyone using this mod! Can ya give me some feedback on its usuage, just really want to know if everythigs working and also if anyone had any further improvement ideas. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Cheers Cody :) reason i didnt add the links cos they come as standard on V2 which saved me a bit of time renaming them but thanks for pointing it out to other that may not have the links :) Yeah you can add the daily clicks to the cron_day i just like to create a file so i dont mes things up on the cron_day as its 24 hours before you realise you have a bug. :) -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling You will probably find some references in this script that seem weird example the table coursestarted never gets a mention in the script this is me being brain dead it will in future updates have a purpose but at the time i just wanted to finish it the script. so i thought id leave it in for now.... regards the $search You could probably do it the way you mentioned but i wanted to make sure it was right the first time round so i chose the harder method lol -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Im still doing the crons sorry for the delay but Sleep got the better of me and i woke up with one of my daughters lollipops stuck to the side of me face ;) You will need an hourly cron so i suupose you could do this yourself by adding this to cron_hour.php $db->query("UPDATE users SET minus_clicks=0 WHERE userid=$userid"); $db->query("UPDATE users SET clickend=0 WHERE userid=$userid"); call this school_cron.php for the daily updates <?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 course_clicks=18 WHERE course_clicks < 18"); ?> -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling call this file education.php <?php include "globals.php"; print "<h2>Schooling</h2>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); if($ir['course_clicks'] >= 1) { $db->query("UPDATE users SET cpercent=cpercent+1, course_clicks=course_clicks-1, minus_clicks=minus_clicks+1, clickend=clickend+1 WHERE userid=$userid"); } if(isset($_GET['begin_course'])) { if($ir['course_clicks'] <= 0) { echo '<h2>Your tutor says your doing an excellent job but come back in an hour</h2> you have completed <h2>'.($ir['cpercent']).'% </h2> So far on this module'; exit($h->endpage()); } } if(isset($_GET['begin_course'])) { if($ir['minus_clicks'] >= 3) { echo '<h2>You have used your 3 valid tuition trains come back in an hour</h2>'; exit($h->endpage()); } } if ($ir['cpercent'] >= $coud['crCOMPPERCENT']) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET money=money+'{$coud['crCASHPRIZE']}' WHERE `userid` = '$userid' "); item_add($ir['userid'], $coud['crITEM'], $coud['crQTY']); event_add($ir['userid']," you have completed the {$coud['crNAME']} module and your master says {$coud['crCOMPLETED']}!'",$c); $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); $db->query("UPDATE users SET `cpercent` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `clickend` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `course` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `minus_clicks` = '0' WHERE userid=$userid"); $db->query("UPDATE `coursesdone` SET `userid` = '{$userid}' WHERE `courseid` = '{$ir['course']}' "); print "[url='education.php?begin_course={$ir['] [ View your Gains ][/url] "; print "[url='education.php'][ Return to School ][/url] "; $q=$db->query("SELECT * FROM users WHERE cpercent=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"); } event_add($ir['userid']," you have completed the {$coud['crNAME']} module and gained $ev!'",$c); } exit; } echo ' <table border="1" width="100%" class="table" cellspacing="3" cellpadding="4"> <tr> <th>Course</th> <th>Cost</th> <th>Description</th> <th>Studying</th> <th>Take Lesson</th> <th>Percent</td> <th>Overall</td> <th>Clicks</td> </tr> <tr>'; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); { echo ' <td>'.$coud['crNAME'].'</td> <td>$'.$coud['crCOST'].'</td> <td>'.$coud['crDESC'].'</td> '; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); //if ($dn = mysql_num_rows($dt)) { echo ' <td>Yes</td> <td>Taking Lesson</td>'; } //else { echo ' <td><font color="green">'.($ir['cpercent']).'%</font></td> <td><a href=education.php?begin_course='.$coud['crID'].'>Study</a></td>'; } $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); echo ' <td>'.$ir['course_clicks'].'</td> </tr> <tr>'; } echo ' </tr> </table>'; if($ir['course_clicks'] <= 0) { echo ''; exit($h->endpage()); } // LEAVE BLANK } else { if($_GET['begin_course']) { $_GET['begin_course'] = abs((int) $_GET['begin_course']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['begin_course']}"); 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['begin_course']}"); if($ir['course_clicks'] > $coud['crCLICKS']) { print "You have used up your daily clicks come back tomorrow."; $h->endpage(); exit; } if($ir['minus_clicks'] > $coud['crPERCLICKS']) { print "You have used up your Session clicks come back in a hour."; $h->endpage(); exit; } if($ir['clickend'] > $ir['course_clicks']) { print "Stop trying to cheat."; $h->endpage(); exit; } if($ir['money'] < $coud['crCOST']) { print "You don't have enough money to start this course."; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print "You have already done this course."; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['begin_course']},cpercent={$coud['crPERCENT']},money=money-{$coud['crCOST']} WHERE userid=$userid"); print "You have started the {$coud['crNAME']}, {$coud['crSTARTING']} {$coud['crDESC']} [url='education.php?begin_course={$r[']CONTINUE[/url]"; } } else { //list courses print "Here is a list of available courses."; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Course</th><th>Description</th><th>Cost</th><th>% To Complete</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?begin_course={$r[']Take[/url]"; } print "<tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td>{$r['crCOMPPERCENT']}%</td><td>$do</td></tr>"; } print "</table>"; } } $h->endpage(); ?> Now open up mainmenu.php look for $mc=$ir['new_mail']; top of page and underneath that add $course=$ir['minus_clicks']; Now remove this link School Locate these lines print "[url='announcements.php']Announcements ({$ir['new_announcements']})[/url] "; } else { print "[url='announcements.php']Announcements (0)[/url] "; } And directly underneath add these if($course['minus_clicks'] < 3) { print "[url='education.php'][b]Continue Learning[/b][/url] "; } elseif ($course['minus_clicks'] = 0) { print "[url='education.php']Back To School[/b][/url] "; } Because this Doesnt need a cron to update the schooling you can either remove it from cron_day.php or just leave it... I'll post crons in a moment to update the clicks.. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling if your game already has the original schooling and users are still taking courses dont apply this script until they have all completed their schooling. ok SQLS CREATE TABLE IF NOT EXISTS `courses` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crSTARTING` text NOT NULL, `crCOMPLETED` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crCASHPRIZE` int(11) NOT NULL default '0', `crITEM` int(11) NOT NULL default '0', `crQTY` int(11) NOT NULL default '0', `crCOMPPERCENT` int(11) NOT NULL default '0', `crPERCENT` int(11) NOT NULL default '0', `crCLICKS` int(11) NOT NULL default '0', `crPERCLICKS` int(11) NOT NULL default '0', `crSTR` int(11) NOT NULL default '0', `crGUARD` int(11) NOT NULL default '0', `crLABOUR` int(11) NOT NULL default '0', `crAGIL` int(11) NOT NULL default '0', `crIQ` int(11) NOT NULL default '0', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; AND CREATE TABLE IF NOT EXISTS `coursestarted` ( `userid` int(11) NOT NULL default '0', `courseid` int(11) NOT NULL default '0', `percent` int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; And add these to your users table ALTER TABLE users ADD crpercent INT (11) NOT NULL default 0; ALTER TABLE users ADD course_clicks INT (11) NOT NULL default 18; ALTER TABLE users ADD minus_clicks INT (11) NOT NULL default 0; ALTER TABLE users ADD clickend INT (11) NOT NULL default 0; 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']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $energy=abs((int) $_POST['energy']); $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'] && $cost && $cashprize && $item && $qty) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$cashprize', '$item', '$qty', '$energy', '$comppercent', '$percent', '$clicks', '$perclicks', '$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'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <th>Course Name: <input type='text' name='name' /> </th> <th>Course Description: <input type='text' name='desc' /> </th> <th>Starting Text: <input type='text' name='starting' /> </th> <th>Completed Text: <input type='text' name='completed' /> </th> <th>Course Target Percent: <input type='text' name='compperent' /> example 100% - 10000% </th></tr> <th>Percent Gain: <input type='text' name='percent' /> Example 1 to 99999 </th> <th>Clicks Per Day: <input type='text' name='clicks' /> Example 18 </th> <th>Clicks Per Session: <input type='text' name='perclicks' /> Example 3 Per Session </th> <th>Cost (Money): <input type='text' name='cost' /> </th> <th>Cash Prize: <input type='text' name='cashprize' /> </th></tr> <th>Item Prize: <input type='text' name='item' /> Enter Inventory item ID </th> <th>Quantity: <input type='text' name='qty' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th> <th>Strength Gain: <input type='text' name='str' /> </th> <th>Agility Gain: <input type='text' name='agil' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' /> </th> <th>Labour Gain: <input type='text' name='lab' /> </th> <th>IQ Gain: <input type='text' name='iq' /> </th> <input type='submit' value='Add Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $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']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crITEM=$item, crQTY=$qty, crENERGY=$energy, crCOMPPERCENT=$comppercent, crPERCENT=$percent, crCLICKS=$clicks, crPERCLICKS=$perclicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "<h1>Course $name was edited successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/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'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> <th>Name: <input type='text' name='name' value='{$old['crNAME']}' /> </th> <th>Description: <input type='text' name='desc' value='{$old['crDESC']}' /> </th> <th>Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> </th> <th>Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> </th> <th>Course Target(percent): <input type='text' name='comppercent' value='{$old['crCOMPPERCENT']}' /> </th></tr> <th>Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> </th> <th>Clicks Per Day : <input type='text' name='clicks' value='{$old['crCLICKS']}' /> </th> <th>Clicks Per Session: <input type='text' name='perclicks' value='{$old['crPERCLICKS']}' /> </th> <th>Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> </th> <th>Cash Prize : <input type='text' name='cashprize' value='{$old['crCASHPRIZE']}' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> </th> <th>Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> </th> <th>IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> </th> <input type='submit' value='Edit Course' /></form></tr></table> [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; 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>"; 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, cpercent=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 /> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] <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?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/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_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> PART 2 BELOW -
Before i start i want to thank all those that have helped on this project. DAWG, TONKA, LITHIUM Ive made a few changes along the way from the previous one i posted so i'll throw up a few screenies for ya too look at whilst i get the script in order... THIS THREAD HAS BEEN UPDATED AND CAN BE FOUND HERE [mccode v2.x] [EDUCATION MOD] Totally Re-worked with many additional Options. [FINALLY COMPLETED CRONS AND SOME UPDATES]
-
Re: [MCCODES V2] New Schooling Advanced Ok i havent added the section that should Finish a course as my version just isnt working but the idea is when the Percent reaches that set by the set it should update and finish the course. FOOTNOTE This doesnt require a cron so the cron will need to be taken from cron_day.php and inserted into the education.php all mentions of cday should be called cpercent. minus_clicks SQL has no form at the moment but it should be that the admin sets the amount of clicks a user can use per session before they have to wait for they time out.. example 18 clicks are a daily total so the admin can set the minus clicks to say 3 so after 3 clicks they have to wait an hour to gain an extra 3 clicks.... Once the section has been completed for the Courses to update and finish that particular course i can start adding more features as promised.
-
Re: [MCCODES V2] New Schooling Advanced I'll post the whole thing for now which includes the admin section. for those that want to try remedy the problem.... SQLS CREATE TABLE IF NOT EXISTS `courses` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crSTARTING` text NOT NULL, `crCOMPLETED` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crPERCENT` int(11) NOT NULL default '0', `crSTR` int(11) NOT NULL default '0', `crGUARD` int(11) NOT NULL default '0', `crLABOUR` int(11) NOT NULL default '0', `crAGIL` int(11) NOT NULL default '0', `crIQ` int(11) NOT NULL default '0', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; And CREATE TABLE IF NOT EXISTS `coursestarted` ( `userid` int(11) NOT NULL default '0', `courseid` int(11) NOT NULL default '0', `percent` decimal(3,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; And ALTER TABLE users ADD course_clicks INT ( 11 ) default '18'; ALTER TABLE users ADD minus_clicks INT ( 11 ) default '0' ; ALTER TABLE users ADD cpercent INT (11 ) default '0'; call this 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']); $energy=abs((int) $_POST['energy']); $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'] && $cost) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}','$cost', '$energy', '$percent', '$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'> Course Name: <input type='text' name='name' /> Course Description: <input type='text' name='desc' /> Starting Text: <input type='text' name='starting' /> Completed Text: <input type='text' name='completed' /> Percent Gain: <input type='text' name='percent' /> Example 1.2 or 2.1 Cost (Money): <input type='text' name='cost' /> Cost (Energy): <input type='text' name='energy' /> Strength Gain: <input type='text' name='str' /> Agility Gain: <input type='text' name='agil' /> Guard Gain: <input type='text' name='gua' /> Labour Gain: <input type='text' name='lab' /> IQ Gain: <input type='text' name='iq' /> <input type='submit' value='Add Course' /></form>"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $percent=abs((int) $_POST['percent']); $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']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crENERGY=$energy, crPERCENT=$percent, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "Course $name was edited successfully."; 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']}' /> Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> 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>"; 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, cpercent=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>"; } } 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_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> And call this education.php <?php include "globals.php"; print "<h2>Schooling</h2>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); if($ir['course_clicks'] >= 1) { $db->query("UPDATE users SET cpercent=cpercent+1, course_clicks=course_clicks-1, minus_clicks=minus_clicks+1 WHERE userid=$userid"); } if(isset($_GET['begin_course'])) { if($ir['course_clicks'] <= 0) { echo '<h2>Your tutor says your doing an excellent job but come back in an hour</h2> you have completed <h2>'.($ir['cpercent']).'% </h2> So far on this module'; exit($h->endpage()); } } echo ' <table border="1" width="100%" class="table" cellspacing="3" cellpadding="4"> <tr> <th>Course</th> <th>Cost</th> <th>Description</th> <th>Studying</th> <th>Take Lesson</th> <th>Percent</td> <th>Overall</td> <th>Clicks</td> </tr> <tr>'; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); { echo ' <td>'.$coud['crNAME'].'</td> <td>$'.$coud['crCOST'].'</td> <td>'.$coud['crDESC'].'</td> '; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); //if ($dn = mysql_num_rows($dt)) { echo ' <td>Yes</td> <td>Taking Lesson</td>'; } //else { echo ' <td><font color="green">'.($ir['cpercent']).'%</font></td> <td><a href=education.php?begin_course='.$coud['crID'].'>Study</a></td>'; } $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); echo ' <td>'.$ir['course_clicks'].'</td> </tr> <tr>'; } echo ' </tr> </table>'; if($ir['course_clicks'] <= 0) { echo ''; exit($h->endpage()); } // LEAVE BLANK } else { if($_GET['begin_course']) { $_GET['begin_course'] = abs((int) $_GET['begin_course']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['begin_course']}"); 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['begin_course']}"); if($ir['money'] < $coud['crCOST']) { print "You don't have enough money to start this course."; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print "You have already done this course."; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['begin_course']},cpercent={$coud['crPERCENT']},money=money-{$coud['crCOST']} WHERE userid=$userid"); print "You have started the {$coud['crNAME']}, {$coud['crSTARTING']} "; } } else { //list courses print "Here is a list of available courses."; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Course</th><th>Description</th><th>Cost</th><th>Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursestarted WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='education.php?begin_course={$r[']Take[/url]"; } print "<tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td>$do</td></tr>"; } print "</table>"; } } $h->endpage(); ?>
-
Re: Fluid and Fixed problem Maybe this will help you <html> <head> <title>Example</title> <style type="text/css"> div.header { position: absolute; top: 15px; padding: 10px; height: 50px; width: 100%; border: 1px dashed orange; } div.left { padding: 10px; position: absolute; left: 15px; top: 100px; width: 200px; height: 500px; border: 1px dashed orange; } div.center { padding: 10px; position: absolute; top: 100px; left: 250px; height: 500px; width: 500px; border: 1px dashed orange; } div.right { padding: 10px; position: absolute; right: 15px; top: 100px; width: 200px; height: 500px; border: 1px dashed orange; } div.footer { padding: 10px; position: absolute; right: 15px; top: 660px; height: 50px; width: 100%; margin: 20px; padding: 10px; border: 1px dashed orange; } </style> </head> <body> <div class="header"> PLACE ALL YOUR CODING FOR THE HEADER HERE </div> <div class="left"> PLACE ALL YOUR CODING FOR THE LEFT HTML HERE </div> <div class="center"> PLACE ALL YOUR CENTERED SCREEN HTML HERE </div> <div class="right"> PLACE ALL YOUR RIGHT HTML HERE </div> <div class="footer"> PLACE ALL THE FOOTER HTML HERE </div> </body> </html> demo http://www.freewebs.com/nightdreamer2000/divider.html One of my very firsts hosts lol ah bless em they were crap but did me well lol
-
Re: [MCCODES V2] New Schooling Advanced Ok time to say im having a few problems I cant get the stupid thing to update the SQLS when a course has reached 100% it just wants to carry on doing the course even though its exceeded 100%.
-
Re: [MCCODES V2] New Schooling Advanced Quick update im about 90% done on this now still some silly fiddley bits to add. That are driving me mental if i see another ELSE error im going to stab Dabomstew in the nose ;)