View Single Post
  #8  
Old 08-10-2009, 02:53 AM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if (in_array($threadinfo['forumid'],array(33,29,34,37)))
{
$show['pm'] = false;

So I added that plugin to infraction_update_start which is near the start of if ($_POST['do'] == 'update') and it didnt work. I'm sure I am doing something wrong though. This is the chunk of code above the $show['pm'] chunk.

PHP Code:
if ($_POST['do'] == 'update')
{
    
$vbulletin->input->clean_array_gpc('p', array(
        
'infractionlevelid' => TYPE_UINT,
        
'warning'           => TYPE_ARRAY_BOOL,
        
'note'              => TYPE_STR,
        
'message'           => TYPE_STR,
        
'iconid'            => TYPE_UINT,
        
'wysiwyg'           => TYPE_BOOL,
        
'parseurl'          => TYPE_BOOL,
        
'signature'         => TYPE_BOOL,
        
'disablesmilies'    => TYPE_BOOL,
        
'receipt'           => TYPE_BOOL,
        
'preview'           => TYPE_STR,
        
'savecopy'          => TYPE_BOOL,
        
'expires'           => TYPE_UINT,
        
'points'            => TYPE_STR// leave as STR
        
'period'            => TYPE_NOHTML,
        
'customreason'      => TYPE_STR,
        
'banreason'         => TYPE_NOHTML,
    ));

    (
$hook vBulletinHook::fetch_hook('infraction_update_start')) ? eval($hook) : false;

    
$errors = array();
    
$infdata =& datamanager_init('Infraction'$vbulletinERRTYPE_STANDARD);
    
$infdata->setr_info('warning'$vbulletin->GPC['warning']["{$vbulletin->GPC[infractionlevelid]}"]);
    
$infdata->setr_info('postinfo'$postinfo);
    
$infdata->setr_info('userinfo'$userinfo);
    
$infdata->setr_info('threadinfo'$threadinfo);
    
$infdata->set_info('banreason'$vbulletin->GPC['banreason']);

    if (
$vbulletin->GPC['points'] !== '')
    {
        
$vbulletin->GPC['points'] = intval($vbulletin->GPC['points']);
    }

    if (!
$vbulletin->GPC['infractionlevelid'] AND $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangivearbinfraction'])
    {    
// custom infraction
        
if (empty($vbulletin->GPC['customreason']) OR (!$vbulletin->GPC['expires'] AND $vbulletin->GPC['period'] != 'N'))
        {
            if (empty(
$vbulletin->GPC['customreason']))
            {
                
$errors[] = 'invalid_custom_infraction_description';
            }
            if (!
$vbulletin->GPC['expires'] AND $vbulletin->GPC['period'] != 'N')
            {
                
$errors[] = 'invalid_timeframe';
            }
        }
        else
        {
            switch(
$vbulletin->GPC['period'])
            {
                case 
'D'$expires mktime(date('H'), date('i'), date('s'), date('m'), date('d') + $vbulletin->GPC['expires'], date('y')); break;
                case 
'M'$expires mktime(date('H'), date('i'), date('s'), date('m') + $vbulletin->GPC['expires'], date('d'), date('y')); break;
                case 
'N'$expires 0; break;
                case 
'H':
                default:
                    
$expires mktime(date('H') + $vbulletin->GPC['expires'], date('i'), date('s'), date('m'), date('d'), date('y')); break;
            }
            
$infdata->set('expires'$expires);
            
$infdata->set('points'$vbulletin->GPC['points']);
            
$infdata->set('customreason'$vbulletin->GPC['customreason']);
        }

        if (
$vbulletin->GPC['points'] AND empty($vbulletin->GPC['banreason']) AND ($infractionban OR ($minimumpointsban AND $vbulletin->GPC['points'] + $userinfo['ipoints'] >= $minimumpointsban)))
        {
            
$errors[] = 'invalid_banreason';
        }
    }
    else
    {
        
$infractionlevel verify_id('infractionlevel'$vbulletin->GPC['infractionlevelid'], 11);
        if (
$infractionlevel['extend'])
        {
            if (isset(
$infcache["$infractionlevel[infractionlevelid]"]['expires']))
            {
                if (
$infcache["$infractionlevel[infractionlevelid]"]['expires'] == 0)
                {
                    
$infdata->set('expires'0);
                }
                else if ((
$expiretime $infcache["$infractionlevel[infractionlevelid]"]['expires'] - TIMENOW) > 0)
                {
                    switch(
$infractionlevel['period'])
                    {
                        case 
'D'$expires $expiretime mktime(date('H'), date('i'), date('s'), date('m'), date('d') + $infractionlevel['expires'], date('y')); break;
                        case 
'M'$expires $expiretime mktime(date('H'), date('i'), date('s'), date('m') + $infractionlevel['expires'], date('d'), date('y')); break;
                        case 
'N'$expires 0; break;
                        case 
'H':
                        default:
                            
$expires $expiretime mktime(date('H') + $infractionlevel['expires'], date('i'), date('s'), date('m'), date('d'), date('y')); break;
                    }

                    
$infdata->set('expires'$expires);
                }
            }
        }

        if (!
$vbulletin->GPC['warning']["{$vbulletin->GPC[infractionlevelid]}"] AND empty($vbulletin->GPC['banreason']) AND ($infractionban OR ($minimumpointsban AND $infractionlevel['points'] + $userinfo['ipoints'] >= $minimumpointsban)))
        {
            
$errors[] = 'invalid_banreason';
        }

        
$infdata->setr_info('infractionlevel'$infractionlevel);
        
$infdata->set('infractionlevelid'$vbulletin->GPC['infractionlevelid']);
    }

    
$banusergroupid 0;
    
$liftdate 0;
    if (!empty(
$banlist) AND $points $infdata->fetch_field('points'))
    {
        
// Look for the longest ban that applies
        
foreach ($banlist AS $ban)
        {
            if ((
$ban['method'] == 'infractions' AND $ban['amount'] == $totalinfractions 1) OR ($ban['method'] == 'points' AND $ban['amount'] <= $userinfo['ipoints'] + $points))
            {
                if (
$ban['liftdate'] == 0)
                {
                    
$liftdate 0;
                    
$banusergroupid $ban['banusergroupid'];
                    break;
                }
                else if (
$liftdate <= $ban['liftdate'])
                {
                    
$liftdate $ban['liftdate'];
                    
$banusergroupid $ban['banusergroupid'];
                }
            }
        }
        if (
$banusergroupid AND !$liftdate)
        {
            
$nocontact true;
        }
    }

    
$infdata->set('whoadded'$vbulletin->userinfo['userid']);
    
$infdata->set('postid'$postinfo['postid']);
    
$infdata->set('note'fetch_censored_text($vbulletin->GPC['note']));

    
// include useful functions
    
require_once(DIR '/includes/functions_newpost.php');
    require_once(
DIR '/includes/functions_misc.php');

    
// unwysiwygify the incoming data
    
if ($vbulletin->GPC['wysiwyg'])
    {
        require_once(
DIR '/includes/functions_wysiwyg.php');
        
$vbulletin->GPC['message'] = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $vbulletin->options['privallowhtml']);
    }

    
// parse URLs in message text
    
if ($vbulletin->options['privallowbbcode'] AND $vbulletin->GPC['parseurl'])
    {
        
$vbulletin->GPC['message'] = convert_url_to_bbcode($vbulletin->GPC['message']);
    }

    if (
$show['pm'])
    {
        if (empty(
$vbulletin->GPC['message']) AND $vbulletin->options['uimessage'] AND !$nocontact)
        {
            
$errors[] = 'nomessagetouser';
        }

        
$pm['message'] =& $vbulletin->GPC['message'];
        
$pm['parseurl'] =& $vbulletin->GPC['parseurl'];
        
$pm['savecopy'] =& $vbulletin->GPC['savecopy'];
        
$pm['signature'] =& $vbulletin->GPC['signature'];
        
$pm['disablesmilies'] =& $vbulletin->GPC['disablesmilies'];
        
$pm['receipt'] =& $vbulletin->GPC['receipt'];
        
$pm['iconid'] =& $vbulletin->GPC['iconid'];

        
// *************************************************************
        // PROCESS THE MESSAGE AND INSERT IT INTO THE DATABASE 
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02307 seconds
  • Memory Usage 1,954KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete