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 11-02-2004 03:31 AM

Quote:

Originally Posted by rinkrat
OK, I just installed but there is no clue as to what warning type's (sic) are. Can you do a quick run though of different sample warning types that can possibly be used with this system and how they are configured. It's hard for a new user to create one when it's not explained. You might want to just pre-configure a basic setup so it works out of the box.

I've attached a list of my warning types. Don't worry about the first field in the list, it's generated automatically. The rest of the fields are not displayed properly, this is a text file, but if you follow each row you'll get the proper fields.

Let me know if this helps.

Rgds

sv1cec 11-02-2004 03:34 AM

Quote:

Originally Posted by bnn121
In the above instructions I'm able to find that one line of code in my postbit and postbit_legacy templates for my first board style...now I have three more styles...and when I go to look for that first line of code...it does not find that exact line of code...what is finds is this.

PHP Code:

<if condition="$show['postcount']">? #<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new"><strong>$post[postcount]</strong></a></if> 

I noticed that right after this part of the code

there is a period or dot or whatever that is.

Now all three of my other styles have this code in it...just like I qouted...but my first style is just like the instructions line of code.

Is there any reason to have that period or dot or whatever it is in that line of code for the other three styles?

In the original instructions of this hack it is said to find


In refence to the first set of code i posted above ...once this original code is changed...where does this new code come in? Is the original modified code getting overwritten or is it getting put in between the origianl modded code?

Put my code right before that thing about postcount. As for where my code goes in comparison with the original code, the original code does not make any checks, so my code just replaces

HTML Code:

<a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'>Warn $post[musername]</a> ? <a href='Warn.php?do=ViewWarnings&id=$post[userid]'>View $post[musername]'s Warnings</a>
Finally, that period is there, to separate the links. Have a look at the forum and you will see "Warn Xyz ? View Xyz's Warnings ? #1", the dot is going in between the links, to separate them.

Rgds

beano33 11-02-2004 03:43 AM

Quote:

Originally Posted by sv1cec
You are welcome Sir!

Rgds

Unfortunately this won't work for me. :(
I need to know how to modify the original author's hack to send the email warning.

The only references I can find to PM there are in warn.php
here:
Code:

function SendPM($message,$title,$to,$from){
global $DB;
// Permssions Crap XD your getting a damn PM!! XD
// Parse It Out
$title = addslashes(htmlspecialchars_uni(fetch_censored_text($title)));
$message = addslashes(fetch_censored_text($message));
$to=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$to}'");  // Grab Member Its Going TO
if($from=="BOT"){
$from=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$rpg_option['pmbot']}'"); // FROM Teh Bot =D
} else {
$from=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$from}'"); // Grab Member Its Coming FROM
}
// Insert The Message
$to_string["$to[userid]"] = $to['username'];
$now=time();
$DB->query("insert into ".TABLE_PREFIX."pmtext (fromuserid,fromusername,title,message,touserarray,iconid,dateline,showsignature  ,allowsmilie) values ('{$from['userid']}','".addslashes($from['username'])."','{$title}','{$message}','".addslashes(serialize($to_string))."','4','{$now}','1','1')");
// id thingy
$DB->query("insert into ".TABLE_PREFIX."pm (pmtextid, userid) values (".$DB->insert_id().", '{$to['userid']}')");
// Update pm count
$DB->shutdown_query("update ".TABLE_PREFIX."user set pmtotal=pmtotal+'1',pmunread=pmunread+'1' WHERE userid='{$to['userid']}'");
}

and here:
Code:

// Send PM!! =D
$messageb="You have been warned for the post: }/showthread.php?p={$_POST['post']}]Your Post. Your warning level is now: {$level}. This action was taken for the following reason: {$_POST['comment']}. Please reply back if you have a dispute. {$bbuserinfo[username]}";
$messageb=ParseInput($messageb);
$title="You have been warned";
$to=$user['userid'];
$from=$bbuserinfo['userid'];
SendPM($messageb,$title,$to,$from);

// Redirect


sv1cec 11-02-2004 04:34 AM

Quote:

Originally Posted by beano33
Unfortunately this won't work for me. :(
I need to know how to modify the original author's hack to send the email warning.

The only references I can find to PM there are in warn.php
here:
Code:

function SendPM($message,$title,$to,$from){
global $DB;
// Permssions Crap XD your getting a damn PM!! XD
// Parse It Out
$title = addslashes(htmlspecialchars_uni(fetch_censored_text($title)));
$message = addslashes(fetch_censored_text($message));
$to=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$to}'");  // Grab Member Its Going TO
if($from=="BOT"){
$from=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$rpg_option['pmbot']}'"); // FROM Teh Bot =D
} else {
$from=$DB->query_first("select * from ".TABLE_PREFIX."user where userid='{$from}'"); // Grab Member Its Coming FROM
}
// Insert The Message
$to_string["$to[userid]"] = $to['username'];
$now=time();
$DB->query("insert into ".TABLE_PREFIX."pmtext (fromuserid,fromusername,title,message,touserarray,iconid,dateline,showsignature  ,allowsmilie) values ('{$from['userid']}','".addslashes($from['username'])."','{$title}','{$message}','".addslashes(serialize($to_string))."','4','{$now}','1','1')");
// id thingy
$DB->query("insert into ".TABLE_PREFIX."pm (pmtextid, userid) values (".$DB->insert_id().", '{$to['userid']}')");
// Update pm count
$DB->shutdown_query("update ".TABLE_PREFIX."user set pmtotal=pmtotal+'1',pmunread=pmunread+'1' WHERE userid='{$to['userid']}'");
}

and here:
Code:

// Send PM!! =D
$messageb="You have been warned for the post: }/showthread.php?p={$_POST['post']}]Your Post. Your warning level is now: {$level}. This action was taken for the following reason: {$_POST['comment']}. Please reply back if you have a dispute. {$bbuserinfo[username]}";
$messageb=ParseInput($messageb);
$title="You have been warned";
$to=$user['userid'];
$from=$bbuserinfo['userid'];
SendPM($messageb,$title,$to,$from);

// Redirect


Well, if all you want to do, is to replace the PM sending with an e-mail sending, this is the code that sends the e-mail:

PHP Code:

$messageb="";
eval(
'$messageb .= "' fetch_template('warn_em') . '";');
$title="You have been warned";
$to=$user['userid'];
    if(
$warn_options['warner']=="")
    {
        
$fromemail=$bbuserinfo['email'];
        
$fromname=$bbuserinfo['username'];
    }
    else
    {
        
$warnerdata=$DB->query_first("select username, email from ".TABLE_PREFIX."user where userid='{$warn_options['warner']}'");
        
$fromemail=$warnerdata['email'];
        
$fromname=$warnerdata['username'];
    }
vbmail($user['email'], $title$messagebfalse$fromemail''$fromname); 

The 'if' concerns who sends the e-mail, people have requested that a "hidden warner" is used to send it. If you are not using that functionality, the code should be modified to:

PHP Code:

$messageb="";
eval(
'$messageb .= "' fetch_template('warn_em') . '";');
$title="You have been warned";
$to=$user['userid'];
$fromemail=$bbuserinfo['email'];
$fromname=$bbuserinfo['username'];
vbmail($user['email'], $title$messagebfalse$fromemail''$fromname); 

Notice that you need to create a new template, called warn_em, the layout needs to be slightly different from the one used for the PM.

Good luck.

beano33 11-02-2004 04:59 AM

Quote:

Originally Posted by sv1cec
Well, if all you want to do, is to replace the PM sending with an e-mail sending, this is the code that sends the e-mail:

Actually I'd like it to do both so the member has no excuse that he didn't receive a warning. Can I just tack this on after the PM code?



Quote:

The 'if' concerns who sends the e-mail, people have requested that a "hidden warner" is used to send it. If you are not using that functionality, the code should be modified to:

PHP Code:

$messageb="";
eval(
'$messageb .= "' fetch_template('warn_em') . '";');
$title="You have been warned";
$to=$user['userid'];
$fromemail=$bbuserinfo['email'];
$fromname=$bbuserinfo['username'];
vbmail($user['email'], $title$messagebfalse$fromemail''$fromname); 

Notice that you need to create a new template, called warn_em, the layout needs to be slightly different from the one used for the PM.

Good luck.
Thanks, I'll be using this one. I like to spread the abuse around :devious:

sv1cec 11-02-2004 05:48 AM

Quote:

