Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Warning Hack V1.5 Details »»
Warning Hack V1.5
Version: 1.00, by Zero Tolerance Zero Tolerance is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

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.

Comments
  #272  
Old 09-27-2004, 11:29 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by msimplay
yeh i found the expirable warnings bit it will suffice for now
however it would be good to have it intergrated into the hack itself for example the way it was in mikes warning hack for vb2

Spamming expires 30 days
Rudeness expires 1 day
Signature expires 30 days

its settable per warning but the way i found in this thread was as a whole 30 days from the time set per warning
That's the way it works in my mod. You define a maturity period per warning type. When that period passes, that warning is removed. So you can adjust it the way you want.

As I said, if you care, it's here, but don't expect me to provide step-by-step instructions, I just do not have them. I'll try to help you out, but that's all I can do.

Rgds
--------
John
Reply With Quote
  #273  
Old 09-27-2004, 11:33 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BeasTboyz
Wow John, thanks for all of your help!

It appears to be working great now except for two small things.

1.) If a user has a warning level of 5 and the ban level is 6 and I give them a warning worth 2 points it takes the level up to 6, but when I remove the warning it keeps an extra point in "reserve" that I can't seem to erase. I can of course go into the my user table and remove it from the last column, but I thought I'd let you know in case you want to fix it.

2.) At the bottom of the Warn.php interface (on the site) it says "Once you reach warning level 6, you will be banned for 3 days". Well, I'm not banning them, I have a usergroup on my site I add them to called the Kiddie Korner, and that is the only place they're allowed to post. I would like to say "Once you reach warning level 6, you will be moved to the Kiddie Korner for 3 days"
Matt,

The minute I say "OK, I can go and rest a bit", here you come with a different thing! LoL I'll have to check on the first one, this is a tough one, because the hack works initially like that, when you reach the limit, it resets itself at the limit. I can change that, but I need to check what impact it will have overall.

As for the second point, just alter your warn_viewtype_end template. Easy enough, if not let me know.

Now, I go rest, before the twins wake up and my baby-sitting session starts.

Rgds
Reply With Quote
  #274  
Old 09-27-2004, 11:37 AM
BeasTboyz BeasTboyz is offline
 
Join Date: May 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
Matt,

The minute I say "OK, I can go and rest a bit", here you come with a different thing! LoL I'll have to check on the first one, this is a tough one, because the hack works initially like that, when you reach the limit, it resets itself at the limit. I can change that, but I need to check what impact it will have overall.
Sorry about that. Like I said though, it doesn't matter to me too much, can do it by hand. I just wanted to bring it to your attention.

Quote:
Originally Posted by sv1cec
As for the second point, just alter your warn_viewtype_end template. Easy enough, if not let me know.

Rgds
Ah, I forgot to check my templates, thanks for reminding me .

Thanks for all of the help,

Matt
Reply With Quote
  #275  
Old 09-27-2004, 11:48 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BeasTboyz
Sorry about that. Like I said though, it doesn't matter to me too much, can do it by hand. I just wanted to bring it to your attention.



Ah, I forgot to check my templates, thanks for reminding me .

Thanks for all of the help,

Matt
Matt,

I am aware of this problem, it's just that I am not sure which is the best way to handle it. I assume that in some cases, leaving the code as it is, is a better option, in other cases, it's better to have a warning level above the limit, like when deleting warnings.

To do it the way you want (i.e. to work properly when removing a warning, as far as the rremoved points are concerned), find the following line:

PHP Code:
if($level>$warn_options['points_before_banned']){$level=$warn_options['points_before_banned'];} 
and make it a comment by adding two // in the beginning. In other words, it should look like:

PHP Code:
//if($level>$warn_options['points_before_banned']){$level=$warn_options['points_before_banned'];} 
Let me know if it works to your satisfaction.

----------
John
Reply With Quote
  #276  
Old 09-27-2004, 12:10 PM
BeasTboyz BeasTboyz is offline
 
Join Date: May 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
Matt,

I am aware of this problem, it's just that I am not sure which is the best way to handle it. I assume that in some cases, leaving the code as it is, is a better option, in other cases, it's better to have a warning level above the limit, like when deleting warnings.

To do it the way you want (i.e. to work properly when removing a warning, as far as the rremoved points are concerned), find the following line:

PHP Code:
if($level>$warn_options['points_before_banned']){$level=$warn_options['points_before_banned'];} 
and make it a comment by adding two // in the beginning. In other words, it should look like:

PHP Code:
//if($level>$warn_options['points_before_banned']){$level=$warn_options['points_before_banned'];} 
Let me know if it works to your satisfaction.

----------
John
Hey John,

That brings up errors when someone is already one below the ban level and I try to warn them again (to bring them 1 above the ban level), SQL errors:
Code:
Database error in vBulletin 3.0.3:

Invalid SQL:  
            INSERT INTO vb3_userban 
            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate) 
            VALUES 
            (5, 10, 10, 0, '', 1, 1096290247, 1096549448)
mysql error: Duplicate entry '5' for key 1

mysql error number: 1062

Date: Monday 27th of September 2004 08:04:08 AM
Script: http://www.observedtrials.net/vb/Warn.php
Referer: http://www.observedtrials.net/vb/Warn.php?do=WarnUser&id=5&post=73439
Username: Matt
IP Address: xx.xx.xx.xx
In the mean time I'm uncommenting it and I'm going to just make all warnings worth 1 point and make the ban level 3.

Matt
Reply With Quote
  #277  
Old 09-27-2004, 05:49 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BeasTboyz
Hey John,

That brings up errors when someone is already one below the ban level and I try to warn them again (to bring them 1 above the ban level), SQL errors:
Code:
Database error in vBulletin 3.0.3:

Invalid SQL:  
            INSERT INTO vb3_userban 
            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate) 
            VALUES 
            (5, 10, 10, 0, '', 1, 1096290247, 1096549448)
mysql error: Duplicate entry '5' for key 1

mysql error number: 1062

Date: Monday 27th of September 2004 08:04:08 AM
Script: http://www.observedtrials.net/vb/Warn.php
Referer: http://www.observedtrials.net/vb/Warn.php?do=WarnUser&id=5&post=73439
Username: Matt
IP Address: xx.xx.xx.xx
In the mean time I'm uncommenting it and I'm going to just make all warnings worth 1 point and make the ban level 3.

Matt
Nope, this is not the problem, at least the SQL error you send me, does not show this. What it shows is that user with userid 5 is already banned, so you cannot re-ban him again.

That's another issue I have to deal with.

See that the statement that is causing the problem, is the one which inserts an entry in the userban table, this is the table where the banned users are inserted. Now, I remember that you said that you do not ban the users, you just move them to another user group, so I am not sure how you want this handled. To verify that this is the case (I am sure it is), just comment that line, it should still increase the warn points for that user, but it will not enter his entry in the userban table.

If you do not plan to ban users, then you'd better stick with the original hack, which allows you to move your users to another usergroup, and when the maturity period is over, they can be re-moved back to their original group. But this has to be done manually, from the "Unban members" option in the AdminCP.

Matt, it's hard for me to suggest the best alternative, as I do not have in mind all the details of your environment.

If you can come up with some guidelines (e-mail me directly), I'll try to help, but as mentionned before, I cannot commit to anything.

Rgds
-----------
John
Reply With Quote
  #278  
Old 09-30-2004, 03:31 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SamirDarji
Mind sharing the code for the changes? I was thinking to do the same.
Yep, no probs. It is not neat or the most efficient code, but it works for me (not a coder myself but have started to experiment). Only tested on v3.0.3. These changes will have to be made in every style you use.

The only thing viewable by a member is the Warn Level (all members are displayed for everyone to see) and their warning page (only viewable by them and staff). My staff love this as originally everyone saw all links.



You will have to reference with ZT's original instructions to see what is different for the 'postbit' template (additional navbar and MEMBERINFO template alterations by me):


1. In the 'postbit' template (you will have to find the equivalent place in the 'postbit_legacy' template yourself as I do not use it), Warn and View Warning only seen by staff. Warn Level are displayed for members (when level is above zero it changes colour). You can change the font colours to whatever you want.

Postbit Templates -> postbit:-

Find:
PHP Code:
<if condition="$show['postcount']">#<a 
Replace with:
PHP Code:
<if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7"><a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'><font color=orange>Warn $post[musername]</font></a>&nbsp;&nbsp;<a href='Warn.php?do=ViewWarnings&id=$post[userid]'><font color=yellow>View $post[musername]'s Warnings</font></a>&nbsp;&nbsp;</if></if><if condition="$show['postcount']">#<a 
Find:
PHP Code:
                    <if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                    <
div>
                        
$vbphrase[posts]: $post[posts]
                    </
div
Under it Add:
PHP Code:
                <if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level'] == 0"><div class="smallfont">Warning Level$post[warning_level]</div></if></if>
                                <if 
condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level']>0"><div class="smallfont"><font color=yellow>Warning Level$post[warning_level]</font></div></if></if> 

2. I put a 'View My Warnings' link in 'Quick Links' on the navbar (as staff can't get warned they will not see this).

Navigation / Breadcrumb Templates -> navbar:-

Find:
PHP Code:
<tr><td class="thead">$vbphrase[miscellaneous]</td></tr
Above it add:
PHP Code:
<if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7"><else /><tr><td class="thead">Warnings</td></tr><tr><td class="vbmenu_option"><a href="Warn.php?$session[sessionurl]do=ViewMyWarnings">View My Warnings</a></td></tr></if> 

3. For members public profiles I have added a view warnings (viewable by staff only) and Warning Level (everyone can see)

Member Info Templates -> MEMBERINFO:-

Find:
PHP Code:
    <td class="tcat">$vbphrase[view_profile]<span class="normal">: $userinfo[username]</span></td
Replace with:
PHP Code:
    <td class="tcat">$vbphrase[view_profile]<span class="normal">: $userinfo[username]<if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7">&nbsp;&nbsp;<a href='Warn.php?do=ViewWarnings&id=$post[userid]'><font color=yellow>View $post[musername]'s Warnings</font></a>&nbsp;&nbsp;</if></if></span></td> 
Find:
PHP Code:
                <if condition="$show['lastactivity']">
                    <
div>$vbphrase[last_activity]: $userinfo[lastactivitydate] <span class="time">$userinfo[lastactivitytime]</span>&nbsp;</div>
                </if> 
Above it Add:
PHP Code:
                <if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level'] == 0"><div class="smallfont">Warning Level$post[warning_level]&nbsp;</div></if></if>
                                <if 
condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level']>0"><div class="smallfont"><font color=yellow>Warning Level$post[warning_level]</font>&nbsp;</div></if></if> 


That is all I really did, so if you find use for it go right ahead and use it

JD.
Reply With Quote
  #279  
Old 09-30-2004, 06:59 AM
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Posts: 645
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much. I'm putting the finishing touches on my new site and want to have these same features. I'm no coder either, so I won't tell.
Reply With Quote
  #280  
Old 09-30-2004, 09:06 PM
fridayweb's Avatar
fridayweb fridayweb is offline
 
Join Date: Jun 2002
Location: F13 Headquarters
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would like other groups to be able to see the warned reasons, besides those that can moderate. I haven't been able to figure out how to do this yet. Any suggestions?
Reply With Quote
  #281  
Old 10-01-2004, 04:02 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fridayweb
I would like other groups to be able to see the warned reasons, besides those that can moderate. I haven't been able to figure out how to do this yet. Any suggestions?
The warned reasons are inside the "View Warnings" area (so to speak). In order for other groups to be able to see that link, you will have to change the conditional, which preceeds this link, in the postbit or postbit_legacy templates. For example:

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> 
The conditional above checks if the post :

1. Is not made by an admin or a mod.
2. If the member viewing the post is either a mod or admin.

If these are true, it shows the "View Warnings" link. You may add other conditions within the OR parenthesis, to show the link to other groups.

Rgds
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08983 seconds
  • Memory Usage 2,401KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (15)bbcode_php
  • (9)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete