Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Parse Error from Contact Us link - can't find the source...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-28-2006, 03:31 PM
 
dannyrus dannyrus is offline
 

Member
  
Join Date: Sep 2005
Posts: 18
 

Default 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!!
__________________
Danny - Photoscope Б─╒ X-Cart Version 4.0.14
Reply With Quote
  #2  
Old 02-28-2006, 03:57 PM
  Megamuch's Avatar 
Megamuch Megamuch is offline
 

Member
  
Join Date: Feb 2006
Location: Barcelona
Posts: 28
 

Default

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
__________________
X-cart 4.0.17 Pro

Visiting Barcelona? Visit www.bcn-nightlife.com
Reply With Quote
  #3  
Old 02-28-2006, 04:16 PM
 
dannyrus dannyrus is offline
 

Member
  
Join Date: Sep 2005
Posts: 18
 

Default

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!!
__________________
Danny - Photoscope Б─╒ X-Cart Version 4.0.14
Reply With Quote
  #4  
Old 03-02-2006, 01:13 AM
  Megamuch's Avatar 
Megamuch Megamuch is offline
 

Member
  
Join Date: Feb 2006
Location: Barcelona
Posts: 28
 

Default

Could you also post your contactus.tpl file. Thanks.
__________________
X-cart 4.0.17 Pro

Visiting Barcelona? Visit www.bcn-nightlife.com
Reply With Quote
  #5  
Old 03-02-2006, 02:12 PM
 
dannyrus dannyrus is offline
 

Member
  
Join Date: Sep 2005
Posts: 18
 

Default

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!!
__________________
Danny - Photoscope Б─╒ X-Cart Version 4.0.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020