Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2017, 02:15 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBulletin 3 Request - Help with Debugging PHP Code

I have been rewriting a pre-existing mod, and when I test my php file, I get the following error:

PHP Code:
Parse errorsyntax errorunexpected $end in /home3/charmeddark/public_html/auditionapp.php on line 520 
I have done a fair amount of research, and from what I can gather it is a closing bracket or quotation that is missing, however, I have been unable to locate the specific line causing this issue. Also, Line 520 correlates to:

PHP Code:
?> 
Due to limitations on threads, the source code of the php file in question, will be displayed in the next two posts below.

I appreciate any assistance with this issue that can be offered.

Thank you,

EDIT: The php file is located at http://charmeddarkness.net/auditionapp.php

--------------- Added [DATE]1490152559[/DATE] at [TIME]1490152559[/TIME] ---------------

PHP Code:
<?php

// #######################################################################
// ####################### SET PHP ENVIRONMENT ###########################
// #######################################################################

error_reporting(E_ALL & ~E_NOTICE);

// #######################################################################
// #################### DEFINE IMPORTANT CONSTANTS #######################
// #######################################################################

define('THIS_SCRIPT''auditionapp');
define('CSRF_PROTECTION'true);

// #######################################################################
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// #######################################################################

$phrasegroups = array();
$specialtemplates = array();

$globaltemplates = array(
    
'rpg_auditionapp',
    
'humanverify'
);

$actiontemplates = array();

// #######################################################################
// ######################### REQUIRE BACK-END ############################
// #######################################################################

require_once('./global.php');
require_once(
DIR '/includes/functions.php');
require_once(
DIR '/includes/functions_auditionapp.php');

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$imp_vars = array(
            
'do' => ''
);

$pages = array(
            
'main',
            
'send'
);

$addresses explode(","$vbulletin->options['rpg_auditionapp_notifyemail']);
$rpg_auditionapp_days_registered floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400);

$imp_vars['do'] = $_REQUEST['do'];

if (!(
in_array($imp_vars['do'], $pages)))
{
    
$imp_vars['do'] = 'main';
}

if (!
$vbulletin->options['rpg_auditionapp_onoff']) { standard_error(fetch_error('rpg_auditionapp_disabled')); }
if (!(
$permissions['rpgaaperms'] & $vbulletin->bf_ugp['rpgaaperms']['cansubmitauditionapp'])) { print_no_permission(); }

if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & $vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_rep_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['posts'], $vbulletin->userinfo['reputation'], $rpgaa_days_registered));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & $vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_rep_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['posts'], $vbulletin->userinfo['reputation']));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['posts'], $usml_days_registered));
}
else if (
$vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_rep_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['reputation'], $rpgaa_days_registered));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['posts']));
}
else if (
$vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_rep_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['reputation']));
}
else if (
floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $rpgaa_days_registered));
}

$navbits = array();
$navbits[] = 'Audition Application';
Reply With Quote
  #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
  #3  
Old 03-22-2017, 03:32 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The best I can tell, you need an additional closing brace "}" at the end of your script.
Reply With Quote
  #4  
Old 03-22-2017, 03:42 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL! I actually just added a second } right before ?> And it worked...
Reply With Quote
Благодарность от:
MarkFL
  #5  
Old 03-22-2017, 03:50 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use Notepad++ to create/edit PHP/js files, and it will show you which bracketing symbol matches with another, and this was how I was able to determine that you needed another closing brace at the end.

I would recommend using standard indentation of your code to make such issues more readily apparent as well.
Reply With Quote
  #6  
Old 03-22-2017, 03:59 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I use Notepad++ to create/edit PHP/js files, and it will show you which bracketing symbol matches with another, and this was how I was able to determine that you needed another closing brace at the end.

I would recommend using standard indentation of your code to make such issues more readily apparent as well.
Actually, I have a new issue... nothing with the code itself, its with the product itself. The usergroup permission entries are getting added to the datatable permissions... but there not showing up when going to edit a userhgroup...

