Version: 1.00, by Zero Tolerance
Developer Last Online: Nov 2023
Version: 3.0.3
Rating:
Released: 05-19-2004
Last Update: 07-12-2004
Installs: 161
No support by the author.
Version 1.5 Note: You must have v1 installed to upgrade, the upgrade process is small so there was no need to write out a fresh install.
It has come to my attention that a "decent" warning system isn't available here on vbulletin.org, which is quite a shame, and because forums like mine, and probably yours need a simple yet advanced warning system to keep things under wraps
Anyway, i thought i might aswell release what i made, prior to me getting off my ass... lol
Administration Features:
View Warning Logs
- Displays all warnings, warned user, warned by, link to the warned post, date, warning type, and the comment specified when the warning was given, and a remove warning link
(Remove will remove the log and also put the members warning level back down in accordance to how much it was increased by the selected warning removed)
Unban Banned Members
- A simple page that you should visit every few days, it will automatically ban any auto banned users by the warning system where there ban time has expired
Warning Options
- Here you can set the following:
-- Number of warn points before member is auto banned
-- Number of days a member is auto banned for
-- View Warnign Types
-- Add Warning Type
-- Add warning type has the following fields:
---- Name/Description/Warn Points Given
Forum Features:
Every post has "Warn [Name]" and "View [Names] Warnings"
These are only accessiable by a member group which is allowed to "moderate" (Moderating groups are auto detected)
Clicking the Warn link will bring you to a page where you view the user your warning, a link to review the warned post, members current warning level, and below the warning types, has a drop down menu to select the warning type, and a text field to put your comment for why this warning is been issued
Upon completing the warning form, the warned user will be Pm'ed from the person who warned them, with the comment put down and a link to the post
View Warnings link will display logs of only that specified user's warnings, the same features as the admin cp warning logs, only just for this user
Members can access only 1 page of the warning system, which is "View My Warnings", this link is added to the quick links drop down menu
Here they simple view there warnings, just like a moderator would, only without the remove warning link
V1.5 Features:
Protectable Usergroups:
No user's in these defined groups can be warned, or banned.
Root Admin Force Protection:
Userid 1 cannot be warned, canned be banned, this is not optional, this is forced for security.
New Unban Members Set Up:
Now displays all currently banned user's, what time they were banned, what time they are supposed to be unbanned. You may unban the user even if there time has not expired (You will be notificed if they have not served the time issued upon ban, but not stopped). Upon unbanning, you choose the members 'new' warning level and the user's usergroup to move them into
Set banned usergroup:
You can now easily choose from a drop down menu which usergroup user's are sent to if after been warned they are banned.
V1.5 Bug Fixes:
- User locations in 'Users online' shown as unknown if they are warning/viewing warnings (Priority: Medium)
- Unban members system renovated and now fully works (Priotity: Maximum)
- No mysql errors upon sending a pm if the PM table had been altered (Priotity: Maximum)
- New protectable usergroups to stop any group of your choice been banned (Priotity: Maximum)
- Last time visited didn't appear when error page occured (Priotity: Low)
- Un-used global in PM function (Priority: Low)
I hope you enjoy the system, my staff teamare very pleased with it and find it of great use, enjoy the hack
- Zero Tolerance
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I see warning options on each post but when a member clicks on these links he gets no permission message. What is use of showing it when they can not view it. Is there any option which makes it possible only for admin to view those links on each post or can an admin give permissions for users to view their warnings. i am a newbie, so kindly bear with me, please guide me.
I see warning options on each post but when a member clicks on these links he gets no permission message. What is use of showing it when they can not view it. Is there any option which makes it possible only for admin to view those links on each post or can an admin give permissions for users to view their warnings. i am a newbie, so kindly bear with me, please guide me.
Best Regards
Regards
It all depends on your postbit conditionals. If you use the conditionals below, the admins and mods can see the "Warn XYZ" and "View XYZ Warnings", but a normal member can only see the "View my warnings" link.
PHP Code:
<if condition="$post[usergroupid]!=6 AND $post[usergroupid]!=7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])"><a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'>Warn $post[username]</a> ?
</if>
<if condition="$post[usergroupid]!=6 AND $post[usergroupid]!=7 AND ($bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==6)">
<a href='Warn.php?do=ViewWarnings&id=$post[userid]'>View $post[username]'s Warnings</a> ?</if>
<if condition="$post[userid]==$bbuserinfo[userid] AND $post[usergroupid]==2 AND $post[warning_level]>0">
<a href='Warn.php?do=ViewMyWarnings'>View your Warnings</a> ?</if>
Oh yes, the moderators can see the "Warn XYZ" link, only in the forums they are assigned as moderators. Please make sure that your admin and mod usergroups are 6 and 7, otherwise change these accordingly.
That's not it though... I've changed the conditionals and my regular users can see it, they can click on it, but they can't get to the actual warn.php listing. Is it because of the 'canadmin' conditional in that .php file?
That's not it though... I've changed the conditionals and my regular users can see it, they can click on it, but they can't get to the actual warn.php listing. Is it because of the 'canadmin' conditional in that .php file?
I am not sure I understand you. With the conditionals I posted, a normal user can see only his own warnings, via the link "View your warnings". Let's analyze that a bit:
PHP Code:
<if condition="$post[usergroupid]!=6 AND $post[usergroupid]!=7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])"><a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'>Warn $post[username]</a> ?
</if>
This checks if the person who posted is an admin or a mod (if they are, they cannot be warned) and if they are not, then it checks if the viewer has the right to moderate that particular forum. If he has the rights (i.e. he is either a mod for that forum or an admin), he gets the Warn User link.
PHP Code:
<if condition="$post[usergroupid]!=6 AND $post[usergroupid]!=7 AND ($bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==6)">
<a href='Warn.php?do=ViewWarnings&id=$post[userid]'>View $post[username]'s Warnings</a> ?</if>
This checks if the poster is not an admin or a mod, and if the user is an admin or a mod. In that case, it shows the "View User Warnings". In other words an admin or a moderator can always view the "View User Warnings" link, except if the poster is himself and admin or a moderator.
PHP Code:
<if condition="$post[userid]==$bbuserinfo[userid] AND $post[usergroupid]==2 AND $post[warning_level]>0">
<a href='Warn.php?do=ViewMyWarnings'>View your Warnings</a> ?</if>
This checks if the poster user is the same with the viewing user. and that this user is a registered user. If he is, he only gets the "View Your Warnings" link, which allows him to see his own warnings only. If he clicks on that link, he will be shown his warnings.
I understand everything you said, and I appreciate the break down. Yes users can currently see their own warnings. All users can see "View Warnings" if that person has greater than 0 points.
I want ALL users to be able to see ALL warnings of any other user. I'm sorry to be a bother, I'm just trying to get this worked out.
They still keep getting a No Permission - "you do not have permission to access this page." Error.
I think it has to do with "Warn.php?do=ViewWarnings&id=3732" .... the do ViewWarnings is set up in the .php code to be associated with canmoderate. I want to separate that out so that I can set it up by usergroups as well. Does that make sense?
I understand everything you said, and I appreciate the break down. Yes users can currently see their own warnings. All users can see "View Warnings" if that person has greater than 0 points.
I want ALL users to be able to see ALL warnings of any other user. I'm sorry to be a bother, I'm just trying to get this worked out.
They still keep getting a No Permission - "you do not have permission to access this page." Error.
I think it has to do with "Warn.php?do=ViewWarnings&id=3732" .... the do ViewWarnings is set up in the .php code to be associated with canmoderate. I want to separate that out so that I can set it up by usergroups as well. Does that make sense?
Oh, OK, that's simple enough. In your Warn.php file, find:
PHP Code:
// You have permission to warn o_O
if($_GET['do']!='ViewMyWarnings'){
if(!can_moderate( )){
print_no_permission( );
}
}
Replace that with :
PHP Code:
// // You have permission to warn o_O
// if($_GET['do']!='ViewMyWarnings'){
// if(!can_moderate( )){
// print_no_permission( );
// }
// }
One issue I had with this hack, is the fact that it uses a separate table, to maintain those members which get banned. If you do that, then you have to manually change their status to unbanned, when the banning period expires.
Why can't we use the normal table, in which vB stores the banned users, called "userban"? In that way, we can have the vB's cron job take care of the unbanning.
For those who are interested in this, all you have to do, is the followings:
In your warn.php file, find the following line:
PHP Code:
$DB->query("insert into ".TABLE_PREFIX."banned_members values ('','{$user['userid']}','".time()."','{$time_unban}')");
Hi.
I replaced the code but now when I click on "warn XYZ" or "View XYZ's Warnings" it give me this error
Code:
Parse error: parse error, unexpected T_VARIABLE in /home/www/.........../Warn.php on line 278
where line 278 is the first line of your code... any idea?
Thx
Yes, as I said before, I have made several changes in this hack, to make it more suitable for my needs. One such change is the addition of a new field, warn_permban in the table, which indicates if the offence of the user deserves (and gives him) a permanent ban. You obviously do not have that field in your database and you get that error.
You may remove that part of the code, and use it. Just replace:
Oh, OK, that's simple enough. In your Warn.php file, find:
PHP Code:
// You have permission to warn o_O
if($_GET['do']!='ViewMyWarnings'){
if(!can_moderate( )){
print_no_permission( );
}
}
Replace that with :
PHP Code:
// // You have permission to warn o_O
// if($_GET['do']!='ViewMyWarnings'){
// if(!can_moderate( )){
// print_no_permission( );
// }
// }
I hope this gets it for you.
Rgds
------------
John
Worked like a charm, thank you so much. Stupid me, I didn't think to comment it out, I thought I had to change it to usergroups or something. Thanks again!!