Update instructions for updating Header Tags Controller version 2.6.3 to Header Tags SEO V 3.0 by Jack_mcs ============================================= The following instructions assumes a working shop with Header Tags Controller already installed. Remember! 1) BACKUP FIRST - NO RESPONIBILITY HELD 2) Upload all of the files in the catalog/admin directory. Note, do not use the files in the catalog_for_new_shop_only/admin directory. 3) Find the following line in admin/includes/filenames.php define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php'); define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php'); and Replace it with delete it /*** Begin Header Tags SEO ***/ define('FILENAME_HEADER_TAGS_SEO', 'header_tags_seo.php'); define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php'); /*** End Header Tags SEO ***/ 4) Add the following to admin/includes/database_tables.php, anywhere before the last ?> /*** Begin Header Tags SEO ***/ define('TABLE_HEADERTAGS', 'headertags'); define('TABLE_HEADERTAGS_DEFAULT', 'headertags_default'); /*** End Header Tags SEO ***/ 5) Find the following in admin/includes/column_left.php require(DIR_WS_BOXES . 'header_tags_controller.php'); and replace with /*** Begin Header Tags SEO ***/ require(DIR_WS_BOXES . 'header_tags_seo.php'); /*** End Header Tags SEO ***/ 6) Find the following line in admin/includes/languages/english.php // header_tags_controller text in includes/boxes/header_tags_controller.php define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags'); define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control'); define('BOX_HEADER_TAGS_ENGLISH', 'Text Control'); define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags'); and replace with /*** Begin Header Tags SEO ***/ // header_tags_seo text in includes/boxes/header_tags_seo.php define('BOX_HEADING_HEADER_TAGS_SEO', 'Header Tags SEO'); define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control'); define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags'); /*** End Header Tags SEO ***/ 7) In catalog/includes/application_top.php, FIND: // 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 categories_name 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['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'])); } } // add the products model to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); if (tep_db_num_rows($model_query)) { $model = tep_db_fetch_array($model_query); $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])); } } REPLACE with: /*** 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 categories_htc_title_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "' LIMIT 1"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); $breadcrumb->add($categories['categories_htc_title_tag'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($_GET['manufacturers_id'])) { $manufacturers_query = tep_db_query("select manufacturers_htc_title_tag from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' LIMIT 1"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); $breadcrumb->add($manufacturers['manufacturers_htc_title_tag'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['manufacturers_id'])); } } // add the products name to the breadcrumb trail if (isset($_GET['products_id'])) { $products_query = tep_db_query("select pd.products_head_title_tag from " . TABLE_PRODUCTS . " p left join " . TABLE_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 . "' LIMIT 1"); if (tep_db_num_rows($products_query)) { $products = tep_db_fetch_array($products_query); $breadcrumb->add($products['products_head_title_tag'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'])); } } /*** End Header Tags SEO ***/ 8) Find and remove the following in catalog/includes/application_top.php // BOF: Header Tags Controller v2.6.3 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // EOF: Added: Header Tags Controller v2.6.3 9) In catalog/includes/database_tables.php, anywhere before the last ?> ADD: /*** Begin Header Tags SEO ***/ define('TABLE_HEADERTAGS', 'headertags'); define('TABLE_HEADERTAGS_DEFAULT', 'headertags_default'); /*** End Header Tags SEO ***/ 10) Find the following in includes/header.php ' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . ''; ?> replace with (only 'oscommerce' is being replaced - may vary with your shop): ' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', (tep_not_null($header_tags_array['logo_text']) ? $header_tags_array['logo_text'] : STORE_NAME)) . ''; ?> 11) Find the following in catalog/includes/column_left.php, if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) include(DIR_WS_BOXES . 'header_tags.php'); and Replace with /*** Begin Header Tags SEO ***/ if (HEADER_TAGS_DISPLAY_COLUMN_BOX == 'true' && basename($PHP_SELF) == FILENAME_PRODUCT_INFO) include(DIR_WS_BOXES . 'header_tags.php'); /*** End Header Tags SEO ***/ 12) Find the following in catalog/index.php ADD UNDER: 13) Find the following in catalog/index.php ADD UNDER: 14) Find the following in catalog/product_info.php ' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . ''; ?> ADD BELOW it: 15) Find the following line in catalog/product_info.php Replace with 16) Find the following line in catalog/product_info.php ' . $tags_array['title']; ?> Replace with ' . $header_tags_array['title']; ?> 17) Upload the new files in the contribution. 18) Upload and run the headertags_seo_update.sql or headertags_seo_update.php file located in the database directory. The former is ran via phpmyadmin and the latter by using a browser, like http://yoursite.com/admin/headertags_seo_update.php Note that yoursite.com/admin means the admin of your site. Use whichever method is easier for you. 19) Upload the header_tags_seo_convert.php file located in the Update_Docs directory into the admin directory of your site. Then go to http://yoursite.com/admin/header_tags_seo_convert.php. Note that yoursite.com/admin means the admin of your site. Press enter after entering the correct url and the script will read in whatever header tags files you have in the languages/english (or any language) directory and copy its entries into the database. You should verify the copy occurred correctly by going to admin->Header Tags SEO->Page Control. This will make entries in the database tables using your old english/headertags.php file. Please note that the new system uses a sort order field, which the old did not. If any of the HTxx boxes were set, you should set those to off before converting or you will need to edit them all once they are converted. 20) Delete the old files (not required). admin/header_tags_controller.php admin/header_tags_english.php admin/header_tags_popup_help.php admin/includes/languages/english/header_tags_controller.php admin/includes/languages/english/header_tags_popup_help.php catalog/includes/languages/english/header_tags.php That should do it!