Update instructions for updating Header Tags SEO version 3.3.4 to Header Tags SEO V 3.3.5 by Jack_mcs - oscommerce-solution.com

===================================================================
1 - Upload the datebase update file - headertags_seo_update.php - to them
    root of the shop and then execute it by visiting this url:
    http:// YOUR DOMAIN NAME/headertags_seo_update.php?reset_options=true
    
===================================================================
2 - Upload the new files. If you have edited your headertags_seo_styles.css, or any of the new files, be sure to compare.

===================================================================
3 - In admin/includes/languages/english/categories.php,

FIND:

/*** End Header Tags SEO ***/

ADD ABOVE:

define('TEXT_PRODUCTS_ADDITIONAL_WORDS', 'Additional Words: (comma separated)');

===================================================================
4 - In admin/categories.php,

FIND:

                                    'products_head_sub_text' => tep_db_prepare_input($HTTP_POST_VARS['products_head_sub_text'][$language_id]));

REPLACE WITH:

                                    'products_head_sub_text' => tep_db_prepare_input($HTTP_POST_VARS['products_head_sub_text'][$language_id]),                                     
                                    'products_head_additional_words' => tep_db_prepare_input($HTTP_POST_VARS['products_head_additional_words'][$language_id]));                                     

===================================================================
5 - In admin/categories.php,

FIND:

           /*** Begin Header Tags SEO ***/
            $description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
            while ($description = tep_db_fetch_array($description_query)) {
              tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_title_tag_alt']) . "', '" . tep_db_input($description['products_head_title_tag_url']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_head_breadcrumb_text']) . "', '" . tep_db_input($description['products_head_listing_text']) . "', '" . tep_db_input($description['products_head_sub_text']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
            }       
           /*** End Header Tags SEO ***/
           
REPLACE WITH:

           /*** Begin Header Tags SEO ***/
            $description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_head_additional_words, products_url from products_description where products_id = '" . (int)$products_id . "'");
            while ($description = tep_db_fetch_array($description_query)) {
              tep_db_query("insert into products_description (products_id, language_id, products_name, products_description, products_url, products_viewed, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_head_additional_words) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_title_tag_alt']) . "', '" . tep_db_input($description['products_head_title_tag_url']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_head_breadcrumb_text']) . "', '" . tep_db_input($description['products_head_listing_text']) . "', '" . tep_db_input($description['products_head_sub_text']) . "', '" . tep_db_input($description['products_head_additional_words']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
            }       
           /*** End Header Tags SEO ***/           

===================================================================
6 - In admin/categories.php, (adding pd.products_head_additional_words)

FIND: 

   /*** Begin Header Tags SEO ***/
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_head_additional_words, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   /*** End Header Tags SEO ***/ 

REPLACE WITH:

   /*** Begin Header Tags SEO ***/
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_head_additional_words, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   /*** End Header Tags SEO ***/   

===================================================================
7 - In admin/categories.php, 

FIND:

      $products_head_sub_text = $HTTP_POST_VARS['products_head_sub_text'];

ADD BENEATH:

      $products_head_additional_words = $HTTP_POST_VARS['products_head_additional_words'];
      
===================================================================
8 - In admin/categories.php, (TWO PLACES)

FIND:      
        $pInfo->products_head_sub_text = tep_db_prepare_input($products_head_sub_text[$languages[$i]['id']]);

ADD BENEATH:

        $pInfo->products_head_additional_words = tep_db_prepare_input($products_head_additional_words[$languages[$i]['id']]);
        
===================================================================
9 - In admin/categories.php,

FIND:        
        echo tep_draw_hidden_field('products_head_sub_text[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_sub_text[$languages[$i]['id']])));
     
ADD BENEATH:

       echo tep_draw_hidden_field('products_head_additional_words[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_additional_words[$languages[$i]['id']])));
     
        
===================================================================
10 - In admin/manufacturers.php,

FIND:

        $manufacturer_htc_description_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_textarea_field('manufacturers_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, '');

REPLACE WITH:

        if (HEADER_TAGS_ENABLE_HTML_EDITOR == 'No Editor' || HEADER_TAGS_ENABLE_EDITOR_MANUFACTURERS == 'false') {
            $manufacturer_htc_description_string .= '<br>' . tep_image(tep_catalog_href_link('includes/languages/' . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name'], '', '', 'style="vertical-align: top;"') . '&nbsp;' . tep_draw_textarea_field('manufacturers_description[' . $languages[$i]['id'] . ']', 'soft', '80', '10');
        } else {
            $manufacturer_htc_description_string .= '<br>' . tep_image(tep_catalog_href_link('includes/languages/' . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name'], '', '', 'style="vertical-align: top;"') . '&nbsp;' . tep_draw_textarea_ckeditor('manufacturers_description[' . $languages[$i]['id'] . ']', '80', '10');
        }        
      
===================================================================
11 - In admin/manufacturers.php, 

FIND:

        $manufacturer_htc_description_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_textarea_field('manufacturers_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, tep_get_manufacturer_htc_description($mInfo->manufacturers_id, $languages[$i]['id']));

REPLACE WITH:

        if (HEADER_TAGS_ENABLE_HTML_EDITOR == 'No Editor' || HEADER_TAGS_ENABLE_EDITOR_MANUFACTURERS == 'false') {        
            $manufacturer_htc_description_string .= '<br />' . tep_image(tep_catalog_href_link('includes/languages/' . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name'], '', '', 'style="vertical-align: top;"') . '&nbsp;' . tep_draw_textarea_field('manufacturers_description[' . $languages[$i]['id'] . ']', 'soft', '80', '10', tep_get_manufacturer_htc_description($mInfo->manufacturers_id, $languages[$i]['id']));
        } else {    
            $manufacturer_htc_description_string .= '<br />' . tep_image(tep_catalog_href_link('includes/languages/' . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name'], '', '', 'style="vertical-align: top;"') . '&nbsp;' . tep_draw_textarea_ckeditor('manufacturers_description[' . $languages[$i]['id'] . ']', '80', '10', tep_get_manufacturer_htc_description($mInfo->manufacturers_id, $languages[$i]['id']));
        }        
        
===================================================================
12 - In includes/languages/english.php, 

FIND:

define('TEXT_SEE_MORE', 'See More about %s');

REPLACE WITH:

define('TEXT_SEE_MORE', 'see more');
define('TEXT_SEE_MORE_FULL', 'see more about %s');    

===================================================================
13 - In includes/modules/product_listing.php. This change will vary
     with the version of your shop you need to compare this file with
     the one include for your shop to see what is needed. This change
     provides the general idea of the change.
     
FIND:     

            if (tep_db_num_rows($hts_listing_query) > 0) {              
                $hts_listing = tep_db_fetch_array($hts_listing_query);
                if (tep_not_null($hts_listing['products_head_listing_text'])) {
                    $lc_add .= '<div class="hts_listing_text">' . $hts_listing['products_head_listing_text'] . '...<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '"><span style="color:red;">' . sprintf(TEXT_SEE_MORE, $listing['products_name']) . '</span></a></div>';
                } else if (HEADER_TAGS_ENABLE_AUTOFILL_LISTING_TEXT == 'true') {
                    $text = sprintf("%s...%s", substr(stripslashes(strip_tags($hts_listing['products_description'])), 0, 100), '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '"><span style="color:red;">' . sprintf(TEXT_SEE_MORE, $listing['products_name']) . '</span></a>');
                    $lc_add .= '<div class="hts_listing_text">' . $text . '</div>';
                }    
                
REPLACE WITH:

            if (tep_db_num_rows($hts_listing_query) > 0) {              
                $seeMore = '';
                switch (HEADER_TAGS_DISPLAY_SEE_MORE) {
                    case 'off': break;
                    case 'short': $seeMore = '...' . TEXT_SEE_MORE; break;
                    case 'full': $seeMore = '...' . sprintf(TEXT_SEE_MORE_FULL, $listing['products_name']); break;
                }            
                $hts_listing = tep_db_fetch_array($hts_listing_query);
                if (tep_not_null($hts_listing['products_head_listing_text'])) {
                    $lc_add .= '<div class="hts_listing_text">' . $hts_listing['products_head_listing_text'] . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '">' . $seeMore . '</a></div>';
                } else if (HEADER_TAGS_ENABLE_AUTOFILL_LISTING_TEXT == 'true') {
                    $text = sprintf("%s...%s", substr(stripslashes(strip_tags($hts_listing['products_description'])), 0, 100), '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '">' . $seeMore . '</a>');
                    $lc_add .= '<div class="hts_listing_text">' . $text . '</div>';
                }       

===================================================================
14 - In includes/application_top.php,

FIND the section beginning and ending with

/*** Begin Header Tags SEO ***/
 
/*** End Header Tags SEO ***/    

REPLACE WITH: (the above and all lines between them)    

/*** Begin Header Tags SEO ***/
// add category names or the manufacturer name to the breadcrumb trail
  if (isset($cPath_array)) {
    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
      $categories_query = tep_db_query("select IF(categories_htc_breadcrumb_text !='', categories_htc_breadcrumb_text, categories_name) as title from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = " . (int)$cPath_array[$i] . " and language_id = " . (int)$languages_id);
      if (tep_db_num_rows($categories_query) > 0) {
        $categories = tep_db_fetch_array($categories_query);
        $breadcrumb->add($categories['title'], tep_href_link('index.php', 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
      } else {
        break;
      }
    }
  } elseif (isset($_GET['manufacturers_id'])) {
    $manufacturers_query = tep_db_query("select IF(mi.manufacturers_htc_breadcrumb_text !='',mi.manufacturers_htc_breadcrumb_text, m.manufacturers_name) as title from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id=mi.manufacturers_id where m.manufacturers_id= " . (int)$_GET['manufacturers_id'] . " AND languages_id = " . (int)$languages_id);
    if (tep_db_num_rows($manufacturers_query)) {
      $manufacturers = tep_db_fetch_array($manufacturers_query);
      $breadcrumb->add($manufacturers['title'], tep_href_link('index.php', 'manufacturers_id=' . $_GET['manufacturers_id']));
    }
  }

 // add the products name to the breadcrumb trail
 if (isset($_GET['products_id'])) {
     if (HEADER_TAGS_BREADCRUMB_MODEL_OVERRIDE == 'true') {
         $products_query = tep_db_query("select p.products_model as model from products p left join products_description pd on p.products_id = pd.products_id where p.products_id = " . (int)$_GET['products_id'] . " and pd.language_id =" .  (int)$languages_id);
         if (tep_db_num_rows($products_query)) {
             $products = tep_db_fetch_array($products_query);          
             $title = $products['model'];
             $args = isset($_GET['reviews_id']) ? tep_get_all_get_params() : 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'] ;
             $breadcrumb->add($title, tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args));
         }      
     } else { 
         $addModel = false;
         $db_query = tep_db_query("select 1 from headertags where page_name = '" . tep_db_input(basename($_SERVER['SCRIPT_FILENAME'])) . "' and append_model=1");
         if (tep_db_num_rows($db_query)) {
             $addModel = true;
         }
         
         $products_query = tep_db_query("select IF(pd.products_head_breadcrumb_text !='', pd.products_head_breadcrumb_text,pd.products_name) as title, p.products_model as model from products p left join products_description pd on p.products_id = pd.products_id where p.products_id = " . (int)$_GET['products_id'] . " and pd.language_id =" .  (int)$languages_id);
         if (tep_db_num_rows($products_query)) {
             $products = tep_db_fetch_array($products_query);          
             $title = ($addModel && tep_not_null($products['model']) ? $products['model'] . ' - ' . $products['title'] : $products['title']);
             $args = isset($_GET['reviews_id']) ? tep_get_all_get_params() : 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'] ;
             $breadcrumb->add($title, tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args));
         }
     }    
  }
/*** End Header Tags SEO ***/

===================================================================
15 - In includes/footer.php,

FIND:

      echo '<tr><td align="center"><div style="text-align:center">';
      include(DIR_WS_INCLUDES . 'headertags_seo_tagcloud_footer.php');
      
REPLACE WITH:

      echo '<tr><td align="center"><div id="hts_footer">';
      include('includes/headertags_seo_tagcloud_footer.php');      
      
===================================================================
16 - In advanced_search_result.php,

FIND:

            $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";
          }  

ADD BENEATH:

          if (HEADER_TAGS_ENABLE_ADDITIONAL_WORDS == 'true') {
            $where_str .= " or pd.products_head_additional_words like '%" . tep_db_input($keyword) . "%'";
          }    

===================================================================
17 - In product_info.php, (for pre-BS shops only)

FIND: ( placement isn't important - this is just a suggestion)

      <tr>
        <td>
<?php
    if ((USE_CACHE == 'true') && empty($SID)) {
          

ADD ABOVE:          
      
  <?php 
  /*** Begin Header Tags SEO ***/
  echo '<tr><td><div style="margin-bottom:20px">';
  include('includes/modules/headertags_seo_additional.php'); 
  echo '</div></td></tr>';
  /*** End Header Tags SEO ***/
  ?>             
  
===================================================================
18 - In admin/includes/filenames/php, (OPTIONAL)

DELETE

  /*** Begin Header Tags SEO ***/
  define('FILENAME_HEADER_TAGS_SEO', 'header_tags_seo.php');
  define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');
  define('FILENAME_HEADER_TAGS_KEYWORDS', 'header_tags_seo_keywords.php');
  define('FILENAME_HEADER_TAGS_SILO', 'header_tags_seo_silo.php');
  define('FILENAME_HEADER_TAGS_SOCIAL', 'header_tags_seo_social.php');  
  define('FILENAME_HEADER_TAGS_TEST', 'header_tags_test.php');  
  /*** End Header Tags SEO ***/  