PHP Code:
<installcode><![CDATA[$installpath1 DIR '';
$installpath2 DIR '/includes/hooks/auditionapp';
$installpath3 DIR '/includes/xml';
$installpath4 DIR '/includes';

if (
file_exists($installpath2 '/admin_options_processing.php'))
{
    
print_dots_start('Verifying files');
    
print_cp_message('Installation Error!<br /><br />Please remove /admin_options_processing.php from ' $installpath2 ' before continuing!');
    
print_dots_stop();
}
else if (!
file_exists($installpath1 '/auditionapp.php') OR !file_exists($installpath2 '/online_location_process.php') OR !file_exists($installpath2 '/online_location_unknown.php') OR !file_exists($installpath2 '/parse_templates.php') OR !file_exists($installpath3 '/bitfield_auditionapp.xml') OR !file_exists($installpath4 '/functions_auditionapp.php'))
{
    
print_dots_start('Verifying files');
    
print_cp_message('Installation Error!<br /><br />Please upload all files before importing the .xml');
    
print_dots_stop();
}
else if (
file_exists($installpath1 '/auditionapp.php') & file_exists($installpath2 '/online_location_process.php') & file_exists($installpath2 '/online_location_unknown.php') & file_exists($installpath2 '/parse_templates.php') & file_exists($installpath3 '/bitfield_auditionapp.xml') & file_exists($installpath4 '/functions_auditionapp.php'))
{
$usmlproduct = array(
    
'rpg_auditionapp'
);

    echo 
"<br />";
    echo 
"<center>Please remember to <b>Mark as Installed</b> on vBulletin.org</center>";
    
vbflush(); 
    if (!empty(
$rpgproduct))
    {
        foreach (
$rpgproduct as $oldrpgproduct)
        {
            
$check $db->query_first_slave("
                SELECT version FROM "
.TABLE_PREFIX."product WHERE productid = '".$db->escape_string($oldrpgproduct)."'
            "
);
            if (
$check['version'])
            {
                
delete_product($oldrpgproduct);
                
vbflush(); 
                
sleep(2);
            }
        }
    }
    
print_dots_start('Verifying files');
    
print_dots_stop();
    
print_dots_start('Altering  table <b>' TABLE_PREFIX 'usergroup</b>');
    
$vbulletin->db->hide_errors();
    
    
$vbulletin->db->query_write("ALTER TABLE " TABLE_PREFIX "usergroup ADD rpgaaperms INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
    
$vbulletin->db->query_write("ALTER TABLE " TABLE_PREFIX "usergroup ADD auditionappminpostreq INT( 10 ) NOT NULL DEFAULT '500'");
    
$vbulletin->db->query_write("ALTER TABLE " TABLE_PREFIX "usergroup ADD auditionappminrepreq INT( 10 ) NOT NULL DEFAULT '100'");
    
$vbulletin->db->query_write("ALTER TABLE " TABLE_PREFIX "usergroup ADD auditionappminregreq INT( 10 ) NOT NULL DEFAULT '90'");
    
    require_once(
DIR '/includes/class_bitfield_builder.php');  
    
$myobj =& vB_Bitfield_Builder::init(); 
    
$myobj->save($db); 
    
build_forum_permissions();
    
    
$vbulletin->db->show_errors();
    
print_dots_stop();
}]]></
installcode
Reply With Quote
  #7  
Old 03-22-2017, 04:13 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would ask about this in the product thread, so the author of the code will have a better chance of seeing your question.
Reply With Quote
  #8  
Old 03-22-2017, 04:15 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I would ask about this in the product thread, so the author of the code will have a better chance of seeing your question.
This was a pre-existing product that I was revising. It was the Staff Application mod that I am repurposing as more of Audition system for roleplay stories. I didn't want to ask there considering that a lot of the code has been changed from what it was originally written, you know what I mean?

--------------- Added [DATE]1490159923[/DATE] at [TIME]1490159923[/TIME] ---------------

I think I found something...

PHP Code:
$usmlproduct = array( 
The usml should have been changed, but I overlooked it. Should have been...

PHP Code:
$rpgproduct = array( 
Reply With Quote
  #9  
Old 03-22-2017, 04:31 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, yes if you are rewriting an existing product to suit your needs, then asking the original author isn't necessarily a good idea.
Reply With Quote
  #10  
Old 03-22-2017, 04:32 AM
Alice Alice is offline
 
Join Date: Mar 2013
Location: Great Lakes Area
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Okay, yes if you are rewriting an existing product to suit your needs, then asking the original author isn't necessarily a good idea.
Pretty much I edited a lot of the base php file, and nearly all of the xml and hook files, as well as the product file, so yeah.

Anyhow, yeah, I'm at a loss on this though.

--------------- Added [DATE]1490160872[/DATE] at [TIME]1490160872[/TIME] ---------------

The following is the code in the auditionapp.php file as it relates to the usergroup permissions:

PHP Code:
$imp_vars = array(
            
'do' => ''
);

$pages = array(
            
'main',
            
'send'
);

$addresses explode(","$vbulletin->options['rpg_auditionapp_notifyemail']);
$rpg_auditionapp_days_registered floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400);

$imp_vars['do'] = $_REQUEST['do'];

if (!(
in_array($imp_vars['do'], $pages)))
{
    
$imp_vars['do'] = 'main';
}

if (!
$vbulletin->options['rpg_auditionapp_onoff']) { standard_error(fetch_error('rpg_auditionapp_disabled')); }
if (!(
$permissions['rpgaaperms'] & $vbulletin->bf_ugp['rpgaaperms']['cansubmitauditionapp'])) { print_no_permission(); }

if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & $vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_rep_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['posts'], $vbulletin->userinfo['reputation'], $rpgaa_days_registered));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & $vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_rep_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['posts'], $vbulletin->userinfo['reputation']));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['posts'], $rpg_days_registered));
}
else if (
$vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'] & floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_rep_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $vbulletin->userinfo['reputation'], $rpgaa_days_registered));
}
else if (
$vbulletin->userinfo['posts'] < $vbulletin->userinfo['permissions']['auditionappminpostreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_post_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminpostreq'], $vbulletin->userinfo['posts']));
}
else if (
$vbulletin->userinfo['reputation'] < $vbulletin->userinfo['permissions']['auditionappminrepreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_rep_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminrepreq'], $vbulletin->userinfo['reputation']));
}
else if (
floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400) < $vbulletin->userinfo['permissions']['auditionappminregreq'])
{
    
standard_error(fetch_error('rpg_auditionapp_register_permissions'$vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $rpgaa_days_registered));
}

