Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Question about instructions for HTC


kahml

Recommended Posts

/* reposted from contributions support - because there's been no answer */

 

Just about done installing this and I have a question about the next to last admin change:

 

Find the following (approx line 768)

   $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_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_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
    }
    
Replace with the following    
       
  $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']]);
    }

 

I'm relatively new to PHP (but not to coding), and from the pattern of the If... Else... construct, the first set of statements - in the original code - in the IF section are all performing a tep_get_products_xxx function and in the ELSE section they are all performing a tep_db_prepare_input function.

 

Why is it that the HTC statements in the IF section are in the tep_db_prepare_input format and not the tep_get_products_xxx format?

 

Thanks!

 

Larry

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...