Jump to content

osmotics

Members
  • Content count

    4
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Mark Spalding
  1. osmotics

    Header Tags SEO

    Thanks Jack, I think I understand what I need to do but can I just run headertags_seo_uninstall.php and then the headertags_seo_install.php files? Or will this break everything? If I can't do the above would amending headertags_seo_install.php code to the following be the correct course of action? <?php /* $Id: headertags_seo_install.php, v 3.0 by Jack_mcs osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $htc_check_query = tep_db_query("select * from ". TABLE_PRODUCTS_DESCRIPTION); for ($ctr = 0; $ctr < tep_db_fetch_fields($htc_check_query); $ctr++) { if (false != strstr(mysql_field_name($htc_check_query, $ctr), 'products_head_title_tag')) { echo 'Looks like Header Tags is already installed. Aborting...'; tep_exit(); } } $htc_sql_array = array(array("DROP TABLE IF EXISTS headertags_default"), array("CREATE TABLE headertags_default (default_title varchar(255) default NULL, default_description varchar(255) default NULL, default_keywords varchar(255) default NULL, default_logo_text varchar(255) default NULL, default_logo_append_group tinyint(1) default 1 NOT NULL, default_logo_append_category tinyint(1) default 1 NOT NULL, default_logo_append_manufacturer tinyint(1) default 1 NOT NULL, default_logo_append_product tinyint(1) default 1 NOT NULL, meta_google tinyint(1) default 0 NOT NULL, meta_language tinyint(1) default 0 NOT NULL, meta_noodp tinyint(1) default 1 NOT NULL, meta_noydir tinyint(1) default 1 NOT NULL, meta_replyto tinyint(1) default 0 NOT NULL, meta_revisit tinyint(1) default 0 NOT NULL, meta_robots tinyint(1) default 0 NOT NULL, meta_unspam tinyint(1) default 0 NOT NULL, language_id int DEFAULT '1' NOT NULL)"), array("DROP TABLE IF EXISTS headertags"), array("CREATE TABLE headertags (page_name varchar(64) NULL, page_title varchar(120) default NULL, page_description varchar(255) default NULL, page_keywords varchar(255) default NULL, page_logo varchar(255) default NULL, append_default_title tinyint(1) default 0 NOT NULL, append_default_description tinyint(1) default 0 NOT NULL, append_default_keywords tinyint(1) default 0 NOT NULL, append_default_logo tinyint(1) default 0 NOT NULL, append_category tinyint(1) default 0 NOT NULL, append_manufacturer tinyint(1) default 0 NOT NULL, append_product tinyint(1) default 1 NOT NULL, append_root tinyint(1) default 1 NOT NULL, sortorder_title tinyint(2) default 0 NOT NULL, sortorder_description tinyint(2) default 0 NOT NULL, sortorder_keywords tinyint(2) default 0 NOT NULL, sortorder_logo tinyint(2) default 0 NOT NULL, sortorder_category tinyint(2) default 0 NOT NULL, sortorder_manufacturer tinyint(2) default 0 NOT NULL, sortorder_product tinyint(2) default 10 NOT NULL, sortorder_root tinyint(2) default 1 NOT NULL, language_id int DEFAULT '1' NOT NULL )")); $db_error = false; // create tables foreach ($htc_sql_array as $sql_array) { foreach ($sql_array as $value) { if (tep_db_query($value) == false) { $db_error = true; } } } $htc_sql_array = array(array("INSERT INTO headertags_default VALUES ('Default title', 'Default description', 'Default Keywords', 'Default Logo Text', '0','1','1','1','0','0','1','1','0','0','0','0', '1')"), array("INSERT INTO headertags VALUES ('index.php', 'New Home Page Title', 'new description', 'new keywords1,keywords2', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')"), array("INSERT INTO headertags VALUES ('product_info.php', 'products new home', 'products new description', 'products new keywords1,keywords2', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')"), array("INSERT INTO headertags VALUES ('product_reviews.php', 'Product reviews', 'Product reviews', 'Product reviews', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')"), array("INSERT INTO headertags VALUES ('product_reviews_info.php', 'Product reviews info', 'Product reviews info', 'Product reviews info', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')"), array("INSERT INTO headertags VALUES ('product_reviews_write.php', 'Product reviews write', 'Product reviews write', 'Product reviews write', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')"), array("INSERT INTO headertags VALUES ('specials.php', 'specials', 'specials', 'specials', '', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '0', '0', '0', '0', '10', '1', '1')")); $db_error = false; // create tables foreach ($htc_sql_array as $sql_array) { foreach ($sql_array as $value) { if (tep_db_query($value) == false) { $db_error = true; } } } // create configuration group $group_query = "INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order) VALUES ('20', 'Header Tags SEO', 'Header Tags SEO site wide options', '20')"; if (tep_db_query($group_query) == false) { $db_error = true; } $configuration_group_id = tep_db_insert_id(); // create configuration variables $htc_sql_array = array(array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Automatically Add New Pages', 'HEADER_TAGS_AUTO_ADD_PAGES', 'true', 'Adds any new pages when Page Control is accessed<br>(true=on false=off)', '20', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Check for Missing Tags', 'HEADER_TAGS_CHECK_TAGS', 'true', 'Check to see if any products, categories or manufacturers contain empty meta tag fields<br>(true=on false=off)', '20', '4', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Display Column Box', 'HEADER_TAGS_DISPLAY_COLUMN_BOX', 'false', 'Display product box in column while on product page<br>(true=on false=off)', '20', '5', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Disable Permission Warning', 'HEADER_TAGS_DIABLE_PERMISSION_WARNING', 'false', 'Prevent the warning that appears if the permissions for the includes/header_tags.php file appear to be incoorect.<br>(true=on false=off)', '20', '6', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Display Help Popups', 'HEADER_TAGS_DISPLAY_HELP_POPUPS', 'true', 'Display short popup messages that describes a feature<br>(true=on false=off)', '20', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Display Social Bookmark', 'HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS', 'false', 'Display social bookmarks on the product page<br>(true=on false=off)', '20', '8', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Keyword Density Range', 'HEADER_TAGS_KEYWORD_DENSITY_RANGE', '0.02,0.06', 'Set the limits for the keyword density use to dynamically select the keywords. Enter two figures, separated by a comma', '20', '9', NULL, now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Separator - Description', 'HEADER_TAGS_SEPARATOR_DESCRIPTION', '-', 'Set the separator to be used for the description (and titles and logo).', '20', '10', NULL, now(), NULL)"), array("INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('','Separator - Keywords', 'HEADER_TAGS_SEPARATOR_KEYWORD', ',', 'Set the separator to be used for the keywords.', '20', '11', NULL, now(), NULL)")); foreach ($htc_sql_array as $sql_array) { foreach ($sql_array as $value) { //echo $value . '<br>'; if (tep_db_query($value) == false) { $db_error = true; } } } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php //require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo 'Header Tags Controller Setup'; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if ($db_error == false) { echo 'Database successfully updated for HeaderTags SEO!!!'; ?> </td> </tr> <tr> <td><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> </tr> <?php } else { echo 'Error encountered during database update.</td></tr>'; } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Thanks for your help!
  2. osmotics

    Header Tags SEO

    Jack, I'm getting the following SQL error when trying to update from 3.04 to 3.05 Do you have any ideas why this is happening? v3.04 is working fine and I have upgraded all the way from v2.57 of HTC.
×