Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > Advanced Warning System (AWS)
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools
Bug: "Use Automatic Warnings from Private Messages?" option Details »»
Bug: "Use Automatic Warnings from Private Messages?" option
Version: , by Aurous Aurous is offline
Developer Last Online: Dec 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-02-2005 Last Update: Never Installs: 0
 
No support by the author.

Manage Warning Options ->
Use Automatic Warnings from Private Messages ->
"No" Selected

When I select this option as "No", the user still gets warned for using bad words when sending a Private Message. Using the latest 3.4.8 v

Aurous

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-02-2005, 03:19 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have to assume that you have not perform the changes properly. As far as I can say, that should work fine. Here is that part of the private.php file, that handles the warning.

In private.php find:

PHP Code:
        $signature intval($pm['signature']);
    
$iconid intval($pm['iconid']);
    
$disablesmilies iif($pm['disablesmilies'], 01); 
Below that, there should be something as shown below:

PHP Code:
if ($vboptions['warn_automaticpm'] == 1)
                {
                        
$Protected_Usergroups=explode("|",$vboptions['warn_protected_usergroups']);
                        if(
$Protected_Usergroups[0])
                        {
                            foreach(
$Protected_Usergroups as $pro)
                            {
                                if(
$pro==$bbuserinfo['usergroupid'])
                                {
                                    
$userprotected=1;
                                }
                            }
                        }
                if (
$bbuserinfo['userid'] != AND $userprotected != AND $wehavecensoredwords == 1)
                {
                
                
// Get Warning Types
                
$warn_type="";
                
$warn_type=$DB_site->query_first("select * from ".TABLE_PREFIX."warning_types WHERE warn_name='ObsceneWords'");
                
                
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext_warned\n\t(fromuserid, fromusername, title, before_title, message, before_message, touserarray, dateline)\nVALUES\n\t($bbuserinfo[userid], '" addslashes($bbuserinfo['username']) . "', '$title', '$before_title', '$message', '$before_message', '" addslashes(serialize($tostring)) . "', " TIMENOW ")");
                
$pmtextid_temp $DB_site->insert_id();
                
                
$wcomment="(This is an automatic warning, no moderator was involved.)";
                
$wcomment1="(This is an automatic warning, no moderator was involved.) ITC: $pmtextid_temp";
                if (
$alert=='')
                {
                    
$alert='No';
                }
                
warn_calculations($warn_type['tid'], $wcomment1$_POST['postid'], $bbuserinfo$vboptions['warn_automatic_warner'], $alert);
                
                
$thread1="A Private Message you send\n\nOur Internal Tracking Code: $pmtextid_temp\n\nQuote this number if you have a dispute.";
                
                
$thread2="A Private Message you send\n\nOur Internal Tracking Code: $pmtextid_temp\n\nQuote this number if you have a dispute.";
                
                
$warnerdata=$DB_site->query_first("select username, email from ".TABLE_PREFIX."user where userid='{$vboptions['warn_automatic_warner']}'");
                
                
warn_notify($thread1$thread2$bbuserinfo$warnerdata['email'], $warnerdata['username'], $vboptions['warn_automatic_warner'], $warn_type$level$wcomment$alert);
                }
                }
                
// End of automated warnings things
                // I hope it works OK.
                
$message=$pm_message;
                
// insert private message text

                
if ($bbuserinfo['userid'] == $vboptions['warn_collector'] and $pm['sender']!='')
                {
                    
$sender=$pm['sender'];
                    
$w1=$DB_site->query_first("SELECT username FROM " TABLE_PREFIX "user WHERE userid=$sender");
                    
$sendername=$w1[username];
                    
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($sender, '" addslashes($sendername) . "', '$title', '$message', '" addslashes(serialize($tostring)) . "', $iconid, " TIMENOW ", $signature$disablesmilies)");
                }
                else
                {
                    
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($bbuserinfo[userid], '" addslashes($bbuserinfo['username']) . "', '$title', '$message', '" addslashes(serialize($tostring)) . "', $iconid, " TIMENOW ", $signature$disablesmilies)");
                }

                
// get the inserted private message id
                
$pmtextid $DB_site->insert_id();

                
// save a copy into $bbuserinfo's sent items folder
                
if ($pm['savecopy'])
                {
                    
$DB_site->query("INSERT INTO " TABLE_PREFIX "pm (pmtextid, userid, folderid, messageread) VALUES ($pmtextid$bbuserinfo[userid], -1, 1)");
                    
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmtotal=pmtotal+1 WHERE userid=$bbuserinfo[userid]");
                }

                foreach (
array_keys($sendto) AS $username)
                {
                    
$user = &$checkedusers["$username"];
                    
$DB_site->query("INSERT INTO " TABLE_PREFIX "pm (pmtextid, userid) VALUES ($pmtextid$user[userid])");
                    if (
$pm['receipt'])
                    {
                        
$receiptSql[] = "(" $DB_site->insert_id() . ", $bbuserinfo[userid]$user[userid], '" addslashes($user['username']) . "', '$title', " TIMENOW ")";
                    }
                    if (
$user['pmpopup'])
                    {
                        
$pmpopupSql[] = $user['userid'];
                    }
                    else
                    {
                        
$pmtotalSql[] = $user['userid'];
                    }
                    if (
$user['emailonpm'] AND $user['usergroupid'] != AND $user['usergroupid'] != 4)
                    {
                        
$touserinfo = &$user;
                        eval(
fetch_email_phrases('pmreceived'$touserinfo['languageid'], '''email'));
                        
vbmail($touserinfo['email'], $emailsubject$emailmessage);
                    }
                }

                
// insert receipts 
I hope you get it straighened out.

Rgds
  #3  
Old 05-04-2005, 08:59 AM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

actually thats exactly what I have, dont know whats wrong :S I think it doesnt register the option settings from "Yes" to "No" in the warning options page. Although I do see it says "No" in the settings.
  #4  
Old 05-04-2005, 10:50 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Set the option to yes, and see if it saves it. If it does, then change it to No, it should save it too.

As you can see from the code, the whole section which issues the warning, is enclosed in a conditional, which checks if $vboptions['warn_automaticpm'] == 1, that is if the option is set to yes. If it is set to no, then that whole section never gets executed.

Rgds
  #5  
Old 05-04-2005, 03:44 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
Set the option to yes, and see if it saves it. If it does, then change it to No, it should save it too.

As you can see from the code, the whole section which issues the warning, is enclosed in a conditional, which checks if $vboptions['warn_automaticpm'] == 1, that is if the option is set to yes. If it is set to no, then that whole section never gets executed.

Rgds
hmm I will check that out, another problem that I am having right now is that everytime someone sends a PM to me, I get 2 copies of it instead of one :ermm:
  #6  
Old 05-04-2005, 06:36 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check your private.php file. Something is wrong there.

Rgds
  #7  
Old 05-04-2005, 08:38 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
Check your private.php file. Something is wrong there.

Rgds
Please lock this thread, it was an error from my end, didnt make the changes properly, sorry for all the trouble and I am glad you were able to give fast and great support to your hack, amazing!
  #8  
Old 05-04-2005, 08:57 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually you got me scared to death. Tonight, someone from my forums told me that he had received double PM's as well. And I spend about 3 hours trying to get in touch with him and clarify the issue. In any case, I'll look into it more, but please let me know if you get twins PMs again.

Rgds
Closed Thread


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:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04688 seconds
  • Memory Usage 2,334KB
  • Queries Executed 21 (?)
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_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete