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

 
 
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
  #252  
Old 09-22-2004, 05:49 PM
Koutaru's Avatar
Koutaru Koutaru is offline
 
Join Date: Feb 2003
Location: IL
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Set it up with no problems! Thanks again for such an awesome hack and awesome work I'd expect no less from you.
Reply With Quote
  #253  
Old 09-23-2004, 11:26 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Koutaru
Set it up with no problems! Thanks again for such an awesome hack and awesome work I'd expect no less from you.
For those who want to use a template for the PM send to the warned user, all you have to do is to create a template called "warn_pm" with the following contents:

HTML Code:
Dear $user[username],

You have been warned for one of your posts, which violated the Forums Rules.

The reason you have been warned is because [b][i] $warn_type[warn_desc] [/i][/b](Warning Type = $warn_type[warn_name]), for which you have been given [b] $warn_type[warn_points] [/b] point(s).

The post for which you are warned can be seen [URL="$vboptions[bburl]/showthread.php?p=$_POST[post]"]here[/URL].

The admin/moderator who warned you, entered this comment: 

=======================================
[i]$_POST[comment][/i]
=======================================

Your total Warning Level at the moment is: [b] $level [/b] point(s).

If you reach the maximum of [b]$warn_options[points_before_banned][/b], you will be banned from the Forums, for [b]$warn_options[banned_limit][/b] days.

To see details about all the warnings you have received, until now, please click [URL="$vboptions[bburl]/Warn.php?do=ViewMyWarnings"]here[/URL].

Please reply back if you have a dispute.
Then in the warn.php file, comment out the following lines:

PHP Code:
$messageb="You have been warned for one of your posts: [url={$vboptions[bburl]}/showthread.php?p={$_POST['post']}]click here to see it[/url]. Your warning level is now: {$level}. Click on the [b]Quick Links[/b] menu above and select [b]View Your Warnings[/b], to see details about all the warnings you have received. The person who warned you, entered this comment: [i]{$_POST['comment']}[/i]. Please reply back if you have a dispute.";
$messageb=ParseInput($messageb); 
In case your message looks different than mine (I might have changed it), please comment out the two lines which start with $messageb.

Right below those two lines, add the following:

PHP Code:
eval('$messageb .= "' fetch_template('warn_pm') . '";'); 
Of course the template can be edited at will.

I hope this helps.

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

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}')"); 
Replace it, with the followings:

PHP Code:
        if($warn_type['warn_permban']=="Yes")
            {
$liftdate=0;
             }
            else
            {
$liftdate=$time_unban;
             }
                 
$usergroupid=8
        $DB_site
->query("
            INSERT INTO " 
TABLE_PREFIX "userban
            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate)
            VALUES
            (
$user[userid]$user[usergroupid]$user[displaygroupid]$user[customtitle], '" addslashes($user['usertitle']) . "', $bbuserinfo[userid], " TIMENOW ", $liftdate)");
        
$DB_site->query("
                UPDATE " 
TABLE_PREFIX "user SET
                usergroupid = 
$usergroupid,
                displaygroupid = 
$usergroupid
                WHERE userid = 
$user[userid]
            "
); 
Of course, in this case, you do not use the option "Unban banned users" in your AdminCP, since the bans will no longer be in the table this hack is using, but in the table vB is creating.

Also, it is obvious, that if you use this mod of mine, any future improvements by the author of this hack, might not work, so use at your own risk.

I'll try to help anyone who has issues with the above mods, but I can't promise any response times.

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

* jd clicks install *

I have been testing this for a while, it is great just installed it on my live forum.

I have made a few changes mostly conditionals so only staff can see the warn and view warn text in the postbit template, also added a Warn Level indicator for everyone (except staff) to see, also added the same in the MEMBERINFO template.

Thank you.

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

I get SQL errors when trying to send the message using both the original method by Zero Tolerance, and the template method by sv1cec

Here is the error with the stock code:
Code:
Database error in vBulletin 3.0.3:

