
webster2001
Members-
Posts
98 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
webster2001's Achievements
Newbie (1/14)
0
Reputation
-
Can someone tell me how to make each dropdown menu on its own seperate line? Ive been playing with this code now for about 2 hours trying to figure this out Thanks so muchh :)
-
Nice idea to close all pages in one press, Ill add this into my mod later if you dont mind? ;)
-
I have re worked my close page system to make it easier to close pages and open them. staff_pages.php <?php include "sglobals.php"; switch($_GET['action']) { case 'closepagesub': close_page_submit(); break; case 'openpagesub': open_page_submit(); break; case 'pagelist': page_list(); break; default: print "Error: This script requires an action.[url='staff.php']Staff[/url]"; break; } function close_page_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM closedpages WHERE page='{$_POST['page']}'"); $page=$db->fetch_row($d); $db->query("UPDATE `closedpages` SET closed=1 WHERE page='{$_POST['page']}'"); print "The page {$page['page']} was blocked from public access."; stafflog_add("Closed page {$page['page']}"); } function open_page_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM closedpages WHERE page='{$_POST['page']}'"); $page=$db->fetch_row($d); $db->query("UPDATE `closedpages` SET closed=0 WHERE page='{$_POST['page']}'"); print "The page {$page['page']} was unblocked from public access."; stafflog_add("Opened page {$page['page']}"); } function page_list() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } print "<table width='80%' class='table'> <tr><th>Page Address</th><th>Status</th><th>Links</th></tr>"; $q=$db->query("SELECT * FROM closedpages ORDER BY closed DESC, page ASC"); while($r=$db->fetch_row($q)) { print " <tr><td>{$r['page']}</td><td>"; if($r['closed'] == 1) { print "[b]<font color=red>Closed[/b]</font></td><td> <form action='staff_pages.php?action=openpagesub' method='post'> <input type='hidden' name='page' value='{$r['page']}'> <input type='submit' value='Open Page' /></form> "; } else { print "[b]<font color=green>Open</font>[/b]</td><td> <form action='staff_pages.php?action=closepagesub' method='post'> <input type='hidden' name='page' value='{$r['page']}'> <input type='submit' value='Close Page' /></form>"; } print" </td> </tr>"; } print "</table>"; } $h->endpage(); ?> Add this into smenu.php if($ir['user_level'] == 2) { print "<hr /> [b]Pages[/b] [url='staff_pages.php?action=pagelist']Page List[/url] "; } In header.php find if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } add before $php_self=$_SERVER['PHP_SELF']; $closedpage=$db->query("SELECT * FROM `closedpages` WHERE page='$php_self'"); $cp=$db->fetch_row($closedpage); if(!$cp['page']) { $db->query("INSERT INTO `closedpages` VALUES ('$php_self', 0)"); print "[b]PAGE ADDED TO THE CLOSED PAGES LIST[/b]"; } if ($cp['closed'] == 1) { die ("[b]<center><font color=red>This Page is not open to the Public</font> [url='index.php']Go Home[/url][/b]</center>"); } Finally run this SQL in phpmyadmin CREATE TABLE `closedpages` ( `page` text NOT NULL, `closed` smallint(1) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `closedpages` VALUES('/index.php', 0); INSERT INTO `closedpages` VALUES('/loggedin.php', 0); INSERT INTO `closedpages` VALUES('/explore.php', 0); INSERT INTO `closedpages` VALUES('/preferences.php', 0); INSERT INTO `closedpages` VALUES('/criminal.php', 0); INSERT INTO `closedpages` VALUES('/viewuser.php', 0); INSERT INTO `closedpages` VALUES('/search.php', 0); INSERT INTO `closedpages` VALUES('/announcements.php', 0); INSERT INTO `closedpages` VALUES('/gamerules.php', 0); INSERT INTO `closedpages` VALUES('/gym.php', 0); INSERT INTO `closedpages` VALUES('/newspaper.php', 0); INSERT INTO `closedpages` VALUES('/forums.php', 0); INSERT INTO `closedpages` VALUES('/helptutorial.php', 1); INSERT INTO `closedpages` VALUES('/education.php', 0); INSERT INTO `closedpages` VALUES('/preport.php', 0); INSERT INTO `closedpages` VALUES('/inventory.php', 0); INSERT INTO `closedpages` VALUES('/job.php', 0); INSERT INTO `closedpages` VALUES('/halloffame.php', 0); INSERT INTO `closedpages` VALUES('/friendslist.php', 0); INSERT INTO `closedpages` VALUES('/blacklist.php', 0); INSERT INTO `closedpages` VALUES('/staff.php', 0); INSERT INTO `closedpages` VALUES('/yourgang.php', 0); INSERT INTO `closedpages` VALUES('/docrime.php', 0); INSERT INTO `closedpages` VALUES('/bank.php', 0); INSERT INTO `closedpages` VALUES('/jail.php', 0); INSERT INTO `closedpages` VALUES('/jailbust.php', 0); INSERT INTO `closedpages` VALUES('/jailbail.php', 0); INSERT INTO `closedpages` VALUES('/stafflist.php', 0); INSERT INTO `closedpages` VALUES('/searchname.php', 0); Any problems please post them below. Please post feedback as well as i always like to know what you think. :)
-
<option value="">Choose a reason<option value="">Do not understand the work<option value="">Im not active enough<option value="">Abused staff powers<option value="">I want to play normally<option value="">Too much responsibilty<option value="">Other</select></td></tr><tr><td><input type="submit" name="doit" value="Submit Reason" /></td></tr></form></table>';$h->endpage();exit();};echo'Are you sure you would like to resign from being a staff member? <table width="60%" class="table"><form action="" method="get"><tr><td><input type="submit" name="resign" value="Yes" /></td></tr><tr><td><input type="submit" value="No" onmouseclick="document.location.href=\''index.php'" /></td></tr></form></table>';$h->endpage();?> Ive now updated the code to include a reason, Just requires someone to test it now :) Cheers people PS Why when i post a code in here does it compress it all to just like 4 lines? :S
-
Thanks danny, havent done coding for a while but i been using bbcode :S Thanks for fixing it up though :) ;) And Renkia, Im working on the reason now :)
-
Create a file called staffresign.php <?phpinclude "globals.php"if($ir['user_level']==1){ print "[b]You should not be on this page[/b] [url='index.php']> Go Back[/url]";}switch($_GET['action']){case 'do':do();break; default:resign();break;} function resign(){global $db,$ir,$c,$userid,$h;print "[b]Your current staff level is:[/b]";if($ir['user_level'] == 2){print "Admin";}elseif($ir['user_level'] == 3){print "Secretary";}elseif($ir['user_level'] == 5){print "Assistant";}print "[b]Are you sure you want to resign from being a staff member?[/b] [url='staffresign.php?action=do']> Yes[/url] [url='index.php']> No[/url]";} function do(){global $db,$ir,$c,$userid,$h;stafflog_add("Resigned from being a staff member");$db->query("UPDATE users SET user_level='1' WHERE userid='$userid'");print "You have resigned from being a staff member.";}?> I have not tested this yet as i do not have a game to try it on. I will be testing it out later and hopefully it works. Please post what you think and any errors.
-
Re: April Fools Joke [MCCODE V2] Thanks Congrats on 200 Posts :)
-
Re: April Fools Joke [MCCODE V2] OK then :( LOL Also remember guys, dont put this up till April 1st and also remove it at Midday :)
-
I decided to make a little April fools joke for the members of my game, just to annoy them :P Contains: - 1 D/B Query - 1 PHP file - 1 PHP file Edit Run this in phpMyAdmin: ALTER TABLE `users` ADD `aprilfools` smallint(1) NOT NULL default '0'; Create file "reward.php": <?php include "globals.php"; if ($ir['aprilfools']) { die (" You have already done this!. [url='explore.php']Back[/url]<hr width='90%'>"); } switch ($_GET['action']) { case 'fools': april_fools(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; print " <table width='70%' class='table'> <tr><th width='33%'>Reward Number</th><th width='34%'>What you gain</th><th width='33%'>Get!</th></tr> <tr><td>#1</td><td>\$100,000!</td><td>[url='reward.php?action=fools']> Get reward number 1[/url]</td></tr> <tr><td>#2</td><td>100 Crystals!</td><td>[url='reward.php?action=fools']> Get reward number 2[/url]</td></tr> <tr><td>#3</td><td>\$50,000 & 50 Crystals!</td><td>[url='reward.php?action=fools']> Get reward number 3[/url]</td></tr> <tr><td>#4</td><td>1,000 in every stat!</td><td>[url='reward.php?action=fools']> Get reward number 4[/url]</td></tr>"; } function april_fools() { global $db,$ir,$c,$h,$userid; $db->query("UPDATE users SET aprilfools=aprilfools+1 WHERE userid='$userid'"); print " [b]<font size=8 color=red>APRIL FOOLS!</font>[/b] [url='index.php']> Go home[/url]"; } $h->endpage; ?> Save Reward.php Open header.php and find: if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>"); } After it add: if (!$ir['aprilfools']) { print "<center[b]You can claim a reward below! [url='reward.php']Claim![/url]</center>[/b] "; } Then your done :) Hope you use this :) Any erros please post back. Thanks
-
Working Close Page System [MCCODE V2]
webster2001 replied to webster2001's topic in Free Modifications
Re: Working Close Page System [MCCODE V2] Good idea :-P Might add that in later when i have the spare time. Then you dont need the if($ir['jail']) etc... part. :) -
I Know this has been done before but i decided to make my own and make it available for you to use. Contains: - 1 php file - 2 php file edits - 1 D/B SQL Ive tested this for MCCODE V2 and it works on my site so heres the code: Edit file header.php Find: if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } Add Before it: $php_self=$_SERVER['PHP_SELF']; $closedpage=$db->query("SELECT * FROM `closedpages` WHERE page='$php_self'"); $cp=$db->fetch_row($closedpage); if(!$cp['page']) { $db->query("INSERT INTO `closedpages` VALUES ('$php_self', 0)"); print "[b]PAGE ADDED TO THE CLOSED PAGES LIST[/b]"; } if ($cp['closed'] == 1) { die ("[b]<center><font color=red>This Page is not open to the Public</font> [url='index.php']Go Home[/url][/b]</center>"); } SAVE FILE! Open global_func.php Find $h->endpage; ?> Replace with function closedpages_dropdown($connection,$ddname="item",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM closedpages ORDER BY page ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['page']}'"; if ($selected == $r['page'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['page']}</option>"; } $ret.="\n</select>"; return $ret; } function closepages_dropdown($connection,$ddname="item",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM closedpages WHERE closed=1 ORDER BY page ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['page']}'"; if ($selected == $r['page'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['page']}</option>"; } $ret.="\n</select>"; return $ret; } $h->endpage; ?> Save That file Create staff_pages.php <?php include "sglobals.php"; switch($_GET['action']) { case 'closepage': close_page_form(); break; case 'closepagesub': close_page_submit(); break; case 'openpage': open_page_form(); break; case 'openpagesub': open_page_submit(); break; default: print "Error: This script requires an action."; break; } function close_page_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print " The page you select will be blocked from public access until you select to re-open it. <form action='staff_pages.php?action=closepagesub' method='post'> Page: ".closedpages_dropdown($c,'page')." <input type='submit' value='Close Page!' /></form>"; } function close_page_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM closedpages WHERE page='{$_POST['page']}'"); $page=$db->fetch_row($d); $db->query("UPDATE `closedpages` SET closed=1 WHERE page='{$_POST['page']}'"); print "The page {$page['page']} was blocked from public access."; stafflog_add("Closed page {$page['page']}"); } function open_page_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print " The page you select will be unblocked from public access until you select to re-open it. <form action='staff_pages.php?action=openpagesub' method='post'> Page: ".closepages_dropdown($c,'page')." <input type='submit' value='Close Page!' /></form>"; } function open_page_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM closedpages WHERE page='{$_POST['page']}'"); $page=$db->fetch_row($d); $db->query("UPDATE `closedpages` SET closed=0 WHERE page='{$_POST['page']}'"); print "The page {$page['page']} was unblocked from public access."; stafflog_add("Opened page {$page['page']}"); } $h->endpage(); ?> Save. Open smenu.php Add in where you wish if($ir['user_level'] == 2) { print " [url='staff_pages.php?action=openpage']Open Page[/url] [url='staff_pages.php?action=closepage']Close Page[/url] "; } Run this in phpMyAdmin CREATE TABLE `closedpages` ( `page` text NOT NULL, `closed` smallint(1) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `closedpages` VALUES('/index.php', 0); INSERT INTO `closedpages` VALUES('/loggedin.php', 0); INSERT INTO `closedpages` VALUES('/explore.php', 0); INSERT INTO `closedpages` VALUES('/preferences.php', 0); INSERT INTO `closedpages` VALUES('/criminal.php', 0); INSERT INTO `closedpages` VALUES('/viewuser.php', 0); INSERT INTO `closedpages` VALUES('/search.php', 0); INSERT INTO `closedpages` VALUES('/announcements.php', 0); INSERT INTO `closedpages` VALUES('/gamerules.php', 0); INSERT INTO `closedpages` VALUES('/gym.php', 0); INSERT INTO `closedpages` VALUES('/newspaper.php', 0); INSERT INTO `closedpages` VALUES('/forums.php', 0); INSERT INTO `closedpages` VALUES('/helptutorial.php', 1); INSERT INTO `closedpages` VALUES('/education.php', 0); INSERT INTO `closedpages` VALUES('/preport.php', 0); INSERT INTO `closedpages` VALUES('/inventory.php', 0); INSERT INTO `closedpages` VALUES('/job.php', 0); INSERT INTO `closedpages` VALUES('/halloffame.php', 0); INSERT INTO `closedpages` VALUES('/friendslist.php', 0); INSERT INTO `closedpages` VALUES('/blacklist.php', 0); INSERT INTO `closedpages` VALUES('/staff.php', 0); INSERT INTO `closedpages` VALUES('/yourgang.php', 0); INSERT INTO `closedpages` VALUES('/docrime.php', 0); INSERT INTO `closedpages` VALUES('/bank.php', 0); INSERT INTO `closedpages` VALUES('/jail.php', 0); INSERT INTO `closedpages` VALUES('/jailbust.php', 0); INSERT INTO `closedpages` VALUES('/jailbail.php', 0); INSERT INTO `closedpages` VALUES('/stafflist.php', 0); INSERT INTO `closedpages` VALUES('/searchname.php', 0); Not all files are included but when someone visits a page that is not in the database, it will automatically add that page. This should work. Any errors please post back. Please post any feedback, Negative or Positive :)
-
Re: [V2]My own v2 Explore page [V2] Why so many print's??? just replace it with [url='crystaltemple.php']Crystal Temple[/url] "; print "[url='battletent.php']Battle Tent[/url] "; print "[url='polling.php']Polling[/url] "; print " [url='carnival.php']Carnival[/url] "; print " [url='drugs.php']Drugs[/url] "; print "[url='youtube.php']Youtube[/url] "; print " [url='brothel.php']Brothel[/url] "; print "</td>
-
Re: [MCCODE V2] User Competitions Here is the fixed files: :-D Create createcomp.php <?php include "globals.php"; if($ir['money'] < 500000) { die("You don't have enough money. You need \$100,000."); } if($ir['compown']) { die ("You are already running a competition!"); } if($_POST['submit']) { $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $db->query("INSERT INTO competitiona VALUES('','$name','$desc','{$ir['username']}','$cash','$crys','$item','$fee','$time','')"); $i=$db->insert_id(); $cost=$cash+100000 $db->query("UPDATE users SET compown=$i,money=money-$cost,crystals=crystals-$crys where userid=$userid"); print "Competition created!"; } else { print "<h3> Create A Competition </h3> <form action='creategang.php' method='post'><input type='hidden' name='submit' value='1' /> Name:<input type='text' name='name' /> Description: <textarea name='desc' cols='40' rows='7'></textarea> Entry Fee:<input type='text' name='fee' /> Cash Reward:<input type='text' name='cash' /> Crystals Reward:<input type='text' name='cash' /> Hours:<input type='text' name='time' /> Item: ".item_dropdown($c,'item')." <input type='submit' value='Create Competition for \$100,000' /></form>"; } $h->endpage(); ?> Save createcomp.php Create createcomp.php <?php include "globals.php"; if($ir['money'] < 500000) { die("You don't have enough money. You need \$100,000."); } if($ir['compown']) { die ("You are already running a competition!"); } if($_POST['submit']) { $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $db->query("INSERT INTO competitiona VALUES('','$name','$desc','{$ir['username']}','$cash','$crys','$item','$fee','$time','')"); $i=$db->insert_id(); $cost=$cash+100000 $db->query("UPDATE users SET compown=$i,money=money-$cost,crystals=crystals-$crys where userid=$userid"); print "Competition created!"; } else { print "<h3> Create A Competition </h3> <form action='creategang.php' method='post'><input type='hidden' name='submit' value='1' /> Name:<input type='text' name='name' /> Description: <textarea name='desc' cols='40' rows='7'></textarea> Entry Fee:<input type='text' name='fee' /> Cash Reward:<input type='text' name='cash' /> Crystals Reward:<input type='text' name='cash' /> Hours:<input type='text' name='time' /> Item: ".item_dropdown($c,'item')." <input type='submit' value='Create Competition for \$100,000' /></form>"; } $h->endpage(); ?> Save createcomp.php