PDA

View Full Version : vBulletin 3 Request - Help with Debugging PHP Code


Alice
03-22-2017, 02:15 AM
I have been rewriting a pre-existing mod, and when I test my php file, I get the following error:

Parse error: syntax error, unexpected $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:

?>

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 1490152559 at 1490152559 ---------------


<?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_disabl ed')); }
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_r ep_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_r ep_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_r egister_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_re gister_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_p ermissions', $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_pe rmissions', $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_regist er_permissions', $vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $rpgaa_days_registered));
}

$navbits = array();
$navbits[] = 'Audition Application';

Alice
03-22-2017, 02:16 AM
// ################################################## #####################
// ############################# 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_auditi onapp_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_c hooser());

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 = "$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_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]
";

// ############################# SEND E-MAIL #############################

if (!empty($addresses))
{
foreach ($addresses AS $address)
{
vbmail($address, $subject, $emailappmsg, true, $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], 0, 1);
$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', $vbulletin, ERRTYPE_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', $vbulletin, ERRTYPE_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], 0, 1);
$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', $vbulletin, ERRTYPE_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', $vbulletin, ERRTYPE_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', $vbulletin, ERRTYPE_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', $vbulletin, ERRTYPE_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_than ks', true, true));

$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') . '");');
}
}

?>

MarkFL
03-22-2017, 03:32 AM
The best I can tell, you need an additional closing brace "}" at the end of your script. :)

Alice
03-22-2017, 03:42 AM
LOL! I actually just added a second } right before ?> And it worked...

MarkFL
03-22-2017, 03:50 AM
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. :)

Alice
03-22-2017, 03:59 AM
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...


<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>

MarkFL
03-22-2017, 04:13 AM
I would ask about this in the product thread, so the author of the code will have a better chance of seeing your question. ;)

Alice
03-22-2017, 04:15 AM
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 1490159923 at 1490159923 ---------------

I think I found something...

$usmlproduct = array(

The usml should have been changed, but I overlooked it. Should have been...

$rpgproduct = array(

MarkFL
03-22-2017, 04:31 AM
Okay, yes if you are rewriting an existing product to suit your needs, then asking the original author isn't necessarily a good idea. :)

Alice
03-22-2017, 04:32 AM
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 1490160872 at 1490160872 ---------------

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


$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_disabl ed')); }
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_r ep_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_r ep_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_r egister_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_re gister_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_p ermissions', $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_pe rmissions', $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_regist er_permissions', $vbulletin->userinfo['username'], $vbulletin->userinfo['permissions']['auditionappminregreq'], $rpgaa_days_registered));
}

$navbits = array();
$navbits[] = 'Audition Application';


--------------- Added 1490164374 at 1490164374 ---------------

Here is the .xml file:


<?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>

Alice
03-29-2017, 04:42 PM
After about a week of debugging, it was an issue with a missing semicolon in the functions_auditionapp.php file LOL!

MarkFL
03-29-2017, 04:44 PM
After about a week of debugging, it was an issue with a missing semicolon in the functions_auditionapp.php file LOL!

Yep, those missing semi-colons can be a real PITA. :eek:;):D

Alice
03-29-2017, 05:17 PM
Tell me about it lol