-
Posts
218 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by AnonymousUser
-
Your coding sucks!! :D hows that for collaboration? here i'll share it... First step: Add table to database, columns are: 1) poster int(12) 2) recipient int(12) 3) Comment varchar(255) Second step: Access user table and insert a column called "youtube" Varchar (20) ////*****///// This is the part of comment. ------ Create a file called comment.php with the following PHP. <?php include "globals.php"; if (!$_GET['user']) { echo "Invalid use of file."; } else { function str_replace_assoc(array $replace, $subject) { return str_replace(array_keys($replace), array_values($replace), $subject); } $exist = mysql_query("SELECT userid FROM users WHERE userid = " . $_GET['user'] . ""); if (mysql_num_rows($exist) < 1) { echo "Invalid user."; } else { if (strlen($_POST['comment']) < 1) { echo "Please enter a comment."; exit; } echo "Comment posted."; $replace = array( '[img]' => '<img src=', '[url]' => '<a href=', '[b]' => '<strong>', '[u]' => '<u>', ' [center]' => '<center>', '[/img]' => '>', '[/url]' => '>I posted A Link</a>', '[/b]' => '</strong>', '[/u]' => '</u>', '[/center] ' => '</center>', ); $text = $_POST['comment']; echo str_replace_assoc($replace, $text); if (!mysql_query("INSERT INTO comments VALUES(" . $ir['userid'] . ", " . $_GET['user'] . ", '" . str_replace_assoc($replace, $text) . "')")) { echo "<br/>" . mysql_error(); } } } ?> Now somewhere in viewuser.php post the following lines. $comments = mysql_query("SELECT * FROM comments JOIN users ON comments.poster = users.userid WHERE comments.recipient = " . $_GET['u'] . ""); if (mysql_num_rows($comments) < 1) { echo "No Comments"; } else { while ($c = mysql_fetch_array($comments)) { echo "<a href='viewuser.php?u=" . $c['poster'] . "'>" . $c['username'] . "</a><br/>"; echo " " . $c['comment'] . "<br/><br/>"; } } //////*******////// Now for the youtube portion This goes in viewuser.php also. Wherever you would like your youtube video to pop up for users. if ($r['youtube']) { echo '<iframe width="560" height="315" src="http://www.youtube.com/embed/'. $r['youtube'] .'" frameborder="0" allowfullscreen></iframe>'; } else { echo "No Video"; } The only way you will be able to make this work is if you find the query finding the users information on viewuser.php, and add `youtube` to the user portion of query. This will go in preferences.php Switch function stuff: case 'youtube': youtube(); break; case 'youtubedone': youtubedone(); break; The actual functions: function youtube() { global $ir,$c,$userid,$h; echo "What video would you like? <form method='post' action='preferences.php?action=youtubedone'> Video ID (EX:9_Ub6pW71Zs) <input type='text' name='ID'> <input type='submit' value='Post Video'> </form> "; } function youtubedone() { global $ir,$c,$userid,$h; if (strlen($_POST['ID']) < 1) { mysql_query("UPDATE users SET youtube = '' WHERE userid = " . $ir['userid'] . ""); echo "Video removed."; exit; } if (strlen($_POST['ID']) > 12) { echo "Not a real video!"; exit; } else { mysql_query("UPDATE users SET youtube = '" . $_POST['ID'] . "' WHERE userid = " . $ir['userid'] . ""); echo "Video posted!"; } } All you must do now, is post the link that directs to the youtube menu on your list of links (preferences.php?action=youtube) lol if you wanna use this crap go for it... however you may want to get better coder for this type of modification or do my alternative which was just looking in previous forums and such, found the old bbcode view user mod and since the bbcode that is used by the newer v2 codes i just replaced it with that, also google helped with embedding the vids for utube ;) you want to know the worst part?? well he charged 60$ for this crap lol i was being nice and trying to see what he was actually capable of and he came up with this junk so if you would like to have a coder then i wouldn't suggest getting him however i have learned from this experience and would like to share it with others to help save them the troubles
-
possibly get it working properly lol that way one can properly test if your going to sell something then sell it as a completed model...
-
im sorry but 10% isn't much at all really... and the credit system BLOWS! it was a good idea but in the end it sucks... i only use the credit system as contest points in some of my games ;)
-
how much would one pay for a game thats made 1500$ in the first month? what would your offer be?
-
These forums going down the toilet
AnonymousUser replied to chicka's topic in Feedback and Site Support
theres a difference from criticism and constructive criticism most people just talk down i dont think thats what this forum was made for... its to help others not bring them down i laugh at those who complain and moan about the stuff they feel they're too smart to deal with or they feel inadequate about the fact they cant code and they still talk trash. i just read most of the time i dont spend much time trying to post because if i want to do something or get something done i look around at peoples old work and new work and then take that into consideration for hiring them... so for those who do help the forum you should be +1 at all times :D as for the others i am not going to say how i truly feel as it would be redundant -
looks pretty cool! great concept!
-
Letting players complete offers against ingame stuff
AnonymousUser replied to dnenb's topic in General
lol who learned him how to spoke :p -
read the first line... then reply to accusation... :D what did u fix the old forum bugs? why not just update original post although after reviewing original post i dont see any forum bugs from quick glance... :rolleyes:
-
looks like the mining mod but simplified to just crystals... you also forgot to add in the query to update stamina
-
mccode-v2 Advanced referral System
AnonymousUser replied to Sam Fisher's topic in Free Modifications
lol and the errors are? -
lol yeah i was just looking at that i was like ***?! where's everything?! :D also the register page is stolen off another game... freaking newbies... if your going to do "Custom Work" at least take your time and customize the dang thing.
-
probably someone selling someone elses game backups i hate those people -.-
-
10-11-2009, 04:38 PM <---- Died At 03-24-2013, 08:36 PM <---- Revived -.-
-
mccode-v2 ANY Version True Hourly Rewards
AnonymousUser replied to AnonymousUser's topic in Free Modifications
you just find the place where you succeed the crime and add in the crcrount = crcount + 1 :/ -
and again another great job :D thanks guest! i dont use this but im sure someone will :p i was just removing old forum junk ;)
-
Here I am (3 years later)
AnonymousUser replied to InternalExpertCoding's topic in General Discussion
lol yes indeed i know exactly what you mean i had just returned last year after a 3year break myself :D a lot has changed but nothing out of the norm though just the usually hackers and security :D -
mccode-v2 ANY Version True Hourly Rewards
AnonymousUser replied to AnonymousUser's topic in Free Modifications
lol thanks a lot guest!! +2min for you! :D -
mccode-v2 ANY Version True Hourly Rewards
AnonymousUser replied to AnonymousUser's topic in Free Modifications
just want the cron to set the user with the highest crime count for that hour an event + reward of the event for winning most crimes this hour and resetting counts for the next hour of course -
mccode-v2 ANY Version True Hourly Rewards
AnonymousUser replied to AnonymousUser's topic in Free Modifications
if you read carefully i have already stated what i wanted to give :D its crystals... and i want it to give to person with the most crimes done within that hour +10 preferably -
I was just looking around browsing, being bored. You know, lol the usual. Well i've seen this in other games just haven't got around to making it myself so here we go... add sqls for rewards you want to give out for suchas crimes SQLS ALTER TABLE `users` ADD `crcount` INT( 11 ) NOT NULL DEFAULT '0'; once that is done all you need to do is add a query to update the users crcount by 1 each file where said reward is given on the hour... for our case its crimes so... edit docrime.php Find $db->query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); add afterwards or wherever it dont really matter... $db->query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']}, crcount=crcount+1 WHERE userid=$userid",$c); now we give rewards... in this case it will be crystals $sql = sprintf("SELECT `userid`,`username` FROM `users` WHERE `crCount` > 0 ORDER BY `crCount` DESC LIMIT 1"); $run = $db->query($sql); if ($db->num_rows($run) > 0) { $res = $db->fetch_row($run); $sql = sprintf("UPDATE `users` SET `crystals` = `crystals` + 10 WHERE `userid` = '{$res['userid']}'"); $db->query($sql); $event = "Congratulations, " . mysql_real_escape_string($res['username']) . ", you have won 10 crystals for doing the most crimes in the last hour."; event_add($res['userid'], $event, $c); } $sql = sprintf("UPDATE `users` SET `crCount` = 0 WHERE `crCount` > 0"); $db->query($sql); --Credit goes to Guest for writing this cronjob
-
heres what im using.... and its sending multiple events this is my schooling.php (pretty much the same just a few edits to fit the layout a bit...) <?php /*/////////MCCODES VERSION 2//////////////////// UPDATED EDUCATION SCRIPT ILLUSIONS 2010////// ///////////////////////////////////////////////// YOU MUST KEEP THIS DISCLAIMER INTACT/////// ANY PROBLEMS THEN MESSAGE ME ON THE////// <a href='makewebgames.io'>makewebgames.io</a> 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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; exit($h->endpage()); } } ////////////////////////////////////////////////////////////////// if ($ir['clickend'] > $coud['crPERCLICKS']) { echo '<b>COME BACK IN AN HOUR YOUR TUTOR NEEDS FOOD</b>'; echo '<b>You have completed '.$ir['cpercent'].'% out of '.$coud['crCOMPPERCENT'].'% so far on this class</b>'; if ($ir['userid'] == 1) { echo 'ADMINS CHEAT PANEL'; echo'<a href="schooling.php">Return To Course</a>'; echo'<a href="edureset.php">Return To Editor</a>'; 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']} class 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"<table class='table' width='80%'> <tr><td colspan='2' align='center'>{$coud['crCOMPLETED']}</td></tr> <tr><td align='center'>STRENGH</td><td align='center'>{$coud['crSTR']}</td></tr> <tr><td align='center'>GUARD</td><td align='center'>{$coud['crGUARD']}</td></tr> <tr><td align='center'>LABOUR</td><td align='center'>{$coud['crLABOUR']}</td></tr> <tr><td align='center'>AGILITY</td><td align='center'>{$coud['crAGIL']}</td></tr> <tr><td align='center'>IQ</td><td align='center'>{$coud['crIQ']}</td></tr> <tr><td align='center'>ITEM REWARD</td><td align='center'> {$coud['crITEMNAME']}</td></tr> <tr><td align='center'>CASHREWARD</td><td align='center'>\${$coud['crCASHPRIZE']}</td></tr> <tr><td align='center'>CRYSTALS </td><td align='center'> {$coud['crCRYSTALS']}</td></tr> <tr><th align='center'>Congratulations you have completed the {$coud['crNAME']} Course</th></tr> </table>"; $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 "<a href='schooling.php'>[ Return to School ]</a> "; $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']; $schd = sprintf("INSERT INTO `schoolhomework` VALUES({$ir['userid']},{$ir['course']},`crtimes`=`crtimes`+'1',{$coud['crID']})"); $db->query($schd); $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']} class and your master says {$coud['crCOMPLETED']}! For completing your class you 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 "<b>In this Class you have <u>{$coud['crCLICKS']}</u> clicks Per day.</b>"; print "<b>You can do <u>{$per['crPERCLICKS']}</u> clicks each Hour.</b>"; print "<b>You have used <u>{$ir['minus_clicks']}</u> Hourly click(s) so far this session</b>"; echo '<table border="1" width="100%" class="table" cellspacing="3" cellpadding="4">'; echo '<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>'; echo '<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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; } $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']}"; print "<a href='schooling.php?begin_course={$coud['crID']}'>CONTINUE</a>"; } } 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="<a href='schooling.php?begin_course={$r['crID']}'>Take Again</a>"; } else { $do="<a href='schooling.php?begin_course={$r['crID']}'>Take</a>"; } 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['userid'] == 1) { echo '<b> ADMINS CHEAT PANEL </b><br />'; echo '<a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; exit($h->endpage()); } $h->endpage(); ?>
-
Fixed Just thought I would let everyone know that its fixed now :D schooling.php <?php /*/////////MCCODES VERSION 2//////////////////// UPDATED EDUCATION SCRIPT ILLUSIONS 2010////// ///////////////////////////////////////////////// YOU MUST KEEP THIS DISCLAIMER INTACT/////// ANY PROBLEMS THEN MESSAGE ME ON THE////// <a href='makewebgames.io'>makewebgames.io</a> 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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; 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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; 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 "<a href='schooling.php'>[ Return to School ]</a> "; $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']; $schd = sprintf("INSERT INTO `schoolhomework` VALUES({$ir['userid']},{$ir['course']},`crtimes`=`crtimes`+'1',{$coud['crID']})"); $db->query($schd); $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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; } $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']} <a href='schooling.php?begin_course={$coud['crID']}'>CONTINUE</a>"; } } 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="<a href='schooling.php?begin_course={$r['crID']}'>Take Again</a>"; } else { $do="<a href='schooling.php?begin_course={$r['crID']}'>Take</a>"; } 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> <a href="schooling.php">Return To Course</a> or <a href="edureset.php">Return To Editor</a>'; exit($h->endpage()); } $h->endpage(); ?> 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. <a href='staff_courses.php?action=editcourse'>[ EDIT A COURSE ]</a> <a href='staff_courses.php?action=delcourse'>[ DELETE A COURSE ]</a>"; 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> <a href='staff_courses.php?action=editcourse'>[ EDIT A COURSE ]</a> <a href='staff_courses.php?action=delcourse'>[ DELETE A COURSE ]</a>"; } } 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> <a href='staff_courses.php?action=addcourse'>[ ADD ANOTHER COURSE ]</a> <a href='staff_courses.php?action=editcourse'>[ EDIT A COURSE ]</a> <a href='staff_courses.php?action=delcourse'>[ DELETE A COURSE ]</a>"; 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> <a href='staff_courses.php?action=addcourse'>[ ADD A COURSE ]</a> <a href='staff_courses.php?action=delcourse'>[ DELETE A COURSE ]</a>"; 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 /> <a href='staff_courses.php?action=editcourse'>[ EDIT A COURSE ]</a> <a href='staff_courses.php?action=delcourse'>[ DELETE A COURSE ]</a> <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> <a href='staff_courses.php?action=editcourse'>[ EDIT A COURSE ]</a> <a href='staff_courses.php?action=addcourse'>[ ADD A COURSE ]</a>"; } } $h->endpage(); ?> :) thanks in advance for the plus ones :D