Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error: syntax error, unexpected '}' in


altea

Recommended Posts

This error follows on from my earlier posting related to "1046 - No database selected" after moving ISP. I now have the DB connected (thanks to those who replied to the earlier post). However, I am now receiving this message:

 

Parse error: syntax error, unexpected '}' in /data01/avsonix/public_html/templates/content/index_default.tpl.php on line 29

 

So what's on line 29 of index_default.tpl.php beats me... as I can't read .php So for those who can and understand it, here it is:-

 

<?php
//calc cat colour
$cat1_query = tep_db_query("select parent_id, categories_colour from categories where categories_id  = '" .$current_category_id."'" );
   $cat_info = tep_db_fetch_array($cat1_query); 
if ($cat_info['parent_id']==0)
	{
	$catcol=$cat_info['categories_colour'];
	} 
	else
	{
	$cat1_query = tep_db_query("select c.categories_id,c.parent_id,c.categories_colour from categories c where c.categories_id= '" .$cat_info['parent_id']."'" );
	$cat_info = tep_db_fetch_array($cat1_query); 
	if ($cat_info['parent_id']==0)
			{
			$catcol=$cat_info['categories_colour'];
			} 
			else
			{
			$cat1_query = tep_db_query("select c.categories_id,c.parent_id,c.categories_colour from categories c where c.categories_id= '" .$cat_info['parent_id']."'" );
			$cat_info = tep_db_fetch_array($cat1_query); 
			if ($cat_info['parent_id']==0)
					{
					$catcol=$cat_info['categories_colour'];
					} 
					else
					{
					$cat1_query = tep_db_query("select c.categories_id,c.parent_id,c.categories_colour from categories c where c.categories_id= '" .$cat_info['parent_id']."'" );
					$cat_info = tep_db_fetch_array($cat1_query); 
					if ($cat_info['parent_id']==0)
							{
							$catcol=$cat_info['categories_colour'];
							} 
							else
							{
							$cat1_query = tep_db_query("select c.categories_id,c.parent_id,c.categories_colour from categories c where c.categories_id= '" .$cat_info['parent_id']."'" );
							$cat_info = tep_db_fetch_array($cat1_query); 		
							}										
					}								
			}				
	}
?>
   <!-- bof content.index_products.tpl.php-->
   <br /><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
     <tr bgcolor="<?=$catcol;?>">
       <td height="30" align="left" valign="middle">

       <table border="0" cellpadding="0" cellspacing="5" width="100%">
         <tr>
           <td class="v4_navbar"><?php
   // Get the category name and description
   $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
   $category = tep_db_fetch_array($category_query);
   $heading_text_box = $category['categories_name'];

              if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
                echo $category['categories_heading_title'];
              } else {
                echo $heading_text_box;
              }
            ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <!--manufacture list in index product.php-->
<?php
// BOF: Lango Added for template index_products .tpl MOD
if (MAIN_TABLE_BORDER == 'yes'){
 $heading_text = $heading_text_box ;
table_image_border_top(false, false, $heading_text);
}
// EOF: Lango Added for template MOD
?>
     <tr>
       <td>
       <?php 
//Product Listing Fix - Begin
//decide which product listing to use
 if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
$listing_method = FILENAME_PRODUCT_LISTING_COL;
} else {
$listing_method = FILENAME_PRODUCT_LISTING;
}
//Then show product listing
include(DIR_WS_MODULES . $listing_method); 
//Product Listing Fix - End
?>
       </td>
     </tr>
<?php
// BOF: Lango Added for template MOD
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_bottom();
}
// EOF: Lango Added for template content indexproducts.tlpMOD
?>
   </table>

 

... and here's the site:

 

http://www.avsonix.myzen.co.uk/

 

I have not made any code changes, so is this related to the earlier path problem in the configure.php, an ISP permissions issues, or something else? Any help anyone can give would be really appreciated.

 

/J

Link to comment
Share on other sites

UPDATE

=====

 

This problem was related to the FTP transfer method. Ensure that if you are copying files from one ISP to another, and your PC is the intermediate repository, then the following step may prevent hair loss:

 

Select the Transfer all files in binary to compensate for ASCII file differences when trying to synchronize ASCII files residing on UNIX file systems. It seems that .php files can get corrupted if they contain html strings.

 

Windows and UNIX differ slightly on how they store ASCII files, especially with regards to the End Of Line (EOL) or line breaks in ASCII documents. This difference causes an otherwise identical file to be seen as “different” when performing a synchronization tasks due to the difference in size.

 

All files are transferred in binary mode, which means that an ASCII file residing on a local system is transferred to the remote server with its EOLs intact.

 

Hope this prevents someone's hair loss

 

/J (Baldy)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...