Originally Posted by beano33
Actually I'd like it to do both so the member has no excuse that he didn't receive a warning. Can I just tack this on after the PM code?





Thanks, I'll be using this one. I like to spread the abuse around :devious:

I think you can do it.

Rgds

Kmaster 11-02-2004 09:04 AM

I have this hack installed modification by sv1cec. many thanks for all your worked.
One question:-
in the admincp to view that "View Warning Logs", if I have over 2000 members are warned, will it wait for long time to load the whole page? possibly separate in difference pages, likes 1 page show 20 warns, then go click next page see others.

Thanks in advance!!!

rgds,

bnn121 11-02-2004 09:11 AM

What are the parameters for this in the database? That mod is not in your instructions. This is all I see in your instrcutions

PHP Code:

 Belowplease find a description of the tables used
1. warning_options
Field                                          Type                  Null          Key          
Default          Extra
oid                                         int
(15)                           PRI                                   auto_increment
banned_limit                         int
(15)                             0
points_before_banned         int
(15)                             0
banned_usergroup_id         int
(15)                             0
protected_usergroups         varchar
(255)
troll_usergroup_id                 varchar(10)
multiple_per_post                 char(3)
2. warning_types
Field                  Type                  Null          Key          
Default          Extra
tid                    int
(15)               PRI                                   auto_increment
warn_name              varchar
(255)
warn_points            int(15)                             0
warn_desc              text
warn_maturity          int
(5)                                     0
warn_permban           char
(3)
3. warnings
Field                                          Type                  Null          Key          
Default          Extra
wid                                         int
(15)                           PRI                                   auto_increment
warned_user                         int
(15)                             0
warned_by                                 int
(15)                             0
warned_time                         int
(15)                             0
warned_reason                         text
warned_post                         int
(15)                             0
warned_warning_id                 int
(15)                             


Quote:

Originally Posted by sv1cec
You have to add the send_pm_warning field first, obviously, so install that mod first.

Rgds


sv1cec 11-02-2004 11:37 AM

Quote:

Originally Posted by bnn121
What are the parameters for this in the database? That mod is not in your instructions. This is all I see in your instrcutions

PHP Code:

 Belowplease find a description of the tables used
1. warning_options
Field                                          Type                  Null          Key          
Default          Extra
oid                                         int
(15)                           PRI                                   auto_increment
banned_limit                         int
(15)                             0
points_before_banned         int
(15)                             0
banned_usergroup_id         int
(15)                             0
protected_usergroups         varchar
(255)
troll_usergroup_id                 varchar(10)
multiple_per_post                 char(3)
2. warning_types
Field                  Type                  Null          Key          
Default          Extra
tid                    int
(15)               PRI                                   auto_increment
warn_name              varchar
(255)
warn_points            int(15)                             0
warn_desc              text
warn_maturity          int
(5)                                     0
warn_permban           char
(3)
3. warnings
Field                                          Type                  Null          Key          
Default          Extra
wid                                         int
(15)                           PRI                                   auto_increment
warned_user                         int
(15)                             0
warned_by                                 int
(15)                             0
warned_time                         int
(15)                             0
warned_reason                         text
warned_post                         int
(15)                             0
warned_warning_id                 int
(15)                             


You must have picked up the tables description before the mod which has the feature, or I must have screwed up something. In any case, the send_pm_warning is char(3).

Sorry about any inconvenience.

sv1cec 11-02-2004 11:41 AM

Quote:

Originally Posted by Kmaster
I have this hack installed modification by sv1cec. many thanks for all your worked.
One question:-
in the admincp to view that "View Warning Logs", if I have over 2000 members are warned, will it wait for long time to load the whole page? possibly separate in difference pages, likes 1 page show 20 warns, then go click next page see others.

Thanks in advance!!!

rgds,

It doesn't matter how many members you have, iwhat makes the difference is how many warnings you have issued. And yes, as far as I know they will all show in one page (haven't looked in that). Now for paging, I am not sure if my knowledge will allow me to do that, I'll give it a try tomorrow morning. If I'll come up with something, I'll let you know. I'll have to create at least 30 or 40 warnings in my test system to test that, so it might take some time.

Rgds


All times are GMT. The time now is 04:22 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.01487 seconds
  • Memory Usage 1,854KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_php_printable
  • (10)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