Invalid SQL: insert into vb3_pmtext values ('','1','Matt','You have been warned','You have been warned for one of your posts: click here to see it. Your warning level is now: 5. Click on the Quick Links menu above and select View Your Warnings, to see details about all the warnings you have received. The person who warned you, entered this comment: test. Please reply back if you have a dispute.','a:1:{i:5;s:9:\"BeasTboyz\";}','4','1096165529','1','1')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Saturday 25th of September 2004 09:25:29 PM
Script: http://www.observedtrials.net/vb/Warn.php
Referer: http://www.observedtrials.net/vb/War...d=5&post=73439
I also can not use the ban fix created by sv1cec two posts up. I get an invalid T_VARIABLE on line 250, which happens to be the first instance of the code below:
Code:
        $DB_site->query("
If anyone knows how to fix these problems I would appreciate it, I've tried quite a few different things but I'm a novice at this sort of thing.

Thanks!
Reply With Quote
  #257  
Old 09-26-2004, 01:42 AM
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Posts: 645
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jdsinclair
* jd clicks install *

I have been testing this for a while, it is great just installed it on my live forum.

I have made a few changes mostly conditionals so only staff can see the warn and view warn text in the postbit template, also added a Warn Level indicator for everyone (except staff) to see, also added the same in the MEMBERINFO template.

Thank you.

JD.
Mind sharing the code for the changes? I was thinking to do the same.
Reply With Quote
  #258  
Old 09-26-2004, 05:10 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BeasTboyz
I get SQL errors when trying to send the message using both the original method by Zero Tolerance, and the template method by sv1cec

Here is the error with the stock code:
Code:
Database error in vBulletin 3.0.3:

Invalid SQL: insert into vb3_pmtext values ('','1','Matt','You have been warned','You have been warned for one of your posts: click here to see it. Your warning level is now: 5. Click on the Quick Links menu above and select View Your Warnings, to see details about all the warnings you have received. The person who warned you, entered this comment: test. Please reply back if you have a dispute.','a:1:{i:5;s:9:\"BeasTboyz\";}','4','1096165529','1','1')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Saturday 25th of September 2004 09:25:29 PM
Script: http://www.observedtrials.net/vb/Warn.php
Referer: http://www.observedtrials.net/vb/War...d=5&post=73439
I also can not use the ban fix created by sv1cec two posts up. I get an invalid T_VARIABLE on line 250, which happens to be the first instance of the code below:
Code:
        $DB_site->query("
If anyone knows how to fix these problems I would appreciate it, I've tried quite a few different things but I'm a novice at this sort of thing.

Thanks!
To use my modification for this hack, you have to add some more fields in the tables. For example, I have a field which says if the warning relates to an offence which deserves a permanent ban (such as for a troll). I'll try to help you, if you give me the exact error you get in my code and the line of the code it generates it (the line is not only the part you show above, give me the whole code statement).

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

Quote:
Originally Posted by sv1cec
To use my modification for this hack, you have to add some more fields in the tables. For example, I have a field which says if the warning relates to an offence which deserves a permanent ban (such as for a troll). I'll try to help you, if you give me the exact error you get in my code and the line of the code it generates it (the line is not only the part you show above, give me the whole code statement).

Rgds
------------
John
Thanks for the offer to help, John.

I have attached my Warn.php file so you can see exactly what it says.

When I change Warn.php so that it adds a user to the normal vB banned usergroup I get this error and this error only when attempting to warn a user or view their warning level:
Code:
Parse error: parse error, unexpected T_VARIABLE in /home/observed/public_html/vb/Warn.php on line 250
Here are some lines from my Warn.php file
Code:
243: if($warn_type['warn_permban']=="Yes") 
244:             {$liftdate=0; 
245:              } 
246:            else 
247:             {$liftdate=$time_unban; 
248:             } 
249:                 $usergroupid=8 
250:        $DB_site->query(" 
251:            INSERT INTO " . TABLE_PREFIX . "userban 
252:            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate) 
253:            VALUES 
254:             ($user[userid], $user[usergroupid], $user[displaygroupid], $user[customtitle], '" . addslashes($user['usertitle']) . "', $bbuserinfo[userid], " . TIMENOW . ", $liftdate)"); 
255:         $DB_site->query(" 
256:                UPDATE " . TABLE_PREFIX . "user SET 
257:                usergroupid = $usergroupid, 
258:                displaygroupid = $usergroupid 
259:                WHERE userid = $user[userid] 
260:            ");

When I change the private message function so that it uses the template instead of the stock way it notifies a user of a warning I get this mySQL error:
Code:
Database error in vBulletin 3.0.3:

Invalid SQL: insert into vb3_pmtext values ('','1','Matt','You have been warned','Dear BeasTboyz,

You have been warned for one of your posts, which violated the Forums Rules.

The reason you have been warned is because  Other reasons not listed (Warning Type = Miscellaneous), for which you have been given  2  point(s).

The post for which you are warned can be seen here.

The admin/moderator who warned you, entered this comment: 

=======================================
test
=======================================

Your total Warning Level at the moment is:  5  point(s).

If you reach the maximum of 5, you will be banned from the Forums, for 3 days.

To see details about all the warnings you have received, until now, please click here.

Please reply back if you have a dispute.','a:1:{i:5;s:9:\"BeasTboyz\";}','4','1096188731','1','1')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Sunday 26th of September 2004 03:52:11 AM
Script: http://www.observedtrials.net/vb/Warn.php
Referer: http://www.observedtrials.net/vb/War...d=5&post=73439
Username: Matt
IP Address: xx.xx.xx.xx
Thanks again for any help,

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

Matt,

The first error is easy, you need to add a semicolon at the line which says:

$usergroupid=8

Change that to

$usergroupid=8;

As far as the second mistale is concerned, have you commented out both lines starting with "$messageb=...."? There are two lines there, looking like:

PHP Code:
$messageb="You have been warned for one of your posts: [url={$vboptions[bburl]}/showthread.php?p={$_POST['post']}]click here to see it[/url]. Your warning level is now: {$level}. Click on the [b]Quick Links[/b] menu above and select [b]View Your Warnings[/b], to see details about all the warnings you have received. The person who warned you, entered this comment: [i]{$_POST['comment']}[/i]. Please reply back if you have a dispute.";
$messageb=ParseInput($messageb); 
You have to comment these lines, add two // in front of each one of them, or just delete them. Then, add a row like:

PHP Code:
eval('$messageb .= "' fetch_template('warn_pm') . '";'); 
in their place.

My warn.php looks like that, in that area:

PHP Code:
eval('$messageb .= "' fetch_template('warn_pm') . '";');
$title="You have been warned";
$to=$user['userid'];
$from=$bbuserinfo['userid'];
SendPM($messageb,$title,$to,$from); 
Let me know if these help.

Rgds
----------
John
Reply With Quote
  #261  
Old 09-26-2004, 02:53 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'd still like expirable warnings
Reply With Quote
 


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 05:33 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.05161 seconds
  • Memory Usage 2,367KB
  • 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
  • (7)bbcode_code
  • (1)bbcode_html
  • (7)bbcode_php
  • (4)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