-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
I know this might sound daft but are you sure your looking at schooling.php and not education.php when you click the link to start an education from mainmenu... ? -
<tr><td><input type="submit" value="No!" onmouseclick="document.location.href=\''.index.php.'" /></td></tr> Im still uncertain if this would work as by looking at it how can the form decipher which is yes and which is no ? My argument would be that if this script was put on your site both links would challenge the doit so both would point to Yes
-
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
Thats impossible as the table courses hasnt been used Look again all INSERTS, UPDATES DELETE, Statements point to the table SCHOOL -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
SCREENIES STAFF CHEAT SCREEN CHEAT OUTCOME CHOOSING A COURSE TO STUDY TAKING THE COURSE COURSE OUTCOME WHEN FINISHED SORRY FOR THE IMAGES NOT SHOWING SEEMS MY TEST SITE HAS GONE WALK ABOUTS :( STAFF EDITING COURSES -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
For the daily cron to work ive had to redo schooling.php and edureset.php so if you have an older copy then get the updated one from posting on 1st page.. More SQLS sorry this was the only way i could make the Daily Crons match the clicks for each Education made.... [mysql]CREATE TABLE IF NOT EXISTS `schoolday` ( `userid` int(11) NOT NULL default '0', `courseid` int(11) NOT NULL default '0', `clicks` int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/mysql] And finally the Cron... <?php include "config.php"; /*/////////////////////////////////////////////////////// THIS IS TO MAKE SURE USERS GET THE CORRECT AMOUNT OF CLICKS FOR THE SCHOOLING THEY ARE TAKING//////*/ //////////////////////////////////////////////////////// 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; $cd=$db->query("SELECT userid, courseid, clicks FROM schoolday"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET course_clicks={$coud['clicks']}, dailycclicks=0 WHERE userid={$coud['userid']}"); Print" <font color='cyan'>clicks reset to {$coud['clicks']} for this user</font>"; print"<body bgcolor='000000'><center><h1><font color='yellow'>UPDATING DAILY CLICKS NO ERRORS FOUND</h1></font></center>"; ?> -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
Heres the cron for Hourly Updates for user clicks <?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 minus_clicks=0, clickend=0"); print"<body bgcolor='000000'><center><h1><font color='yellow'>CLICKEND AND MINUS CLICKS RESET</font></h1> <h2><font color='lightgreen'>TEST WAS SUCCESSFULLY ACTIONED</font></center>"; ?> Still working on the daily one as its a bit more complex than i thought :) this is due to courses having different click rates than others -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
If anyone is able to help me out who has installed his mod on their site and dont mind giving me access to their FTP/CPANEL so i can sort the crons out i would be very greatful as for some reason my testing site has decided to stop running crons... Email me on here pls if your abale to assist... HELP FOUND ( Big thanks to DJKANNA for helping out ) Cheers Matey. -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
Thanks rowbvp for spotting that error the SQLS ablve for line 24 have been ammended :) -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
Still working on the crons to update users clicks for hour and daily clicks cos my silly site dont have crons running.. -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
now add this CSS bit to your header.php or if your using an external css add it in with that... div.grey_info{ border:1px #999999 solid; width:80%; margin: auto; background:#a1a1a1 } div.outcome_info{ border:1px #ffffff solid; width:80%; margin: auto; background:#D1D1D1 } Still in the header.php change the link education.php to schooling.php or create both links one hidden for testing.. -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
PART 2.. Call this file edureset.php Its for the Staff testing section... <?PHP include "globals.php"; switch($_GET['action']) { case 'course_clicks': course_clicks(); break; case 'minus_clicks': minus_clicks(); break; case 'clickend': clickend(); break; case 'dailyclicks': dailyclicks(); break; case 'resetall': resetall(); break; case 'minusclickend': resetall(); break; case 'retire': retire(); break; default: prefs_home(); break; } function prefs_home() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } print "<h2>Education Staff Cheat Page</h2> [url='?action=course_clicks']<h2>RESET COURSE CLICKS TO 18</h2> [/url] [url='?action=minus_clicks']<h2>RESEST MINUS CLICKS TO ZERO</h2>[/url] [url='?action=clickend']<h2>RE-RESET CLICKEND TO ZERO</h2>[/url] [url='?action=dailyclicks']<h2>RESET DAILY CLICKS TO ZERO</h2>[/url] [url='?action=minusclickend']<h2>RESET MINUS CLICKS AND CLICEND</h2>[/url] [url='?action=resetall']<h2>RESET ALL ABOVE STATS ONE CLICK</h2>[/url] [url='?action=retire']<h2>RETIRE FROM CURRENT COURSE (Ends Course)</h2>[/url] "; } function course_clicks() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET course_clicks=18 WHERE userid=$userid"); Print"<h1>Course Clicks Updated</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function minus_clicks() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET minus_clicks=0 WHERE userid=$userid"); Print"<h1>MINUS CLICKS RESET TO ZERO</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function clickend() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET clickend=0 WHERE userid=$userid"); Print"<h1>CLICKEND RESET TO ZERO</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function dailyclicks() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET dailycclicks=0 WHERE userid=$userid"); Print"<h1>DAILY CLICKS RESET TO ZERO</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function resetall() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET dailycclicks=0, clickend=0, minus_clicks=0, course_clicks=18 WHERE userid=$userid"); Print"<h1>ALL STATS RESET</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function minusclickend() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET minus_clicks=0, clickend=0 WHERE userid=$userid"); Print"<h1>MINUS AND CLICK END RESET</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; } function retire() { global $db,$ir,$c,$userid,$h; if ($ir['user_level'] > 2) { echo '<h1> OOPS! SEEMS WE HAVE A PROBLEM'; exit($h->endpage()); } $db->query("UPDATE users SET course=0, cpercent=0, dailycclicks=0, clickend=0, minus_clicks=0, course_clicks=0 WHERE userid=$userid"); Print"<h1>YOU HAVE RETIRED FROM THIS MODULE</h1> [url='schooling.php']Return To Course[/url] or [url='edureset.php']Return To Editor[/url]"; $db->query("DELETE FROM schoolday WHERE userid=$userid"); } $h->endpage(); ?> call this file schooling.php <?php /*/////////MCCODES VERSION 2//////////////////// UPDATED EDUCATION SCRIPT ILLUSIONS 2010////// ///////////////////////////////////////////////// YOU MUST KEEP THIS DISCLAIMER INTACT/////// ANY PROBLEMS THEN MESSAGE ME ON THE////// [url]makewebgames.io[/url] FORUMS FOR HELP/////// /////////////////////////////////////////////*/ include "globals.php"; print "<h2>Schooling</h2>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); // THIS PART KINDLY EDITED BY DJKANNA THANK YOU // if($ir['course_clicks'] >= 1 && $ir['clickend'] < $coud['crPERCLICKS']) { $db->query("UPDATE users SET cpercent=cpercent+1, course_clicks=course_clicks-1, minus_clicks=minus_clicks+1, clickend=clickend+1, dailycclicks=dailycclicks+1 WHERE userid=$userid"); } else { echo '<div class="grey_info"> <h2>COME BACK IN AN HOUR YOUR TUTOR NEEDS FOOD</h2></div> '; echo '<div class="outcome_info"> <h2>You have completed '.$ir['cpercent'].'% out of '.$coud['crCOMPPERCENT'].'% so far on this module</h2></div>'; if ($ir['user_level'] > 1) { echo '<h1> ADMINS CHEAT PANEL </h1> [url="schooling.php"]Return To Course[/url] or [url="edureset.php"]Return To Editor[/url]'; exit($h->endpage()); } } ////////////////////////////////////////////////////////////////// if ($ir['clickend'] > $coud['crPERCLICKS']) { echo '<div class="grey_info"> <h2>COME BACK IN AN HOUR YOUR TUTOR NEEDS FOOD</h2></div> '; echo '<div class="outcome_info"> <h2>You have completed '.$ir['cpercent'].'% out of '.$coud['crCOMPPERCENT'].'% so far on this module</h2></div>'; if ($ir['user_level'] > 1) { echo '<h1> ADMINS CHEAT PANEL </h1> [url="schooling.php"]Return To Course[/url] or [url="edureset.php"]Return To Editor[/url]'; exit($h->endpage()); } } if ($ir['cpercent'] >= $coud['crCOMPPERCENT']) { $cd=$db->query("SELECT * FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET money=money+'{$coud['crCASHPRIZE']}', crystals=crystals+'{$coud['crCRYSTALS']}' 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 schoolhomework SET crtimes=crtimes+1 WHERE userid=$userid"); //$db->query("UPDATE users SET `cdays` = '0' WHERE userid=$userid"); $cd5=$db->query("SELECT * FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd5); $db->query("UPDATE `schoolhomework` SET `userid` = '{$userid}', crtimes=crtimes+1, lastcourse='{$ir['course']}' WHERE `courseid` = '{$ir['course']}' "); $cd=$db->query("SELECT * FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); print"<div class='grey_info'> <h1>{$coud['crCOMPLETED']} </h1></div><div class='outcome_info'><h2>STRENGH={$coud['crSTR']}% GUARD={$coud['crGUARD']}% LABOUR={$coud['crLABOUR']}% AGILITY={$coud['crAGIL']}% IQ={$coud['crIQ']}% ITEM REWARD= {$coud['crITEMNAME']} CASHREWARD=\${$coud['crCASHPRIZE']} CRYSTALS = {$coud['crCRYSTALS']} Congratulations you have completed the {$coud['crNAME']} Course </h2></div>"; $db->query("UPDATE userstats SET strength=strength+'{$coud['crSTR']}', agility=agility+'{$coud['crAGIL']}', guard=guard+'{$coud['crGUARD']}', labour=labour+'{$coud['crLABOUR']}', IQ=IQ+'{$coud['crIQ']}' WHERE userid=$userid"); event_add($ir['userid']," you have completed the {$coud['crNAME']} Course",$c); /////////////////////////////////////////////////////////////////////////////////// /* WHEN USER HAS COMPLETED THE COURSE DELETE COURSE INFO THEY WERE ON */ ////////////////////////////////////////////////////////////////////////////////// $db->query("DELETE FROM schoolday WHERE userid=$userid"); print "[url='schooling.php'][ Return to School ][/url] "; $q=$db->query("SELECT * FROM users WHERE cpercent=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd6=$db->query("SELECT * FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd6); $userid=$ir['userid']; $db->query("INSERT INTO schoolhomework VALUES({$ir['userid']},{$ir['course']}, crtimes=crtimes+1)"); $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; } $cd=$db->query("SELECT crCLICKS, crPERCLICKS FROM schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $dip=$db->query("SELECT crPERCLICKS FROM schools WHERE crID={$ir['course']}"); $per=$db->fetch_row($dip); print "<div class='grey_info'><h1>On this module you have {$coud['crCLICKS']} clicks Per day and {$per['crPERCLICKS']} each Hour. You have used {$ir['minus_clicks']} Hourly click(s) so far this session</h1></div> "; 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>Goal</th> <th>Achieved</td> <th>Action</td> <th>Clicks</td> </tr> <tr>'; $cd=$db->query("SELECT * FROM schools 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 schools WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); //if ($dn = mysql_num_rows($dt)) { echo ' <td>Yes</td> <td><font color="yellow">'.($coud['crCOMPPERCENT']).'%</font></td>'; } //else { echo ' <td><font color="yellow">'.($ir['cpercent']).'%</font></td> <td><a href=schooling.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 schools 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 schoolhomework WHERE userid=$userid AND courseid={$_GET['begin_course']}"); if($ir['dailycclicks'] == $coud['crCLICKS']) { print "<div class='grey_info'><h1>come back tomorrow youve used all your turns</h1></div>"; if ($ir['user_level'] > 1) { echo '<h1> ADMINS CHEAT PANEL </h1> [url="schooling.php"]Return To Course[/url] or [url="edureset.php"]Return To Editor[/url]'; } $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 "<h1>You have already completed this course.<h1> "; $h->endpage(); exit; }*/ $db->query("UPDATE users SET course={$_GET['begin_course']},cpercent={$coud['crPERCENT']},course_clicks={$coud['crCLICKS']},money=money-{$coud['crCOST']} WHERE userid=$userid"); //////////////////////////////////////////////////////////////////////////////////////////////////// /* INSERTS FOR SCHOOLDAY VALUES SO CRON CAN MAKE SURE THEY HAVE CORRECT CLICKS EACH DAY*/ /////////////////////////////////////////////////////////////////////////////////////////////////// $db->query("INSERT INTO schoolday VALUES({$ir['userid']},{$coud['crID']},{$coud['crCLICKS']})"); print "You have started the {$coud['crNAME']}, {$coud['crSTARTING']} {$coud['crDESC']} [url='schooling.php?begin_course={$coud[']CONTINUE[/url]"; } } else { //list schools $times=$db->query("SELECT lastcourse FROM schoolhomework WHERE userid=$userid AND lastcourse='{$coud['course']}'"); $done=$db->fetch_row($times); $mc2=$ir['crtimes']; print "Here is a list of available schools."; $q=$db->query("SELECT * FROM schools"); 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)) { $db->query("SELECT crtimes FROM users WHERE userid=$userid AND course={$r['crID']}"); $cdo=$db->query("SELECT * FROM schoolhomework WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[url='schooling.php?begin_course={$r[']Take Again[/url]"; } else { $do="[url='schooling.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>"; } } if ($ir['user_level'] > 1) { echo '<h1> ADMINS CHEAT PANEL </h1> [url="schooling.php"]Return To Course[/url] or [url="edureset.php"]Return To Editor[/url]'; exit($h->endpage()); } $h->endpage(); ?> schooling.php and edureset.php FILES HAVE BEEN UPDATED DUE TO NEW SQLS....... -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
FIRST OFF SQLS [mysql]CREATE TABLE IF NOT EXISTS `schools` ( `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', `crCRYSTALS` int(11) NOT NULL, `crITEM` int(11) NOT NULL DEFAULT '0', `crITEMNAME` varchar(100) NOT NULL, `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` decimal(65,4) NOT NULL DEFAULT '0.0000', `crGUARD` decimal(65,4) NOT NULL DEFAULT '0.0000', `crLABOUR` decimal(65,4) NOT NULL DEFAULT '0.0000', `crAGIL` decimal(65,4) NOT NULL DEFAULT '0.0000', `crIQ` decimal(65,6) NOT NULL DEFAULT '0.000000', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ----- USER SQLS ------ ALTER users ADD cpercent decimal(4,1) NOT NULL DEFAULT 0.0; ALTER users ADD course_clicks int(11) NOT NULL DEFAULT 0; ALTER users ADD minus_clicks int(11) NOT NULL DEFAULT 0; ALTER users ADD clickend int(11) NOT NULL DEFAULT 0; ALTER users ADD dailycclicks int(11) NOT NULL DEFAULT 0; ALTER users ADD crtimes int(11) NOT NULL DEFAULT 0; ---- HOMEWORK SQLS ------- CREATE TABLE IF NOT EXISTS `schoolhomework` ( `userid` int(11) NOT NULL DEFAULT '0', `courseid` int(11) NOT NULL DEFAULT '0', `crtimes` int(11) NOT NULL DEFAULT '0', `lastcourse` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/mysql] 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']); $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']); $crystals=abs((int) $_POST['crystals']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((float) $_POST['str']); $agil=abs((float) $_POST['agil']); $gua=abs((float) $_POST['gua']); $lab=abs((float) $_POST['lab']); $iq=abs((float) $_POST['iq']); $name=$_POST['name']; if($_POST['name'] && $_POST['desc'] && $_POST['itemname'] && $cost && $cashprize && $crystals && $item) { $db->query("INSERT INTO schools VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$cashprize', '$crystals', '$item', '{$_POST['itemname']}', '$qty', '$energy', '$comppercent', '$percent', '$clicks', '$perclicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added. [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; 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='comppercent' /> 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>Crystals: <input type='text' name='crystals' /> </th> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Item Name: <input type='text' name='itemname' /> </th> <th>Quantity: <input type='text' name='qty' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th></tr> <th>Strength Gain: <input type='text' name='str' value='0.0000'/> </th> <th>Agility Gain: <input type='text' name='agil' value='0.0000'/> </th> <th>Guard Gain: <input type='text' name='gua' value='0.0000'/> </th> <th>Labour Gain: <input type='text' name='lab' value='0.0000'/> </th> <th>IQ Gain: <input type='text' name='iq' value='0.000000'/> </th> </tr></table><input type='submit' value='Add Course' /></form> [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']); $crystals=abs((int) $_POST['crystals']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((float) $_POST['str']); $agil=abs((float) $_POST['agil']); $gua=abs((float) $_POST['gua']); $lab=abs((float) $_POST['lab']); $iq=abs((float) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE schools SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crCRYSTALS=$crystals, crITEM=$item, crITEMNAME='{$_POST['itemname']}', 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 schools WHERE crID={$_POST['schoolcourse']}"); $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['schoolcourse']}' /> <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>Crystals: <input type='text' name='crystals' value='{$old['crCRYSTALS']}' /> </th> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Item Name : <input type='text' name='itemname' value='{$old['crITEMNAME']}' /> </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th></tr> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th> <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> </tr></table><input type='submit' value='Edit Course' /></form> [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, "schoolcourse")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM schools WHERE crID={$_POST['schoolcourse']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['schoolcourse']}"); $db->query("DELETE FROM schools WHERE crID={$_POST['schoolcourse']}"); 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]"; } } $h->endpage(); ?> Add these links to smenu.php [url='staff_courses.php?action=addcourse'][ ADD NEW COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] add this to global_func.php function course_dropdown($connection,$ddname="schoolcourse",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM schools ORDER BY crNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['crID']}'"; if ($selected == $r['crID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['crNAME']}</option>"; } $ret.="\n</select>"; return $ret; } NEXT PART BELOW..... -
mccode-v2 [EDUCATION MOD] Totally Re-worked with many additional Options.
Uridium replied to Uridium's topic in Free Modifications
I hate awards they just make people Code faster and mess up more. Id sooner have a decent working Project than an Award for messing up scripts.. Just my opinion :) -
yep i know ive done this one before but my first attempt had many flaws. This version however has been Rigorously tested and im Pleased to say its a fully working Process.. New features...... 1 = Adds decimal to all stats ( old version didnt do this infact old version didnt even update them oops) 2 = New staff options you can now add the item directly without an ID and give the Item a name so users can see their reward instead of an ID# 3 = Crystals have been introduced so you can now offer Crystals as a Reward other than Items and Cash... 4 = All added Education Modules can now be set so you can have so many clicks per day and so many clicks per hour. 5 = Courses can be completed by users as many times as the user wishes. 6 = Staff have an Hidden section for those wanting to test new Education Outcomes 7 = Modules work from clicks and NOT crons so users dont have to wait X amount of days for a course to finish.... 8 = The new version will alow those who have other types of gains that arnt crystals to be added quite easily.... 9 = Admins can view which users are doing which course and the achieved percentage for that course 10 = Damn cant think of a 10 but the other 9 are great ;) Will post up new script later today........
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
I'll update the code once ive fully tested it. When i made this one i was still kinda new to various things if people are using the coding on the first page will notice mis-mataches when adding strength agility and so on this has been cured in the newer version. The staff section is working fine... Just having a few issues with the education part for users... Also all SQLS and files for this mod have been renamed for those that wish to carry on using their older version of education.php New file names are school.php AKA education.php staff_schooling.php... AKA staff_courses.php I want to make sure this version is 100% reliable than the last before i Post so at moment its undergoing rigorous testing. Before being made public.... -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re-done this slightly ITEMS can be added when Adding an Education (no longer needs ItemID) Stats now Update Properly without use of a cron... When course completed when adding stats they are now Decimal so you can decide what to give out and the stats wont go mental as before... Noticed a bug when adding amount of clicks to give a user per session. This has now been fixed and any Education you make the clicks will be determined from what you give,,,, Still adding a few new things.... 1. User gets a Shield or Trophy for completion of a module. 2. Users can take more than 1 course at a time but probably no more than 3 << MAY NEED HELP WITH THIS BIT IF ANYONE WANTS TO 3. Add luxuries Like gain points/crystals for Modules Completed 4. Boost rep for gangs who take Gang Courses. I'll think of more as i go along. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
I found a few other errors Haunted especially on the staff section so ironing those out and a few others... -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
<<< ILL HAVE TO LOOK INTO THIS ISSUE AS IT WASNT WHAT I THOUGHT IT WAS >>> Im going to Re-code this as its using SQLS already given by the standard MCC courses and look into a few other issues ive found along the way. -
very nice CJ :)
-
[MCC ALL ] Move images from one folder to another instantly
Uridium replied to Uridium's topic in Free Modifications
removed -
Came across this script thought it might come in useful it will allow you to Move Images from one folder on your FTP to another Ive made a few amendments to the script so it allows for Multiple folders to be made so your not overwriting the one youve just sent...... <?php //FileMover 0.9 //Script is used to copy all the files in one dir to seperate folders with x amount of files each. //Run it from any dir.. just edit the config below and run using ./FileMover (Check the php location above) //Feel free to use this wherever.. I'd wouldn't mind a free lunch though!! -> [email][email protected][/email] //-Dustin Drewery //************* CONFIG *******************/ //Set the folder to look for pics in. (no /) $dir = "images"; //Set the maximum number of pics for each dir $max = 300; //Where do you want to save them? (no /) // MAKE SURE THIS EXISTS AND IS CHMOD 777!! //Don't put it in the same folder as your originals either.. $copyPath = "Movedimages"; //Prefix, if any, to add to the folder name.. new folder names will be prefix1 prefix2 prefix3... $prefix = "folder"; //List of prefixes to copy.. ALL CAPS $fileTypes = array("JPG","JPEG","GIF","BMP"); $negativeTypes = array("txt","php","html","htm","sql"); //Thats it!!! //******* You shouldn't need to edit below this line ***********************/ CopyDirContents($dir,$max,$fileTypes,$copyPath,$prefix); function CopyDirContents($dir,$max,$fileTypes,$copyPath,$prefix=null){ ini_set("max_execution_time",6000); if (!is_dir($dir)){die ("<h2>Error: Folder name <font color='red'>$dir!</font> Doesnt Exsist</h2>");} $totalFiles = 0; $dirNum =rand(1,999999); $cur = 1; $curDir = $copyPath."/".$prefix.$dirNum; mkdir($curDir); if ($root=@opendir($dir)){ while ($file=readdir($root)){ if($file=="." || $file==".."){continue;} if(is_dir($dir."/".$file)){ continue; }else{ $fileParts = explode(".",$file); if(!is_array($fileParts) || !in_array(strtoupper($fileParts[count($fileParts)-1]),$fileTypes)) {continue;} if($cur > $max) { $dirNum++; $curDir = $copyPath."/".$prefix.$dirNum; mkdir($curDir); $cur = 1; } print"<font color'green'>"; copy($dir."/".$file,$curDir."/".$file); print"<font color='blue'>".$file."</font>\t\t\t EXTRACTED TO \t".$curDir."/".$file."\n</font> "; $cur++; $totalFiles++; } } } if ($totalFiles='0'){die ();} } {die ("<h2><font color='red'>Error: WRONG IMAGE FORMAT SUPPLIED.</font></h2>");} exit; if ($totalFiles > 0) { print "<font color='green'><h2>Copied $totalFiles Files Successfully</h2></font> files from <font color='green'>$dir </font>Moved to <font color='blue'>$copyPath/$prefix</font>".$dirNum."\n"; } ?> Credit goes to Dustin Drewery...
-
if i was a woman i could have bitch slapped you all ;)
-
I gotta agree with JDS on this one the mod was crap never did get it to work :)
-
echo <<<EOF <script> <!-- function fullwin(targeturl){ window.open(targeturl,"","fullscreen,scrollbars,addressbar") } //--> </script> <form> <input type="image" img src="wow.gif" onClick="fullwin('index.php')" ALT="View Game in full screen mode" style="FILTER: alpha(style=3, opacity=100,finishopacity=0, startx=0, finishx=100, starty=0, finishy=100) ALT="Open Window In Full View Mode" height="150" width=150" border="6" value="FULL SCREEN" > <font color="#aeaeae">FULL SCREEN</font> </form> EOF; This one comes with an image button but will work the same on all Browsers
-
This script will allow those testing new features in a game that get hosped or jailed to have a choice of which they want to evade from also replenishes health, hp and will <?PHP include "globals.php"; switch($_GET['action']) { case 'jail': jail(); break; case 'hosp': hosp(); break; case 'health': health(); break; default: prefs_home(); break; } function prefs_home() { global $db,$ir,$c,$userid,$h; print "<h2>Replenish Page</h2> <h3>Page code from illusions</h3> [url='xxxxxx.php?action=jail']<h2>GET OUT OF JAIL FREE</h2> [/url] [url='xxxxxx.php?action=hosp']<h2>RESET YOUR HOSPITAL TIME</h2>[/url] [url='xxxxxx.php?action=health']<h2>RE-GENERATE YOUR HEALTH</h2>[/url] "; } function jail() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET jail=0 WHERE userid=$userid"); Print"<h1>GET OUT OF JAIL CARD USED</h1> [url='index.php']Return To Game[/url]"; } function hosp() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET hospital=0 WHERE userid=$userid"); Print"<h1>TIMER REMOVED FROM HOSPITAL</h1> [url='index.php']Return To Game[/url]"; } function health() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET energy=maxenergy, will=maxwill, hp=maxhp WHERE userid=$userid"); Print"<h1>ENERGY REPLENISHED</h1> [url='index.php']Return To Game[/url]"; } $h->endpage(); ?> Add more cases and functions if you need them SAVE THIS PAGE AS WHATEVER YOU WANT BUT MAKE SURE YOU ALTER THE XXXXXX.php in the hrefs section. to that of your newly named file