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)

Koutaru 09-22-2004 05:49 PM

Set it up with no problems! Thanks again for such an awesome hack and awesome work ;) I'd expect no less from you. :p

sv1cec 09-23-2004 11:26 AM

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

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

sv1cec 09-23-2004 11:35 AM

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

Mosh 09-23-2004 11:36 AM

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

BeasTboyz 09-26-2004 01:28 AM

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!

SamirDarji 09-26-2004 01:42 AM

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.

sv1cec 09-26-2004 05:10 AM

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

BeasTboyz 09-26-2004 07:59 AM

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

sv1cec 09-26-2004 01:57 PM

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

msimplay 09-26-2004 02:53 PM

i'd still like expirable warnings


All times are GMT. The time now is 08:58 AM.

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.01663 seconds
  • Memory Usage 1,821KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_html_printable
  • (7)bbcode_php_printable
  • (4)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