View Single Post
  #2  
Old 03-22-2017, 02:16 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// #######################################################################
// ############################# MAIN SCRIPT #############################
// #######################################################################

if ($imp_vars['do'] == 'main')
{
    
$vbgpc = array(
        
'username'            => '',
        
'firstname'            => '',
        
'yourage'            => '',
        
'location'            => '',
        
'sn'                => '',
        
'contactemail'        => '',
        
'aboutyou'            => '',
        
'storyapplying'        => '',
        
'chartype'            => '',
        
'tfwdesiredrole'    => '',
        
'auditionscene'        => '',
        
'charmedexperience'    => '',
        
'jointhestory'        => '',
        
'commentsquestions'    => '',
        
'humanverify'        => ''
    
);
    
    
$forumids rpg_auditionapp_construct_forum_options(rpg_auditionapp_construct_forum_chooser());
    
    if (
$vbulletin->userinfo['permissions']['rpgaaperms'] & $vbulletin->bf_ugp_rpgaaperms['auditionappreqhv'])
    {
        require_once(
DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        
$human_verify $verify->output_token();
    }
    
    
$navbits construct_navbits($navbits); 
    eval(
'$navbar = "' fetch_template('navbar') . '";'); 
    eval(
'print_output("' fetch_template('rpg_auditionapp') . '");');
}

if (
$imp_vars['do'] == 'send')
{
    
$vbulletin->input->clean_array_gpc('p', array(
        
'username'             => TYPE_NOHTML,
        
'firstname'            => TYPE_NOHTML,
        
'yourage'             => TYPE_NOHTML,
        
'location'             => TYPE_NOHTML,
        
'sn'                => TYPE_NOHTML,
        
'contactemail'         => TYPE_NOHTML,
        
'aboutyou'             => TYPE_NOHTML,
        
'storyapplying'     => TYPE_NOHTML,
        
'chartype'             => TYPE_NOHTML,
        
'tfwdesiredrole'    => TYPE_NOHTML,
        
'auditionscene'     => TYPE_NOHTML,
        
'charmedexperience' => TYPE_NOHTML,
        
'jointhestory'         => TYPE_NOHTML,
        
'commentsquestions' => TYPE_NOHTML,
        
'humanverify'         => TYPE_ARRAY
    
));
    
    
$forumids rpg_construct_forum_options(usml_construct_forum_chooser());
    
    if (
$vbulletin->userinfo['permissions']['rpgaaperms'] & $vbulletin->bf_ugp_rpgaaperms['auditionappreqhv'])
    {
        require_once(
DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        
$human_verify $verify->output_token();
    }
    
    if (empty(
$vbulletin->GPC['firstname'])) { $errors[] = fetch_error('rpg_auditionapp_firstname'); }
    if (empty(
$vbulletin->GPC['yourage'])) { $errors[] = fetch_error('rpg_auditionapp_yourage'); }
    if (empty(
$vbulletin->GPC['location'])) { $errors[] = fetch_error('rpg_auditionapp_location'); }
    if (empty(
$vbulletin->GPC['screenname'])) { $errors[] = fetch_error('rpg_auditionapp_screenname'); }
    if (empty(
$vbulletin->GPC['contactemail'])) { $errors[] = fetch_error('rpg_auditionapp_contactemail'); }
    if (empty(
$vbulletin->GPC['aboutyou'])) { $errors[] = fetch_error('rpg_auditionapp_aboutyou'); }
    if (empty(
$vbulletin->GPC['storyapplying'])) { $errors[] = fetch_error('rpg_auditionapp_storyapplying'); }
    if (empty(
$vbulletin->GPC['chartype'])) { $errors[] = fetch_error('rpg_auditionapp_chartype'); }
    if (empty(
$vbulletin->GPC['tfwdesiredrole'])) { $errors[] = fetch_error('rpg_auditionapp_tfwdesiredrole'); }
    if (empty(
$vbulletin->GPC['auditionscene'])) { $errors[] = fetch_error('rpg_auditionapp_auditionscene'$vbulletin->options['bbtitle']);
    if (empty(
$vbulletin->GPC['charmedexperience'])) { $errors[] = fetch_error('rpg_auditionapp_charmedexperience'$vbulletin->options['bbtitle']); }
    if (empty(
$vbulletin->GPC['jointhestory'])) { $errors[] = fetch_error('rpg_auditionapp_jointhestory'); }
    if (empty(
$vbulletin->GPC['commentsquestions'])) { $errors[] = fetch_error('rpg_auditionapp_commentsquestions'); }
    if (empty(
$vbulletin->GPC['humanverify'])) { $errors[] = fetch_error('rpg_auditionapp_auditionscene'); }
    if (
$vbulletin->userinfo['permissions']['rpgaaperms'] & $vbulletin->bf_ugp_rpgaaperms['auditionappreqhv']) { if (!$verify->verify_token($vbulletin->GPC['humanverify'])) { $errors[] = fetch_error('humanverify_image_wronganswer'); } }
    
    if (
$vbulletin->userinfo['permissions']['rpgaaperms'] & $vbulletin->bf_ugp_rpgaaperms['auditionappviewip']) { $ipaddress IPADDRESS; } else { $ipaddress $vbphrase['rpg_auditionapp_restricted']; }
    if (
$vbulletin->userinfo['permissions']['rpgaaperms'] & $vbulletin->bf_ugp_rpgaaperms['auditionappviewhost']) { $hostname gethostbyaddr(IPADDRESS); } else { $hostname $vbphrase['rpg_auditionapp_restricted']; }
    
    if (!empty(
$vbulletin->GPC['forumids']))
    {
        foreach (
$vbulletin->GPC['forumids'] AS $forumid)
        {
            
$applyingto[] = $vbulletin->forumcache["$forumid"]['title_clean'];
        }
        
$applyingto implode(', '$applyingto);
    }
    
    if (
count($errors) > 0)
    {
        foreach (
$errors AS $error)
        {            
            
$new_errors .= $error ".<br />\n";
        }
        
$errors $vbphrase['rpg_auditionapp_errorsfound'];
        
$errors .= $new_errors;
        
$submit false;
        } else {
        
$submit true;
    }
    
    if (
$submit)
    {
        
    
// ####################### START BUILDING MESSAGES #######################
    
$subject construct_phrase($vbphrase['rpg_auditionapp_subject'], $vbulletin->GPC['storyapplying'], $vbulletin->GPC['username']);
$posttitle construct_phrase($vbphrase['rpg_auditionapp_vote'], $vbulletin->GPC['username'], $vbulletin->GPC['storyapplying']);
$emailappmsg "$vbphrase[rpg_auditionapp_firstname]{$vbulletin->GPC['firstname']}

$vbphrase[rpg_auditionapp_username]{$vbulletin->GPC['username']}
$vbphrase[rpg_auditionapp_fname]{$vbulletin->GPC['firstname']}
$vbphrase[rpg_auditionapp_age]{$vbulletin->GPC['yourage']}
$vbphrase[rpg_auditionapp_loc]{$vbulletin->GPC['location']}
$vbphrase[rpg_auditionapp_sn]{$vbulletin->GPC['screenname']}
$vbphrase[rpg_auditionapp_email]{$vbulletin->GPC['contactemail']}
$vbphrase[rpg_auditionapp_aboutyou] {$vbulletin->options['bbtitle']}?::{$vbulletin->GPC['aboutyou']}

$vbphrase[rpg_auditionapp_applyingto]:
$applyingto

$vbphrase[rpg_auditionapp_storyapply]{$vbulletin->GPC['storyapplying']}
$vbphrase[rpg_auditionapp_chararchtype]{$vbulletin->GPC['chartype']}
$vbphrase[rpg_auditionapp_tfwrole]{$vbulletin->GPC['tfwdesiredrole']}
$vbphrase[rpg_auditionapp_youraudscene]{$vbulletin->GPC['auditionscene']}

$vbphrase[rpg_auditionapp_charmedxp]{$vbulletin->GPC['charmedexperience']}
$vbphrase[rpg_auditionapp_joinstory]{$vbulletin->GPC['jointhestory']}
$vbphrase[rpg_auditionapp_commentandquest]{$vbulletin->GPC['commentsquestions']}

$vbphrase[ip_address]$ipaddress
$vbphrase[rpg_auditionapp_hostname]$hostname

$vbphrase[rpg_auditionapp_greeting]
$vbphrase[rpg_auditionapp_staff]
"
;

        
$postappmsg "[b]$vbphrase[rpg_auditionapp_username][/b]: {$vbulletin->GPC['username']}
[b]
$vbphrase[rpg_auditionapp_fname][/b]: {$vbulletin->GPC['firstname']}
[b]
$vbphrase[rpg_auditionapp_age][/b]: {$vbulletin->GPC['yourage']}
[b]
$vbphrase[rpg_auditionapp_loc][/b]: {$vbulletin->GPC['location']}
[b]
$vbphrase[rpg_auditionapp_sn][/b]: {$vbulletin->GPC['screenname']}
[b]
$vbphrase[rpg_auditionapp_email][/b]: {$vbulletin->GPC['contactemail']}
[b]
$vbphrase[rpg_auditionapp_aboutyou][/b]: {$vbulletin->options['bbtitle']}?::{$vbulletin->GPC['aboutyou']}

[b]
$vbphrase[rpg_auditionapp_storyapply][/b]: {$vbulletin->GPC['storyapplying']}
[b]
$vbphrase[rpg_auditionapp_chararchtype][/b]: {$vbulletin->GPC['chartype']}
[b]
$vbphrase[rpg_auditionapp_tfwrole][/b]: {$vbulletin->GPC['tfwdesiredrole']}
[b]
$vbphrase[rpg_auditionapp_youraudscene][/b]: {$vbulletin->GPC['auditionscene']}

[b]
$vbphrase[rpg_auditionapp_charmedxp][/b]: {$vbulletin->GPC['charmedexperience']}
[b]
$vbphrase[rpg_auditionapp_joinstory][/b]: {$vbulletin->GPC['jointhestory']}
[b]
$vbphrase[rpg_auditionapp_commentandquest][/b]: {$vbulletin->GPC['commentsquestions']}

[b]
$vbphrase[ip_address]:[/b] $ipaddress
[b]
$vbphrase[rpg_auditionapp_hostname]:[/b] $hostname

$vbphrase[rpg_auditionapp_greeting]
$vbphrase[rpg_auditionapp_staff]
"
;

    
// ############################# SEND E-MAIL #############################
    
        
if (!empty($addresses))
        {
            foreach (
$addresses AS $address)
            {
                
vbmail($address$subject$emailappmsgtrue$vbulletin->GPC['webmasteremail']);
            }
        }
        
    
// ###################### CREATE THREAD IF ENABLED #######################
    
        
switch($vbulletin->options['rpg_auditionapp_createthread'])
        {
            case 
1;
                require_once(
DIR '/includes/functions_newpost.php');
                
                
$forumid $vbulletin->options['rpg_auditionapp_forumid'];
                
$user_id $vbulletin->userinfo['userid'];
                
$username $vbulletin->userinfo['username'];
                
$target_foruminfo fetch_foruminfo($forumid);
                
$newpost = array(
                    
'userid'        => $user_id,
                    
'username'      => $username,
                    
'message'       => $postappmsg,
                    
'title'         => $subject,
                    
'poststarttime' => TIMENOW,
                    
'emailupdate'   => 0
                
);
                
                
build_new_post('thread'$target_foruminfo, array(), array(), $newpost$errors);
                
                if (
sizeof($errors) > 0) { $error_info construct_errors($errors); }
                
                require_once(
DIR '/includes/functions_databuild.php');
                
build_forum_counters($forumid);
            break;
            
            case 
2;
                require_once(
DIR '/includes/functions_newpost.php');
                
                
$forumid $vbulletin->options['rpg_auditionapp_forumid'];
                
$user_id $vbulletin->userinfo['userid'];
                
$username $vbulletin->userinfo['username'];
                
$target_foruminfo fetch_foruminfo($forumid);
                
$newpost = array(
                    
'userid'        => $user_id,
                    
'username'      => $username,
                    
'message'       => $postappmsg,
                    
'title'         => $subject,
                    
'poststarttime' => TIMENOW,
                    
'emailupdate'   => 0
                
);
                
                
build_new_post('thread'$target_foruminfo, array(), array(), $newpost$errors);
                
                
$pollpublic = ($vbulletin->options['rpg_auditionapp_pollpublic']);
                
$polloption[1] = ($vbulletin->options['rpg_auditionapp_polloption1']);
                
$polloption[2] = ($vbulletin->options['rpg_auditionapp_polloption2']);
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption3'])) { $polloption[3] = ($vbulletin->options['rpg_auditionapp_polloption3']); }
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption4'])) { $polloption[4] = ($vbulletin->options['rpg_auditionapp_polloption4']); }
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption5'])) { $polloption[5] = ($vbulletin->options['rpg_auditionapp_polloption5']); }
                
                
$threadinfo verify_id('thread'$newpost[threadid], 01);
                
$polloptions count($polloption);
                
$question $posttitle;
                
$vbulletin->GPC['options'] = $polloption;
                
$counter 0;
                
$optioncount 0;
                
$badoption '';
                while (
$counter++ < $polloptions)
                {
                    if (
$vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                    {
                        
$badoption .= iif($badoption', ') . $counter;
                    }
                    if (!empty(
$vbulletin->GPC['options']["$counter"]))
                    {
                        
$optioncount++;
                    }
                }
                
                
$poll =& datamanager_init('Poll'$vbulletinERRTYPE_STANDARD);
                
$counter 0;
                while (
$counter++ < $polloptions)
                {
                    if (
$vbulletin->GPC['options']["$counter"] != '')
                    {
                        
$poll->set_option($vbulletin->GPC['options']["$counter"]);
                    }
                }
                
                
$poll->set('question',    $question);
                
$poll->set('dateline',    TIMENOW);
                
$poll->set('active',    '1');
                
$poll->set('public',    '1');
                
$pollid $poll->save();
                
$threadman datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
                
$threadman->set_existing($threadinfo);
                
$threadman->set('pollid'$pollid);
                
$threadman->save();
                
                if (
sizeof($errors) > 0) { $error_info construct_errors($errors); }

                require_once(
DIR '/includes/functions_databuild.php');
                
build_forum_counters($forumid);
            break;
            
            case 
3;
                require_once(
DIR '/includes/functions_newpost.php');
                
                
$forumid $vbulletin->options['rpg_auditionapp_forumid'];
                
$user_id $vbulletin->userinfo['userid'];
                
$username $vbulletin->userinfo['username'];
                
$target_foruminfo fetch_foruminfo($forumid);
                
$newpost = array(
                    
'userid'        => $user_id,
                    
'username'      => $username,
                    
'message'       => $postappmsg,
                    
'title'         => $subject,
                    
'poststarttime' => TIMENOW,
                    
'emailupdate'   => 0
                
);
                
                
build_new_post('thread'$target_foruminfo, array(), array(), $newpost$errors);
                
                
$pollpublic = ($vbulletin->options['rpg_auditionapp_pollpublic']);
                
$polloption[1] = ($vbulletin->options['rpg_auditionapp_polloption1']);
                
$polloption[2] = ($vbulletin->options['rpg_auditionapp_polloption2']);
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption3'])) { $polloption[3] = ($vbulletin->options['rpg_auditionapp_polloption3']); }
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption4'])) { $polloption[4] = ($vbulletin->options['rpg_auditionapp_polloption4']); }
                if (!empty(
$vbulletin->options['rpg_auditionapp_polloption5'])) { $polloption[5] = ($vbulletin->options['rpg_auditionapp_polloption5']); }
                
                
$threadinfo verify_id('thread'$newpost[threadid], 01);
                
$polloptions count($polloption);
                
$question $posttitle;
                
$vbulletin->GPC['options'] = $polloption;
                
$counter 0;
                
$optioncount 0;
                
$badoption '';
                while (
$counter++ < $polloptions)
                {
                    if (
$vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                    {
                        
$badoption .= iif($badoption', ') . $counter;
                    }
                    if (!empty(
$vbulletin->GPC['options']["$counter"]))
                    {
                        
$optioncount++;
                    }
                }
                
                
$poll =& datamanager_init('Poll'$vbulletinERRTYPE_STANDARD);
                
$counter 0;
                while (
$counter++ < $polloptions)
                {
                    if (
$vbulletin->GPC['options']["$counter"] != '')
                    {
                        
$poll->set_option($vbulletin->GPC['options']["$counter"]);
                    }
                }
                
                
$poll->set('question',    $question);
                
$poll->set('dateline',    TIMENOW);
                
$poll->set('active',    '1');
                
$poll->set('public',    '0');
                
$pollid $poll->save();
                
$threadman datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
                
$threadman->set_existing($threadinfo);
                
$threadman->set('pollid'$pollid);
                
$threadman->save();
                
                if (
sizeof($errors) > 0) { $error_info construct_errors($errors); }

                require_once(
DIR '/includes/functions_databuild.php');
                
build_forum_counters($forumid);
            break;
        }
        
        
// ######################### CREATE PM IF ENABLED ########################
        
            
switch($vbulletin->options['rpg_auditionapp_notifypm'])
            {
            case 
1;
                require_once(
DIR '/includes/functions_auditionapp.php');
                
                
$sendfrom $vbulletin->db->fetch_array(get_name($vbulletin->userinfo['userid']));
                
$blank = array();
                
$pmdata =& datamanager_init('PM'$vbulletinERRTYPE_SILENT);
                
$pmdata->set('fromuserid'$vbulletin->userinfo['userid']);
                
$pmdata->set('fromusername'$sendfrom['username']);
                
$pmdata->set_recipients($vbulletin->options['rpg_auditionapp_pmreceive'], $blank);
                
$pmdata->set_info('reciept'false);
                
$pmdata->set_info('savecopy'false);
                
$pmdata->set('title'$subject);
                
$pmdata->set('message'$postappmsg);
                
$pmdata->set('dateline'TIMENOW);
                
$pmdata->set_info('is_automated'true);
                
$pmdata->save();
                unset(
$pmdata);
            break;
            
            case 
2;
                require_once(
DIR '/includes/functions_auditionapp.php');
                
$sendfrom $vbulletin->db->fetch_array(get_name($vbulletin->options['rpg_auditionapp_pmsender']));
                
$blank = array();
                
$pmdata =& datamanager_init('PM'$vbulletinERRTYPE_SILENT);
                
$pmdata->set('fromuserid'$vbulletin->options['rpg_auditionapp_pmsender']);
                
$pmdata->set('fromusername'$sendfrom['username']);
                
$pmdata->set_recipients($vbulletin->options['rpg_auditionapp_pmreceive'], $blank);
                
$pmdata->set_info('reciept'false);
                
$pmdata->set_info('savecopy'false);
                
$pmdata->set('title'$subject);
                
$pmdata->set('message'$postappmsg);
                
$pmdata->set('dateline'TIMENOW);
                
$pmdata->set_info('is_automated'true);
                
$pmdata->save();
                unset(
$pmdata);
            break;
        }
        
        
$vbulletin->url $vbulletin->options['forumhome'] . '.php' $vbulletin->session->vars['sessionurl_q'];
        eval(
print_standard_redirect('rpg_auditionapp_thanks'truetrue));
        
        
$navbits construct_navbits($navbits);
        eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('rpg_auditionapp_application') . '");');
        } else {
        
$imp_vars['do'] = 'errors';
        
$vbgpc =& $vbulletin->GPC;
        
        
$navbits construct_navbits($navbits);
        eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('rpg_auditionapp_application') . '");');
    }
}

?> 
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01627 seconds
  • Memory Usage 2,212KB
  • 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
  • (1)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