Silver Posted May 6, 2007 Posted May 6, 2007 My second free mod! Advanced Warning System Allows staff to give a user a warning with a reason. It also allows edit warnings and remove warnings (owner only; so other staff cant piss around). Once the user has 6 warnings the system will automatically place them in the Federal Jail. Create File: warnings.php Insert: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. SQL: Run this query on the sql tab in phpmyadmin You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Go into viewuser.php Find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace With: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Any problems contact me on msn: [email protected] Enjoy! Quote
nheimberg Posted May 6, 2007 Posted May 6, 2007 Re: [Free v1] Advanced Warning System Thanks. This is a really nice addition and will help keep the staff notes to a minimum. +1 ~Natasha Quote
Silver Posted May 6, 2007 Author Posted May 6, 2007 Re: [Free v1] Advanced Warning System Thankyou, if you have any problems or bugs drop me a pm 8-) Quote
Raptor_Jesus Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System nice a lil auto mailer to the person being warned with the warning and it will be very nice Quote
CraigF Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System for the: -- -- Table structure for table `warnings` -- CREATE TABLE `warnings` ( `id` int(11) NOT NULL auto_increment, `user` int(11) NOT NULL default '0', `warnedfor` text NOT NULL, `warner` int(11) NOT NULL default '0', `time` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; -- -- Dumping data for table `warnings` -- Does it have to have the: -- -- Table structure for table `warnings` -- but there? just wondering :) please dont call me a n00b Quote
oxidati0n Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System Cool, Looks good - I won't be bothered coding it so i'll use it, This is the first lol. +1 Quote
Silver Posted May 7, 2007 Author Posted May 7, 2007 Re: [Free v1] Advanced Warning System for the: -- -- Table structure for table `warnings` -- CREATE TABLE `warnings` ( `id` int(11) NOT NULL auto_increment, `user` int(11) NOT NULL default '0', `warnedfor` text NOT NULL, `warner` int(11) NOT NULL default '0', `time` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; -- -- Dumping data for table `warnings` -- Does it have to have the: -- -- Table structure for table `warnings` -- but there? just wondering :) please dont call me a n00b What do you mean mate? Quote
CraigF Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System what i mean is, when i put that sql in, do i need to have the: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. part and the You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. part in it? or can i just put the sql in as You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Silver Posted May 7, 2007 Author Posted May 7, 2007 Re: [Free v1] Advanced Warning System no kraig u dont need that, just run that main part of the query through the SQL area in ur database Quote
Silver Posted May 7, 2007 Author Posted May 7, 2007 Re: [Free v1] Advanced Warning System you have to view the page through someones profile? did u do that? Quote
Decepti0n Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System kraig You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Anything with '--' before it in an sql query is just a comment, you can run it fine and it wont affect anything Quote
Silver Posted May 7, 2007 Author Posted May 7, 2007 Re: [Free v1] Advanced Warning System what he said :lol: Quote
ignite Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System How would i make it so users can view there warnings in index.php ? I'm finding this quite hard as there not in the user table. Quote
canibalstew Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System well i am sure you could make a table and have it entered as the warnings i am sure there is a user id table there and that should show users warnings i would think maybe not still learning Quote
Silver Posted May 7, 2007 Author Posted May 7, 2007 Re: [Free v1] Advanced Warning System Add this to index where you want it: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Make sure before the $w= you have a "; and the part underneath starts with print example: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
canibalstew Posted May 7, 2007 Posted May 7, 2007 Re: [Free v1] Advanced Warning System and if you want the table that will show why they were warned and such use this also both of these will work good good one silver too fast for me...lol Just put this in your loggedin.php page You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
CraigF Posted May 8, 2007 Posted May 8, 2007 Re: [Free v1] Advanced Warning System kraig You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Anything with '--' before it in an sql query is just a comment, you can run it fine and it wont affect anything Oh thanks, cheers, thanks :) +1 for each Quote
Silver Posted May 8, 2007 Author Posted May 8, 2007 Re: [Free v1] Advanced Warning System yw and thanks for rep :-D Quote
SilverWolf Posted May 16, 2007 Posted May 16, 2007 Re: [mccode] Advanced Warning System yo anyone got this for v2? im2 lazy to make it v2 :) Quote
Silver Posted May 16, 2007 Author Posted May 16, 2007 Re: [mccode] Advanced Warning System haha, lazy git dunno mite be able to convert it Quote
Ghetto Posted May 16, 2007 Posted May 16, 2007 Re: [mccode] Advanced Warning System Ive converted this for V2 ill post it soon if anyone wants it that much. Quote
Silver Posted May 16, 2007 Author Posted May 16, 2007 Re: [mccode] Advanced Warning System thnx Ghetto, saves me doing it... +1 xD Quote
rydog Posted May 16, 2007 Posted May 16, 2007 Re: [mccode] Advanced Warning System really really nice mod, added it to my V2 game with no problems :D big +1 for you playa Quote
rydog Posted May 16, 2007 Posted May 16, 2007 Re: [mccode] Advanced Warning System Create File: warnings.php Insert: Code: <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ include "globals.php"; if($ir['user_level'] < 2) { die("Staff Only!"); } switch($_GET['action']) { case 'add': addwarning(); break; case 'addsub': addwarning2(); break; case 'del': deletewarning(); break; case 'edit': editwarning(); break; case 'edit2': editwarning2(); break; default: index(); break; } function index() { global $ir,$c,$userid; print "<h3>Viewing Warnings For ID: <a href=viewuser.php?u={$_GET['user']}>{$_GET['user']}</a></h3> "; $q=mysql_query("SELECT w.*,u.* FROM warnings w LEFT JOIN users u ON w.warner=u.userid WHERE w.user={$_GET['user']} ORDER BY w.time DESC",$c); print "<center><font color=red><h4>Total Warnings: ".mysql_num_rows($q)." </h4> [<a href=warnings.php?action=add&userid={$_GET['user']}>Add Warning</a>] <table width=90% border=1 align=center><tr><tr style='background: gray'><td>Warned By:</td><td width=40%>Reason</td><td>Date</td><td>Links</td></tr>"; while($r=mysql_fetch_array($q)) { $warned=date('F j, Y, g:i:s a',$r['time']); print "<tr><td><a href=viewuser.php?u={$r['userid']}>{$r['username']}</a></td><td>{$r['warnedfor']}</td><td>$warned</td><td>"; if($ir['userid'] == 1) { print "[<a href=warnings.php?action=del&ID={$r['id']}>Remove</a>] "; } if($ir['warner'] == $userid || $userid == 1) { print "[<a href=warnings.php?action=edit&ID={$r['id']}>Edit</a>]"; } print "</td></tr>"; }} function addwarning() { global $ir,$c,$userid; print "<form action=warnings.php?action=addsub method=post> <input style='visibility: hidden' name=user value={$_GET['userid']}> Reason: <textarea rows=7 cols=30 name=reason></textarea> <input type=submit value='Add warning'></form>"; } function addwarning2() { global $ir,$c,$userid; $_POST['user']=($_POST['user']); $_POST['reason']=($_POST['reason']); mysql_query("INSERT INTO warnings VALUES ('','{$_POST['user']}','{$_POST['reason']}','$userid',unix_timestamp())",$c); $checkfed=mysql_query("SELECT * FROM warnings WHERE user='{$_POST['user']}'",$c); if(mysql_num_rows($checkfed) > 5) { mysql_query("UPDATE users SET fedjail=1 WHERE userid='{$_POST['user']}'",$c); mysql_query("INSERT INTO fedjail VALUES('','{$_POST['user']}','300','$userid','Reached 6 warnings in game. Account jailed.')",$c); } print "Warning Added! [*]<a href=viewuser.php?u={$_POST['user']}>Back to users profile</a>"; } function deletewarning() { global $ir,$c,$userid; if($ir['userid'] != 1) { die("Owner Only");} mysql_query("DELETE FROM warnings WHERE id={$_GET['ID']}",$c); print "Warning Deleted"; } function editwarning() { global $ir,$c,$userid; $target=$_GET['ID']; $edit=mysql_query("SELECT * FROM warnings WHERE id='$target'",$c); while($r=mysql_fetch_array($edit)) { if($r['warner'] != $userid || $userid != 1) { die("You never set this warning, therefore cannot edit it"); } print "<h3>Edit Warning</h3> <form action=warnings.php?action=edit2 method=post> <input style='visibility: hidden;' name=id value=$target> <textarea rows=7 cols=30 name=reason>{$r['warnedfor']}</textarea> <input type=submit value='Edit Warning'></form>"; } } function editwarning2() { global $ir,$c,$userid; mysql_query("UPDATE warnings SET warnedfor={$_POST['reason']} WHERE id={$_POST['id']}",$c); print "Warning Updated. [*]<a href=index.php>Home</a>"; } ?> there it is for V2, everything else is the same as far as the query goes, and the view user entry Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.