-
Posts
2,667 -
Joined
-
Last visited
-
Days Won
75
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: New Houses Mod [Mccodes V2] Just for future Reference try to keep the CASES types in the same order as your Functions that way you will kill 99% of function errors. Most common errors for functions are missing $db from a global. if you experience a unexpected endpage error thats usually caused by a missing { or } usually place these at the very end of a function or before the endpage statement
-
Re: New Houses Mod [Mccodes V2] as well as what youve just mentioned your Functions are also causing the issues. I'll post a fix for you in a sec... This should fix the Functions error <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; case "addupgrade": addupgrade(); break; case "editupgrade": editupgrade(); break; case "delupgrade": delupgrade(); break; case "delupgradesub": delupgradesub(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $name=$_POST['name']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL=$will, hPRICE=$price, hNAME='$name' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")." <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")." <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } function addupgrade() { global $db, $ir, $c, $h, $userid; $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $uname=$_POST['name']; if($uprice and $uwill and $uname) { $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeName='{$_POST['name']}'"); if($db->num_rows($q) != 0) { print "<h3>Sorry, you cannot have two upgrades with the same name.</h3> "; $h->endpage(); exit; } $db->query("INSERT INTO house_upgrades VALUES(NULL, '$uname', '$uprice', '$uwill')"); print "<h3>House upgrade {$uname} added to the game.</h3> "; stafflog_add("Created House Upgrade $uname"); } else { print "<h3>Add House Upgrade</h3> <form action='staff_houses.php?action=addupgrade' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> <input type='submit' value='Add Upgrade' /></form>"; } } function editupgrade() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeMood={$uwill} AND upgradeId!={$_POST['upgrade']}"); if($db->num_rows($q)) { print "<h3>Sorry, you cannot have two upgrades with the same maximum will.</h3> "; $h->endpage(); exit; } $uname=$_POST['name']; $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); if($old['upgradeMood'] == 100 && $old['upgradeMood'] != $uwill) { die("Sorry, this house's upgrade cannot be edited."); } $db->query("UPDATE house_upgrades SET upgradeMood=$uwill, upgradeCost=$uprice, upgradeName='$uname' WHERE upgradeId={$_POST['upgrade']}"); //$db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); //$db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<h3>House upgrade \"$uname\" was edited successfully.</h3> "; stafflog_add("Edited house upgrade $uname"); break; case "1": $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); print "<h3>Editing house Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='upgrade' value='{$_POST['upgrade']}' /> Name: <input type='text' name='name' value='{$old['upgradeName']}' /> Price: <input type='text' name='price' value='{$old['upgradeCost']}' /> Max Will: <input type='text' name='will' value='{$old['upgradeMood']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing an Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='1' /> House: ".upgrade_dropdown($c, "upgrade")." <input type='submit' value='Edit Upgrade' /></form>"; break; } } function delupgrade() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>House House Upgrade</h3> The upgrade will be permanently removed from the game. <form action='staff_houses.php?action=delupgradesub' method='post'> Item: ".upgrade_dropdown($c,'upgrade')." <input type='submit' value='Delete Upgrade' /></form>"; } function delupgradesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($d); $db->query("DELETE FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); print "<h3>The \"{$old['upgradeName']}\" Upgrade was removed from the game.</h3>[url='staff_houses.php?action=delupgrade']>Back[/url]"; stafflog_add("Deleted house upgrade {$old['upgradeName']}"); } $h->endpage(); ?>
-
Re: Help needed will pay! open up your old config.php file change the cron name from there and let it match the ones on your new server JOB done and that didnt cost a penny lol
-
Re: New Houses Mod [Mccodes V2] the hSELLPRICE was for a mod i made so admins could set a sell price to houses on the market if you used my mod you may want to check the file called staff_houses.php and estate.php for any mention of hSELLPRICE
-
Re: New Houses Mod [Mccodes V2] Post me your script thats has the error to my mailbox and the SQLS your using for houses and i'll take a look
-
Re: Street Images Its the small things that make a big difference to a script and how it looks :) if you wanted to create a button then you could always goto www.grsites.com for your buttons and banners you can create your own styles has some nice effects aswell
-
Re: Street Images Nicely done Chika :)
-
Re: New Houses Mod [Mccodes V2] QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO houses VALUES(NULL, 'Test', '10000', '1000') Again this usually measn that the SQLS on your PHPMYADMIN are not the same as those you are trying to INSERT from a script.. Check the number of tables in your PHPMYADMIN for the dbase houses.. Then check the INSERT on your script you may have one more or less than one another...
-
Re: New Houses Mod [Mccodes V2] check the global too make sure it has a $db, aswell as the $ir Fatal error: Call to undefined function usually means theres a missing $db on a global example global $ir; would become global $db, $ir;
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling You dont have to add them to the cron_hour if your just testing just create a new cron say for 5 mins and add the cron scripts to that if your just testing just call the cron schooling_cron.php -
Re: Help with Jailing try this <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; print "<div id='content'>"; if($ir['jail'] or $ir['hospital']) { die(" <prb>This page cannot be accessed while in jail or hospital.</prb> [url='index.php']> Home[/url]"); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print " <prb>ERROR! - Invalid crime</prb> [url='index.php']> Home[/url]"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print " <prb>You do not have enough Brave to perform this crime.</prb> [url='index.php']> Home[/url]"; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print "<h1>".$r['crimeNAME']."</h1><hr width='90%' align='left' /> ".$r['crimeITEXT']."</p> "; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print " ".str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT'])."</p>"; $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print "<p class='crimefail'>".$r['crimeFTEXT']."</p>"; } else { print "<p class='crimejail'>".$r['crimeJTEXT']."</p>"; $db->query("UPDATE users SET jail=jail+1 WHERE userid=$userid"); $db->query("UPDATE users SET busted=busted+1 WHERE userid=$userid"); $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); $h->endpage(); exit; } } print " [url='docrime.php?c={$_GET[']> Try Again[/url]</p> [url='criminal.php']> Back to Crimes[/url]</p>"; } } $h->endpage(); ?>
-
Re: [mccode v2] Improved Security on Attack System Im a bit lost here or maybe im tired.. But usually a switch uses two actions 0=off 1=on My question is when someone is attacking which of the switches tells the SQL that they are no longer in a fight and can leave the screen ? As i can see the deafult is 1 and 1 being that they are atacking ?
-
Re: House Images Help It would depend on what you have named the table for house pics to show on your MYSQL if its hsepics <<< EXAMPLE then on your index page you would need to put in place If the pic is in an image folder say IMAGES then you would need to add this
-
[MMCODE V2] Set Sell Price of houses after they are Purchased...
Uridium replied to Uridium's topic in Free Modifications
Re: [MMCODE V2] Set Sell Price of houses after they are Purchased... Cheers guys for the updates :) hope it wasnt my script working failing me again lol -
if this has already been done then ya can delete me post if not then this mod will allow STAFF to set a sell price for each house they create. just add this SQL to the remaining houses SQLS ALTER TABLE houses ADD hSELLPRICE BIGINT(90) NOT NULL; Overwrite you old staff_houses.php with this one.. <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $sellprice=abs((int) $_POST['sellprice']); $will=abs((int) $_POST['will']); $name=$_POST['name']; $pic=$_POST['pic']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$sellprice', '$will', '$pic')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Sell Price: <input type='text' name='sellprice' /> Max Will: <input type='text' name='will' /> Pic: <input type='text' name='pic' /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $sellprice=abs((int) $_POST['sellprice']); $will=abs((int) $_POST['will']); $pic=$_POST['pic']; $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL='$will', hPRICE='$price', hSELLPRICE='$sellprice', hNAME='$name', hPIC='$pic' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> Sell Price: <input type='text' name='sellprice' value='{$old['hSELLPRICE']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /> Pic: <input type='text' name='pic', value='{$old['hPIC']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")." <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")." <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> Now in your estate.php look for $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=150,maxwill=150 WHERE userid=$userid",$c); and overwrite with. $db->query("UPDATE users SET money=money+'{$np['hSELLPRICE']}',will=150,maxwill=150 WHERE userid=$userid",$c); print "You sold your {$np['hNAME']} for \$$j".money_formatter($r['hSELLPRICE'],'')." Minus Lawyer fees and went back to your shed."; Dont forget to add a new table name called SELL HOUSE. and overwrite this <tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>{$r['hWILL']}</td> with this <tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>\$$j".money_formatter($r['hSELLPRICE'],'')."</td> <td>{$r['hWILL']}</td> And your done...
-
[MCCODES V2] Stop Users Refreshing attack pages / Leaving Fight
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] Stop Users Refreshing attack pages / Leaving Fight die ("Continue Fight"); -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling When you create a new Education are all the Parts you added avilable. goto EDIT the education youve just made and see if any are set to zero and not like the ones you created... -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game FF can be a pain in the rase ive downloaded the plugin 5 times for the lpayer and its stillsa ying i havent got it.. best to use IE or Google Chrome :) -
Re: Great Potential Im going to give you +1 for making something unique and hope you will sahre more scripts. :)
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling for those having issues with the updating of the hourly cron add $db->query("UPDATE users SET minus_clicks=0"); $db->query("UPDATE users SET clickend=0"); -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Seems i made a mistake on the staff_courses so back itup and overwrite with this one. <?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']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); if($_POST['name'] && $_POST['desc'] && $cost && $cashprize && $item && $qty) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$cashprize', '$item', '$qty', '$energy', '$comppercent', '$percent', '$clicks', '$perclicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added."; stafflog_add("Added course {$_POST['name']}"); } else { print "<h3>Add Course</h3><hr /> <form action='staff_courses.php?action=addcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <th>Course Name: <input type='text' name='name' /> </th> <th>Course Description: <input type='text' name='desc' /> </th> <th>Starting Text: <input type='text' name='starting' /> </th> <th>Completed Text: <input type='text' name='completed' /> </th> <th>Course Target Percent: <input type='text' name='compperent' /> example 100% - 10000% </th></tr> <th>Percent Gain: <input type='text' name='percent' /> Example 1 to 99999 </th> <th>Clicks Per Day: <input type='text' name='clicks' /> Example 18 </th> <th>Clicks Per Session: <input type='text' name='perclicks' /> Example 3 Per Session </th> <th>Cost (Money): <input type='text' name='cost' /> </th> <th>Cash Prize: <input type='text' name='cashprize' /> </th></tr> <th>Item Prize: <input type='text' name='item' /> Enter Inventory item ID </th> <th>Quantity: <input type='text' name='qty' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th> <th>Strength Gain: <input type='text' name='str' /> </th> <th>Agility Gain: <input type='text' name='agil' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' /> </th> <th>Labour Gain: <input type='text' name='lab' /> </th> <th>IQ Gain: <input type='text' name='iq' /> </th> <input type='submit' value='Add Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE courses SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crITEM=$item, crQTY=$qty, crENERGY=$energy, crCOMPPERCENT=$comppercent, crPERCENT=$percent, crCLICKS=$clicks, crPERCLICKS=$perclicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "<h1>Course $name was edited successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> <th>Name: <input type='text' name='name' value='{$old['crNAME']}' /> </th> <th>Description: <input type='text' name='desc' value='{$old['crDESC']}' /> </th> <th>Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> </th> <th>Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> </th> <th>Course Target(percent): <input type='text' name='comppercent' value='{$old['crCOMPPERCENT']}' /> </th></tr> <th>Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> </th> <th>Clicks Per Day : <input type='text' name='clicks' value='{$old['crCLICKS']}' /> </th> <th>Clicks Per Session: <input type='text' name='perclicks' value='{$old['crPERCLICKS']}' /> </th> <th>Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> </th> <th>Cash Prize : <input type='text' name='cashprize' value='{$old['crCASHPRIZE']}' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> </th> <th>Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> </th> <th>IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> </th> <input type='submit' value='Edit Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT ANOTHER COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM courses WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted. [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE ANOTHER COURSE ][/url]"; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url]"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Cheers Badgirl there isnt an ARRAY hidden in there somewhere is there lol OOPS only joking lol -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Cheers matey i was never any good at adding SQLS i usually do them whilst in phpmyadmin and never take not of the correct procedure :) -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game UPDATE TURN VIDEO PREVIEWING ON OR OFF + SEARCH FOR MEDIA This will allow your users to Turn off or on the video Preview mode which is seen from the videos.php screen SQL ALTER TABLE 'users' ADD 'preview' INT( 2 ) NOT NULL DEFAULT '0'; now open up preferences.php Add this with the rest of the LINKS.. Turn Video Preview: [url='preferences.php?action=previewon']ON[/url] or [url='preferences.php?action=previewoff']OFF[/url] "; In the CASE section add case 'previewon': preview_on(); break; case 'previewoff': preview_off(); break; at the bottom of the page add function preview_on() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET preview=0 WHERE userid=$userid"); Print"<h2> Video Previewing Enabled</h2> [url='index.php']Return To Game[/url] or [url='videos.php']Goto Videos[/url]"; } function preview_off() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET preview=1 WHERE userid=$userid"); Print"<h2> Video Previewing Disabled</h2> [url='index.php']Return To Game[/url] or [url='videos.php']Goto Videos[/url]"; } overwrite videos.php with this one... <?php include "globals.php"; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'tracktitle'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; if($ir['preview']==0) { print "<h3>Videos</h3>"; print "<form action='searchvideo.php' method='get'><input type='text' name='searchvideo' /><input type='submit' value='Search Video' /></form>"; $cnt=$db->query("SELECT * FROM videos",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*10; print "[url='videos.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='videos.php?st=$st&by=videoalphabet&ord=$ord']Alphabet Letter[/url] | [url='videos.php?st=$st&by=artist&ord=$ord']artist[/url] | [url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Title[/url] [url='videos.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='videos.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT * FROM videos ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+10; print "Showing Videos $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>[url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Name[/url]</th><th>[url='videos.php?st=$st&by=artist&ord=$ord']Artists Name[/url]</th><th>[url='videos.php?st=$st&by=videoalphabet&ord=$ord']Letter[/url]</th><th>Preview</th><th>[url='videos.php?st=$st&by=source&ord=$ord']Source[/url]</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['tracktitle']) { $r['artist'] = "<font color=yellow>{$r['artist']}</font>";$d=""; } print "<tr><td>{$r['tracktitle']}</td><td>[url='playvideo.php?u={$r[']{$r['artist']}[/url]</td><td>{$r['videoalphabet']}</td><td><center><embed src='{$r['playerswflink']}' width='100' height='100' allowsiptallowaccess='{$r['videophplink']}' allowfullseen='true' flashvars='height=100&width=100&file={$r['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight=100&autostart='false'/></a></embed><td>{$r['source']}</td></center> </td>"; print "</td></tr>"; } print "</table>"; } else if($ir['preview']==1) { print "<h3>Videos</h3>"; print "<form action='searchvideo.php' method='get'><input type='text' name='searchvideo' /><input type='submit' value='Search Video' /></form>"; $cnt=$db->query("SELECT * FROM videos",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*10; print "[url='videos.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='videos.php?st=$st&by=videoalphabet&ord=$ord']Alphabet Letter[/url] | [url='videos.php?st=$st&by=artist&ord=$ord']artist[/url] | [url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Title[/url] [url='videos.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='videos.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT * FROM videos ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+10; print "Showing Videos $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>[url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Name[/url]</th><th>[url='videos.php?st=$st&by=artist&ord=$ord']Artists Name[/url]</th><th>[url='videos.php?st=$st&by=videoalphabet&ord=$ord']Letter[/url]</th><th>[url='videos.php?st=$st&by=source&ord=$ord']Source[/url]</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['tracktitle']) { $r['artist'] = "<font color=yellow>{$r['artist']}</font>";$d=""; } print "<tr><td>{$r['tracktitle']}</td><td>[url='playvideo.php?u={$r[']{$r['artist']}[/url]</td><td>{$r['videoalphabet']}</td><td>{$r['source']}</td></center> </td>"; print "</td></tr>"; } print "</table>"; } $h->endpage(); ?> And create a file called searchvideo.php <?php include "globals.php"; if(!$_GET['searchvideo']) { print "You did not enter anything! [size="1"]> [/size][url='videos.php']Back[/url]"; } else { $video=$db->query("SELECT * FROM videos WHERE artist LIKE ('%{$_GET['searchvideo']}%')"); print $db->num_rows($video)." Search Results <table width=75% border=1 cellspacing=0> <th bgcolor=#000000>Artist</th> <th bgcolor=#111111>Video Track</th> <th bgcolor=#222222>Watch</th> </tr>"; while($ir=$db->fetch_row($video)) { print "<tr> <td bgcolor=#999999>{$ir['artist']}</a></td> <td bgcolor=#999999>{$ir['tracktitle']}</a></td> <td bgcolor=#999999><center>[[url='playvideo.php?u={$ir['][size="1"]<font color=yellow>Watch</font>[/size][/url]]</center></td> </tr>"; } print "</table> [size="1"]> [/size][url='videos.php']Back[/url]"; } $h->endpage(); ?> -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Let me grab my copy off the FTP the one i posted is one from my PC i may have edited that before hand gizza sec.