X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Parse Error from Contact Us link - can't find the source... (https://forum.x-cart.com/showthread.php?t=20224)

dannyrus 02-28-2006 03:31 PM

Parse Error from Contact Us link - can't find the source...
 
When I click on the "Contact Us" link in the help menu box, I get the following parse error:

Parse error: parse error, unexpected T_VARIABLE in /clientdata/www/au/p/photoscope.com.au/templates_c/%%97^971^97120B85%%contactus.tpl.php on line 231

I've emptied the templates_c folder a few times and restarted browser / computer, and tried on a number of computers but still get the error - can anyone see what the issue may be??

I haven't worked on this site for a while, last time I clicked on the contact us link it worked - haven't seen this error before.

Thanks for any help!!

Megamuch 02-28-2006 03:57 PM

What I usually do is, I download the file,

open it up in my favorite php editor and look at the line that is causing the error.

Find that line and post it here :)

dannyrus 02-28-2006 04:16 PM

Thanks for the quick reply, the code for line 231 is:

Code:

" <?php if ($this->_tpl_vars['userinfo']['b_country'] ==
$this->_tpl_vars['countries'][$this->_sections['country_idx']['index']]['country_code']):
?>selected<?php elseif
($this->_tpl_vars['countries'][$this->_sections['country_idx']['index']]['country_code']
$this->_tpl_vars['config']['General']['default_country'] && ""):
?>selected<?php endif; ?>><?php echo
$this->_tpl_vars['countries'][$this->_sections['country_idx']['index']]['country'];
?>


Dunno if that helps, but thankyou!!

Megamuch 03-02-2006 01:13 AM

Could you also post your contactus.tpl file. Thanks.

dannyrus 03-02-2006 02:12 PM

Thanks for helping me out with this... I couldn't find a contactus.tpl - when I checked where the "Contact Us" link points to it was this:



So this is the code from "include/help.php":

Code:

if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

$location[] = array(func_get_langvar_by_name("lbl_help_zone"), "help.php");

if (!empty($login))
        $userinfo = func_userinfo($login,$login_type);

if (empty($section)) $section = "";

if($action=="contactus" || $section == 'contactus') {
        $additional_fields = func_get_add_contact_fields($current_area, $login);

        $default_fields = unserialize($config["Contact_Us"]["contact_us_fields"]);
        if(!$default_fields) {
                $default_fields = array();
                foreach($default_contact_us_fields as $k => $v) {
                        $default_fields[$k]["title"] = func_get_default_field($k);
                        $default_fields[$k]['avail'] = (is_array($v['avail'])?$v['avail'][$current_area]:$v['avail']);
                        $default_fields[$k]['required'] = (is_array($v['required'])?$v['required'][$current_area]:$v['required']);
                }
        } else {
                $tmp = array();
                foreach($default_fields as $k => $v) {
                        $tmp[$v['field']] = array("avail" => (preg_match("/$current_area/S", $v['avail'])?"Y":""), "required" =>(preg_match("/$current_area/S", $v['required'])?"Y":""), "title" => func_get_default_field($v['field']));
                }
                $default_fields = $tmp;
                unset($tmp);
        }
}

if ($REQUEST_METHOD=="POST" and $action=="contactus") {
#
# Send mail to support
#
        $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);

        while (list($key,$val) = each($HTTP_POST_VARS))
                if($key != 'additional_values')
                        $contact[$key]=$val;

        $fillerror = false;
        foreach($default_fields as $k => $v) {
                if(empty($contact[$k]) && $v['required'] == 'Y' &&  $v['avail'] == 'Y') {
                        $fillerror = true;
                }
        }
        if(!$fillerror and is_array($additional_fields)) {
                foreach($additional_fields as $k => $v) {
                        $additional_fields[$k]['value'] = $HTTP_POST_VARS['additional_values'][$v['fieldid']];
                        if(empty($HTTP_POST_VARS['additional_values'][$v['fieldid']]) && $v['required'] == 'Y' &&  $v['avail'] == 'Y')
                                $fillerror = true;
                }
        }

        if(!$fillerror) {
                $fillerror = (empty($subject) || empty($body));
        }
        if(!$fillerror) {
                $contact["b_statename"]= func_get_state($contact["b_state"], $contact["b_country"]);
                $contact["b_countryname"]= func_get_country($contact["b_country"]);
                if ($config["General"]["use_counties"] == "Y")
                        $contact["b_countyname"]= func_get_county($contact["b_county"]);

                if(!empty($active_modules['SnS_connector']) && $current_area == 'C')
                        func_generate_sns_action("FillContactForm");

                $mail_smarty->assign("contact",$contact);
                $mail_smarty->assign("additional_fields",$additional_fields);

                func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);

                func_header_location("help.php?section=contactus");
        } else {
                unset($HTTP_POST_VARS['additional_values']);
                $userinfo = $HTTP_POST_VARS;
                $userinfo["login"] = $userinfo["uname"];
        }
}
#
# Recover password
#
if ($REQUEST_METHOD=="POST" and $action=="recover_password") {

$accounts = func_query("select login, password, usertype from $sql_tbl[customers] where email='$email' and status='Y'");

#
# Decrypt passwords
#
if($accounts) {
        foreach($accounts as $key=>$account)
                $accounts[$key]["password"]=text_decrypt($accounts[$key]["password"]);

        $mail_smarty->assign("accounts",$accounts);

        func_send_mail($email, "mail/password_recover_subj.tpl", "mail/password_recover.tpl", $config["Company"]["support_department"], false);

        func_header_location("help.php?section=Password_Recovery_message&email=".urlencode($email));
}
else
        func_header_location("help.php?section=Password_Recovery_error&email=".urlencode($email));

}

if ($section=="contactus") {
        include $xcart_dir."/include/states.php";
        include $xcart_dir."/include/countries.php";
        if ($config["General"]["use_counties"] == "Y")
                include $xcart_dir."/include/counties.php";
}

if($section == 'cvv2') {
        $popup_title = 'What is CVV2?';
}

if($popup_title)
        $smarty->assign("popup_title", $popup_title);

if(!empty($active_modules['SnS_connector']) && $current_area == 'C' && $section != 'contactus') {
        if($section == 'business' || $section == 'conditions') {
                func_generate_sns_action("ViewLegalInfo");
        } else {
                func_generate_sns_action("ViewHelp");
        }
}

$smarty->assign("userinfo",@$userinfo);
$smarty->assign("fillerror",@$fillerror);

$smarty->assign("default_fields", $default_fields);
$smarty->assign("additional_fields", $additional_fields);
$smarty->assign("fillerror", $fillerror);

$smarty->assign("main","help");
$smarty->assign("help_section",$section);

?>


Hope that makes sense - thanks again!!


All times are GMT -8. The time now is 02:02 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.