Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- Created by TheMasterGeneral.
- Forum Warning Mod.
- Cost: FREE
- File: /forumwarn.php
- Info: This mod can be used to warn forum posters for doing actions.
- The warning will be sent to their events. This mod will not
- auto-ban, its just a way to warn users.
- I expect this to be buggy and lacking security. If bugs arise, please report them
- ASAP!!! Thanks!
- Also, be sure to check out line #
- you will need to edit in your game's
- intials OR name. (You won't have to
- if your game is abbreviated to CID)
- Extra steps that need to be taken: Make sure to link this somewhere in your
- staff panel. The page is set so that anyone with staff powers can use this
- page. If you wish to have it set up like how mine is, open your smenu.php
- and find:
- > <a href='staff_punit.php?action=unmailform'>Un-Mailban User</a><br />
- and under it, paste:
- > <a href='forumwarn.php'>Forum Warn</a><br />
- */
- include"globals.php";
- //Test for proper staff levels.
- if ($ir['user_level'] <= 1)
- {
- echo 'You do not have permission to be here.';
- $h->endpage();
- }
- //Continue
- print'<h2>Forum Warning</h2>';
- //To secure ID input.
- //I don't know of any thing in MCC that has userids as something like 233.097
- $id = abs(intval($_POST['ID']));
- //Print the page.
- //Escape the POST. This doesn't get inserted into the db and people are viewing it as well
- $reason = $db->escape(trim($_POST['Reason']));
- //Make sure they input a reason greater than maybe 5 chars?
- if(!isset($id) && strlen(trim($reason)) >= 5) {
- print "Use to warn a user from the CID Forums. This will not auto-ban the user. Please remember that abusing this system will get you removed as staff
- and you will be placed in the federal jail.<br><br><br><br>
- <br>
- <br>
- <form action='forumwarn.php' method='post'>
- User id: <input type='text' name='ID' />
- <br>
- <form action='forumwarn.php' method='post'>
- Reason: <input type='text' name='Reason' /><br>
- <br>
- <input type='submit' value='Submit' />
- </form>";
- } else {
- //No need to fetch the row you can just do a simple num_rows()
- $mems = $db->query("SELECT `userid` FROM `users` WHERE `userid` = ".$id);
- if($db->num_rows($mems) <= 0)
- {
- echo "Invalid ID specified. Try again.";
- //kill the script so it doesn't keep running
- exit($h->endpage());
- }
- //Add event.
- event_add($id,"You have been warned from the CID Forums for the following reason: {$reason} ",$c);
- //Add stafflog.
- stafflog_add("Forum Warned User ID {$id}
- from the forums for {$reason}!");
- //Stafflog entry.
- echo "User ID #{$id} has been forum warned for the following reason:
- <i>{$reason}</i>.
- <br><br>Please remember that abusing this system will get you removed as staff
- and you will be placed in the federal jail.";
- /**
- Lines 63 and 64 couple lines aren't needed, but serve as
- a warning for those who think its okay
- to abuse this system. Abusing this system
- won't really break the game, but its more
- so abuse on the lines of harassment.
- */
- }
- $h->endpage();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement