Sexy_Bexy_xx Posted December 1, 2006 Share Posted December 1, 2006 Hi Fellas... having a similar problem here, wondering if anyone could help me out...Getting the errorParse error: syntax error, unexpected '}' in /home/sites/uk-developments.co.uk/public_html/dev/affordable/includes/functions/html_output.php on line 94and /includes/functions/html_output.php on line 420- I do not understand it...Here are the PHP files attached... Im trying to install something on OS Commerce shopping cart - In application_top.php, i had to do the following : Find[code]// include the language translations require(DIR_WS_LANGUAGES . $language . '.php');[/code]And Directly AFTER add this:[Code]// Ultimate SEO URLs v2.1 if (SEO_ENABLED == 'true' or (SEO_ENABLED != 'true' and SEO_ENABLED != 'false')) { include_once(DIR_WS_CLASSES . 'seo.class.php'); if ( !is_object($seo_urls) ) { $seo_urls = new SEO_URL($languages_id); } }[/code]- For the html_output.php file, i have to do the following :Find the tep_href_link() function:[Code]////// The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $request_type, $session_started, $SID; if (!tep_not_null($page)) { die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); } if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } if (tep_not_null($parameters)) { $link .= $page . '?' . tep_output_string($parameters); $separator = '&'; } else { $link .= $page; $separator = '?'; } while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) { if (tep_not_null($SID)) { $_sid = $SID; } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = tep_session_name() . '=' . tep_session_id(); } } } if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { while (strstr($link, '&&')) $link = str_replace('&&', '&', $link); $link = str_replace('?', '/', $link); $link = str_replace('&', '/', $link); $link = str_replace('=', '/', $link); $separator = '?'; } if (isset($_sid)) { $link .= $separator . $_sid; } return $link; }[/code]And REPLACE with :[Code] if (SEO_ENABLED == 'true') { ////// Ultimate SEO URLs v2.1// The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls; if ( !is_object($seo_urls) ){ if ( !class_exists('SEO_URL') ){ include_once(DIR_WS_CLASSES . 'seo.class.php'); } global $languages_id; $seo_urls = new SEO_URL($languages_id); } return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } } else { ////// The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $request_type, $session_started, $SID; if (!tep_not_null($page)) { die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); } if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } if (tep_not_null($parameters)) { $link .= $page . '?' . tep_output_string($parameters); $separator = '&'; } else { $link .= $page; $separator = '?'; } while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) { if (tep_not_null($SID)) { $_sid = $SID; } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = tep_session_name() . '=' . tep_session_id(); } } } if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { while (strstr($link, '&&')) $link = str_replace('&&', '&', $link); $link = str_replace('?', '/', $link); $link = str_replace('&', '/', $link); $link = str_replace('=', '/', $link); $separator = '?'; } if (isset($_sid)) { $link .= $separator . $_sid; } return $link; } }[/code]had to attach thePHP files as txt files... Thanks Guys... x x[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/ Share on other sites More sharing options...
CheesierAngel Posted December 1, 2006 Share Posted December 1, 2006 Please set your code between [ code ] and [ /code ] tags. This makes its beter readable for us.(without the spaces!) Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/#findComment-133392 Share on other sites More sharing options...
HuggieBear Posted December 1, 2006 Share Posted December 1, 2006 Hey SB,Can you provide the two original files and the location of the instructions on how to edit them. Is this an add-on of some kind?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/#findComment-133404 Share on other sites More sharing options...
Sexy_Bexy_xx Posted December 1, 2006 Author Share Posted December 1, 2006 blank.htm - is the instructions on how to install the hack..[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/#findComment-133414 Share on other sites More sharing options...
Jenk Posted December 1, 2006 Share Posted December 1, 2006 You have an unexpcted '}' character in your code, on the lines specified, in the files specified.Have you actually read those lines, and the line preceding it?Have you counted the number of opening braces and compared them to the number of closing braces?Also, can you tell me are the added "x" to the title a weak attempt at gaining above normal interest in this thread? Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/#findComment-133430 Share on other sites More sharing options...
HuggieBear Posted December 1, 2006 Share Posted December 1, 2006 OK, attached are the files I changed. I can see what the problem was.It looks as though the code of OSCommerce has changed since this add-in was created and the code was slightly different.Try the attached files.RegardsHuggie[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/29105-parse-error-syntax-error-unexpected-help-guys-x-x-x/#findComment-133445 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.