-
Posts
218 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by AnonymousUser
-
i find it kind of difficult when it comes to reading the items...
-
Placing the Brave needed to complete the intended course should be shown... other then that its okay from what i have tested, which wasn't much btw :p should make an easy starter pack so one can refill brave quicker for faster testing ;)
-
I like this idea, i think i've got something similar to what you were explaining but its been so long lol i doubt it can be found
-
Revamped Individual Player Shops Mod + Future Updates [$10]
AnonymousUser replied to Arson's topic in Paid Modifications
be better off posting the code or the strings as to where you think the error is coming from ;) -
you forgot to add the gang house to the query for creategang.php $db->query( "INSERT INTO `gangs` (`gangNAME`, `gangDESC`, `gangRESPECT`, `gangPRESIDENT`, `gangVICEPRES`, `gangCAPACITY`, `gangHOUSE`) VALUES('$name', '$desc', 100, $userid, $userid, 5, 1)");
-
yeah it would but it dont say anything lol it just reverts back to gang staff idx :D
-
doesn't work
-
**SUGGESTION** add more "vacancy" slots as to let up to 4 players use same home at same time seeing as the price of the home is set to 10X original amount... or whatever one sets it to along with ability to purchase up to 2 different houses?
-
fixed functions, also fixed query errors because of reasons posted above :) enjoy!! function gang_staff_alliance_request() { global $db, $gangdata; if(!isset($_POST['submit'])) { echo"<h3>Request an Alliance</h3> <form action='yourgang.php?action=staff&act2=alliancer' method='post'> <table class='table' width='75%' cellspacing='1'> <tr> <th width='45%'>Gang</th> <td width='55%'><select name='gang' type='dropdown'>"; $pikachu = $db->query(sprintf("SELECT `gangID`, `gangNAME` FROM `gangs` WHERE (`gangID` != %u)", $gangdata['gangID'])); if(!$db->num_rows($pikachu)) { echo "<option value='0'>There are no gangs</option>"; } else { while($yellow = $db->fetch_row($pikachu)) { printf("<option value='%u'>%s</option>", $yellow['gangID'], output($yellow['gangNAME'])); } } echo"</select></td> </tr> <tr> <th>Message</th> <td><textarea name='message' rows='10' cols='70' placeholder='Enter a reason as to why you want to become allies'></textarea></td> </tr> <tr> <td colspan='2' class='center'><input type='submit' name='submit' value='Request Alliance' /></td> </tr> </table> </form>"; } else { $_POST['gang'] = isset($_POST['gang']) && ctype_digit($_POST['gang']) ? abs(@intval($_POST['gang'])) : null; $_POST['message'] = isset($_POST['message']) && is_string($_POST['message']) ? trim($_POST['message']) : null; if(empty($_POST['gang'])) { cleanKill("You didn't select a valid gang"); } if(empty($_POST['message'])) { cleanKill("You didn't enter a valid message"); } $blue = $db->query(sprintf("SELECT `gangID`, `gangNAME` FROM `gangs` WHERE (`gangID` = %u)", $_POST['gang'])); if(!$db->num_rows($blue)) { cleanKill("That gang doesn't exist"); } $row = $db->fetch_row($blue); $froob = $db->query(sprintf("SELECT `gaID` FROM `gangAlliances` WHERE (((`gaGuild1` = %u) AND (`gaGuild2` = %u)) OR ((`gaGuild2` = %u) AND (`gaGuild1` = %u)))", $_POST['gang'], $gangdata['gangID'], $_POST['gang'], $gangdata['gangID'])); if($db->num_rows($froob)) { cleanKill("You're already allied with ".output($row['gangNAME'])); } if($_POST['gang'] == $gangdata['gangID']) { cleanKill("You can't ally with yourself!"); } $selectRequest = $db->query(sprintf("SELECT `garID` FROM `guildAllianceRequests` WHERE (((`garGuildFrom` = %u) AND (`garGuildTo` = %u)) OR ((`garGuildTo` = %u) AND (`garGuildFrom` = %u)))", $_POST['gang'], $gangdata['gangID'], $_POST['gang'], $gangdata['gangID'])); if($db->num_rows($selectRequest)) { cleanKill("You've already sent an alliance request"); } $db->query(sprintf("INSERT INTO `guildAllianceRequests` VALUES ('', %s, %u, %u, '%s')", time(), $gangdata['gangID'], $_POST['gang'], $db->input($_POST['message']))); gang_event_add($gangdata['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has sent an alliance request to <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $_POST['gang'], $row['gangNAME'])); gang_event_add($_POST['gang'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has sent an alliance request to <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $_POST['gang'], $row['gangNAME'])); echo "You've requested to become allied with ".output($row['gangNAME']); } } function gang_staff_alliance_decide() { global $db, $gangdata; if(empty($_GET['ID'])) { cleanKill("You didn't select a valid alliance request to decide on"); } $select = $db->query(sprintf("SELECT `gar`.*, `g`.`gangID`, `g`.`gangNAME` FROM `guildAllianceRequests` AS `gar` " . "LEFT JOIN `gangs` AS `g` ON (`g`.`gangID` = `gar`.`garGuildFrom`) " . "WHERE ((`gar`.`garGuildTo` = %u) AND (`gar`.`garID` = %u)) LIMIT 1", $gangdata['gangID'], $_GET['ID'])); if(!$db->num_rows($select)) { cleanKill("That request doesn't exist"); } $_GET['what'] = isset($_GET['what']) && ctype_alpha($_GET['what']) && in_array($_GET['what'], array('accept', 'decline')) ? strtolower(trim($_GET['what'])) : null; if(empty($_GET['what'])) { cleanKill("You didn't select a valid decision"); } $req = $db->fetch_row($select); if($_GET['what'] == 'accept') { $db->query(sprintf("INSERT INTO `gangAlliances` VALUES ('', %u, %u, %s)", $gangdata['gangID'], $req['gangID'], time())); $db->query(sprintf("DELETE FROM `guildAllianceRequests` WHERE (`garID` = %u)", $_GET['ID'])); gang_event_add($gangdata['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has accepted the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $req['gangID'], $req['gangNAME'])); gang_event_add($req['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has accepted the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $req['gangID'], $req['gangNAME'])); echo (sprintf("You've accepted the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $req['gangID'], output($req['gangNAME']))); } else { $db->query(sprintf("DELETE FROM `guildAllianceRequests` WHERE (`garID` = %u)", $_GET['ID'])); gang_event_add($gangdata['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> have declined the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $req['gangID'], $req['gangNAME'])); gang_event_add($req['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> have declined the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], $gangdata['gangNAME'], $req['gangID'], $req['gangNAME'])); printf("You've declined the alliance request from <a href='gangs.php?action=view&ID=%u'>%s</a>", $req['gangID'], output($req['gangNAME'])); } } function gang_staff_alliance_break() { global $db, $gangdata; if(!isset($_POST['submit'])) { echo"<h3>Break an Alliance</h3> <form action='yourgang.php?action=staff&act2=allianceb' method='post'> <table class='table' width='75%' cellspacing='1'> <tr> <th width='45%'>Gang</th> <td width='55%'><select name='alliance' type='dropdown'>"; $pikachu = $db->query(sprintf("SELECT `gi`.`gaID`, `g`.`gangID`, `g`.`gangNAME` FROM `gangAlliances` AS `gi` " . "LEFT JOIN `gangs` AS `g` ON (`g`.`gangID` = `gi`.`gaGuild2`) " . "WHERE ((`gi`.`gaGuild1` = %u) OR (`gi`.`gaGuild2` = %u))", $gangdata['gangID'], $gangdata['gangID'])); if(!$db->num_rows($pikachu)) { echo "<option value='0'>You have no allies</option>"; } else { while($yellow = $db->fetch_row($pikachu)) { if($_GET['ID']) { if($_GET['ID'] == $yellow['gaID']) { printf("<option value='%u' selected='selected'>%s</option>", $yellow['gaID'], output($yellow['gangNAME'])); } } else { printf("<option value='%u'>%s</option>", $yellow['gaID'], output($yellow['gangNAME'])); } } } echo"</select></td> </tr> <tr> <td colspan='2' class='center'><input type='submit' name='submit' value='Break Alliance' /></td> </tr> </table> </form>"; } else { $_POST['alliance'] = isset($_POST['alliance']) && ctype_digit($_POST['alliance']) ? abs(@intval($_POST['alliance'])) : null; if(empty($_POST['alliance'])) { cleanKill("You didn't select a valid Alliance"); } $blue = $db->query(sprintf("SELECT `ga`.`gaID`, `g`.`gangID`, `g`.`gangNAME` FROM `gangAlliances` AS `ga` " . "LEFT JOIN `gangs` AS `g` ON (`g`.`gangID` = `ga`.`gaGuild2`) " . "WHERE ((`ga`.`gaID` = %u) AND ((`ga`.`gaGuild1` = %u) OR (`ga`.`gaGuild2` = %u)))", $_POST['alliance'], $gangdata['gangID'], $gangdata['gangID'])); if(!$db->num_rows($blue)) { cleanKill("Either that alliance doesn't exist, or it's not yours!"); } $row = $db->fetch_row($blue); $db->query(sprintf("DELETE FROM `gangAlliances` WHERE (`gaID` = %u)", $_POST['alliance'])); gang_event_add($gangdata['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has broken the alliance with <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], output($gangdata['gangNAME']), $row['gangID'], output($row['gangNAME']))); gang_event_add($row['gangID'], sprintf("<a href='gangs.php?action=view&ID=%u'>%s</a> has broken the alliance with <a href='gangs.php?action=view&ID=%u'>%s</a>", $gangdata['gangID'], output($gangdata['gangNAME']), $row['gangID'], output($row['gangNAME']))); echo "You have broken the alliance"; } } function gang_staff_alliance_view() { global $db, $gangdata; echo("<table class='table' width='75%' cellspacing='1'> <tr> <th width='60%'>Gang</th> <th width='20%'>Time Left</th> <th width='20%'>Action</th> </tr>"); $pikachu = $db->query(sprintf("SELECT `ga`.*, `g`.`gangID`, `g`.`gangNAME` FROM `guildAlliances` AS `ga` " . "LEFT JOIN `gangs` AS `g` ON (`g`.`gangID` = `ga`.`gaGuild2`) " . "WHERE ((`ga`.`gaGuild1` = %u) OR (`ga`.`gaGuild2` = %u))", $gangdata['gangID'], $gangdata['gangID'])); if(!$db->num_rows($pikachu)) { echo "<tr><td colspan='3' class='center'>You don't have any Allies</td></tr>"; } else { while($yellow = $db->fetch_row($pikachu)) { echo "<tr>"; printf("<td><a href='gangs.php?action=view&ID=%u'>%s</a></td>", $yellow['gaGuild2'], output($yellow['gangNAME'])); printf("<td class='center'>%s</td>", time2readable(($yellow['gaTime'] + 2592000) - time())); printf("<td class='center'></td>", $yellow['gaID']); echo "</tr>"; } } echo "</table>"; echo"<h3>Alliance Requests</h3> <table class='table' width='75%' cellspacing='1'> <tr> <th width='40%'>Gang</th> <th width='40%'>Message</th> <th width='20%'>Links</th> </tr>"; $froob = $db->query(sprintf("SELECT `gar`.*, `g`.`gangID`, `g`.`gangNAME` FROM `guildAllianceRequests` AS `gar` " . "LEFT JOIN `gangs` AS `g` ON (`gar`.`garGuildFrom` = `g`.`gangID`) " . "WHERE (`gar`.`garGuildTo` = %u) ORDER BY `gar`.`garTime` ASC", $gangdata['gangID'])); if(!$db->num_rows($froob)) { echo "<tr><td colspan='3' class='center'>You don't have any alliance requests</td></tr>"; } else { while($blue = $db->fetch_row($froob)) { echo "<tr>"; printf("<td><a href='gangs.php?action=view&ID=%u'>%s</a></td>", $blue['gangID'], output($blue['gangNAME'])); printf("<td>%s</td>", output($blue['garMessage'])); printf("<td><a href='yourgang.php?action=staff&act2=alliancea&ID=%u&what=accept'><img src='/silk/accept.png' title='Accept this request' alt='Accept' /></a> ยท <a href='yourgang.php?action=staff&act2=alliancea&ID= %u&what=decline'><img src='/silk/delete.png' title='Decline this request' alt='Decline' /></a></td>", $blue['garID'], $blue['garID']); echo "</tr>"; } } echo "</table>"; }
-
also noticed you went from guilds to gangs was getting an error was like wth i didnt notice it for a couple minutes :D just started testing, along with your house modification, other then that great job just make sure you stick to one word :p either guilds or gangs but i would suggest gangs, seeing as it is an mccode modification
-
not very strong on adding links :p
-
no errors, although i did edit a bit just to fix the game but nothing major, its fully functional ;)
-
works perfectly nice add Guest!
-
less cluttered this way... function gang_staff_upgrade_house() { global $db, $ir, $gangdata; $_GET['house'] = isset($_GET['house']) && ctype_digit($_GET['house']) ? abs(@intval($_GET['house'])) : null; if(empty($_GET['house'])) { $selectCurrentHouse = $db->query(sprintf("SELECT `hNAME` FROM `houses` WHERE (`hID` = %u)", $gangdata['gangID'])); echo('Your Coven currently owns the '.stripslashes(htmlspecialchars($db->fetch_single($selectCurrentHouse))).''); echo('<table class="table" width="75%" cellspacing="1"> <tr> <th width="40%">House</th> <th width="20%">Will</th> <th width="30%">Price</th> <th width="10%">Buy</th> </tr>'); $selectHouses = $db->query(sprintf("SELECT * FROM `houses` WHERE (`hID` > %u) ORDER BY `hWILL` ASC", $gangdata['gangID'])); if(!$db->num_rows($selectHouses)) { echo('<tr><td colspan="3" class="center">There are currently no upgrades</td></tr>'); } else { while($row = $db->fetch_row($selectHouses)) { echo ("<tr>"); printf("<td>%s</td>", stripslashes(htmlspecialchars($row['hNAME']))); printf("<td>Will: %s</td>", number_format($row['hWILL'])); printf("<td>\$%s</td>", number_format($row['hPRICE'] * 10)); printf("<td><a href='yourgang.php?action=staff&act2=upgradehouse&house=%u'>Buy</a></td>", $row['hID']); echo "</tr>"; } } echo "</table>"; } else { $select = $db->query(sprintf("SELECT `hNAME`, `hPRICE` FROM `houses` WHERE (`hID` = %u)", $_GET['house'])); if(!$db->num_rows($select)) { die("That house doesn't exist"); } $row = $db->fetch_row($select); $cost = $row['hPRICE'] * 10; if($cost > $gangdata['gangMONEY']) { die("Your gang's vault doesn't have enough for that"); } $db->query(sprintf("UPDATE `gangs` SET `gangMONEY` = `gangMONEY` - %u, `gangHOUSE` = %u WHERE (`gangID` = %u)", $cost, $_GET['house'], $gangdata['gangID'])); gang_event_add($gangdata['gangID'], "The gang house has been upgraded to the ".stripslashes(htmlspecialchars($row['hNAME']))); echo "You've upgraded the gang house to the ",stripslashes(htmlspecialchars($row['hNAME'])); } } also add link under the view house request <a href='yourgang.php?action=staff&act2=upgradehouse'>Upgrade House</a>
-
also need links for the other options... the only link is the Gang house... which asks user if they wanna join, and the other is to view requests... i see no link addition for adding the house or upgrading it...
-
replace line 516 with $select = $db->query(sprintf("SELECT `grrUser` FROM `gangRentalRequests` WHERE ((`grrID` = %u) AND (`grrGang` = %u))", $_GET['ID'], $gangdata['gangID'])); just a little typo error was occurring if its not on that line the just ctrl + f (Find) "wheere"
-
after accepting them into the house you get this... QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '((`grrID` = 1) AND (`grrGang` = 1))' at line 1 Query was SELECT `grrUser` FROM `gangRentalRequests` WHEERE ((`grrID` = 1) AND (`grrGang` = 1))
-
also error on line 500.... printf("<td><a href='yourgang.php?action=staff&act2=decidehousereq&ID=%1$u&dir=accept' style='color:#79A888;'>Accept</a> ยท <a href='yourgang.php?action=staff&act2=decidehousereq&ID=%1$u&dir=decline' style='color:#AF4035;'>Decline</a></td>", $row['grrID']); Warning: printf() [function.printf]: Too few arguments in /home/demonbat/public_html/yourgang.php on line 500 above is line 500...
-
so far i've found a few errors... could be that my server isnt up to date but i know this error is easy fix :D.... be sure to replace your function request_gang_house() with function gang_request_house()
-
gonna have to try this out when i get a chance, nice addon MTG +1 once i've tested it ;)
-
i like cheeeese!!!! lol you've come to the right place for this, however i would like to suggest checking out the Collaborations forum to get some feedback from others experiences and such this way you know a little more about the work people have done. plus it will save you time and money when it comes to finding what you are looking for :)
-
lol indeed i did so w3 is correct! @ MTG lol read the date of posts...
-
Are you currently developing any kind of game?
AnonymousUser replied to Dominion's topic in Question of the day
Both Running & Developing, and sharing the wealth and hiring freelancers :) -
i was working on it but got sidetracked lol however the updated codes are posted just before your post bennyh i've added the stuff MTG suggested aswell... here they are staff_courses.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains course stuffs $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : null; 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) mysql_real_escape_string($_POST['cost'])); $energy=abs((int) mysql_real_escape_string($_POST['energy'])); $comppercent=abs((int) mysql_real_escape_string($_POST['comppercent'])); $percent=abs((int) mysql_real_escape_string($_POST['percent'])); $clicks=abs((int) mysql_real_escape_string($_POST['clicks'])); $perclicks=abs((int) mysql_real_escape_string($_POST['perclicks'])); $cashprize=abs((float) mysql_real_escape_string($_POST['cashprize'])); $crystals=abs((int) mysql_real_escape_string($_POST['crystals'])); $item=abs((int) mysql_real_escape_string($_POST['item'])); $qty=abs((int) mysql_real_escape_string($_POST['qty'])); $str=abs((float) mysql_real_escape_string($_POST['str'])); $agil=abs((float) mysql_real_escape_string($_POST['agil'])); $gua=abs((float) mysql_real_escape_string($_POST['gua'])); $lab=abs((float) mysql_real_escape_string($_POST['lab'])); $iq=abs((float) mysql_real_escape_string($_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; $_POST['step'] = isset($_POST['step']) && is_numeric($_POST['step']) && in_array($_POST['step'], array(0, 1, 2)) ? abs(@intval($_POST['step'])) : null; 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(isset($_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(); ?> 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 '<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(); ?>