Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error after adding Header Tags in admin/categories


NewBudda

Recommended Posts

Posted

Please help, I am at my wits end and I tried a lot before posting.

After installing Header Tags V2.6.3 I get the following Error message when clicking on the Catalog in teh admin Section:

 

Parse error: parse error, unexpected '}' in /srv/www/vhosts/mysite.de/httpdocs/os1/catalog/admin/categories.php on line 685

 

I checked line 685 and its

  } elseif ($action == 'new_product_preview') {

I checked the code from the clean osc install and found that line 685 is part of the Header Tag contribution. I doublechecked the code and its correct. Here the surrounding code, just in case I missed something. This is line 664 to 742:

<?php
}
?>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
  </tr>
</table></form>
<!-- HTC BOC //-->	 
<?php
 } elseif ($action == 'new_product_preview') {
if (tep_not_null($HTTP_POST_VARS)) {
  $pInfo = new objectInfo($HTTP_POST_VARS);
  $products_name = $HTTP_POST_VARS['products_name'];
  $products_description = $HTTP_POST_VARS['products_description'];
  $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];
  $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];
  $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];
  $products_url = $HTTP_POST_VARS['products_url'];
} else {
  $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
  $product = tep_db_fetch_array($product_query); 
// HTC EOC

  $pInfo = new objectInfo($product);
  $products_image_name = $pInfo->products_image;
}

$form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';

echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');

// HTC BOC		 
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
	$pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);
	$pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);
	$pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
	$pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
	$pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
	$pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);
  } else {
	$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
	$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
	$pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
	$pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
	$pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
	$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
  }		 
// HTC EOC
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?></td>
		<td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td>
  </tr>
<?php

 

The Server runs on Php 4.

 

I have checked the Contrib page for fixes. I have searched the forum for a fix and I have googled this error message but nothing useful came out of it.

 

Please help me if you can, I can't access my products!

Open Source Newsletter: PhPList

Open Source Questionnaire: Lime Survey

Posted

There is a mistake in that file. The given line number isn't always the one of the actual failure. There is an included categories file that you can use to get admin working and compare against yours. Use of a program like Winmerge will make that easier.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

Thank you Jack, what a great tip. I used Winmerge to compare the original file and not the file that was provided with my modified version.

 

Now I know that

<?php
}
?>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>

looked out of place and I removed it. Problem solved!

Open Source Newsletter: PhPList

Open Source Questionnaire: Lime Survey

Archived

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

×
×
  • Create New...