$navbits = array();
$navbits[] = 'Audition Application'
--------------- Added [DATE]1490164374[/DATE] at [TIME]1490164374[/TIME] ---------------

Here is the .xml file:

PHP Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="rpg_auditionapp">
    <bitfielddefs>
        <groupname="ugp">
            <groupname="rpgaaperms">
                <bitfield="cansubmitauditionapp" phrase="rpg_auditionapp_cansubmit" group="rpg_auditionapp_permissions">1</bitfield>
                <bitfield="auditionappreqhv" phrase="rpg_auditionapp_reqhv" group="rpg_auditionapp_permissions">2</bitfield>
                <bitfield="auditionappviewip" phrase="rpg_audition_viewip" group="rpg_auditionapp_permissions">4</bitfield>
                <bitfield="auditionappviewhost" phrase="rpg_audition_viewhost" group="rpg_auditionapp_permissions">8</bitfield>
                <bitfield="auditionminpostreq" phrase="rpg_audition_minpostreq" group="rpg_auditionapp_permissions" intperm="true">16</bitfield>
                <bitfield="auditionminrepreq" phrase="rpg_audition_minrepreq" group="rpg_auditionapp_permissions" intperm="true">32</bitfield>
                <bitfield="auditionminregreq" phrase="rpg_audition_minregreq" group="rpg_auditionapp_permissions" intperm="true">64</bitfield>
            </group>
        </group>
    </bitfielddefs>
</bitfields>
Reply With Quote
Reply


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 04:47 PM.


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.07392 seconds
  • Memory Usage 2,675KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (9)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete