vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Warning Hack V1.5 (https://vborg.vbsupport.ru/showthread.php?t=65336)

sv1cec 09-27-2004 11:29 AM

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

sv1cec 09-27-2004 11:33 AM

Quote:

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

It appears to be working great now :D 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

BeasTboyz 09-27-2004 11:37 AM

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

sv1cec 09-27-2004 11:48 AM

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

BeasTboyz 09-27-2004 12:10 PM

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

sv1cec 09-27-2004 05:49 PM

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

Mosh 09-30-2004 03:31 AM

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. :)

SamirDarji 09-30-2004 06:59 AM

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. ;)

fridayweb 09-30-2004 09:06 PM

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?

sv1cec 10-01-2004 04:02 AM

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


All times are GMT. The time now is 12:47 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.01458 seconds
  • Memory Usage 1,851KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (15)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete