Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

Hi,

 

Managed to install this contribution and it seems to work great as far as I can tell.

 

However, I cant now get into my admin area :-( The following code is displayed

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/suppneqs/public_html/admin/categories.php on line 80

 

I think this is happening because I have not merged the header tags seo code with the categories image box contribution code (because I don't know enough about PHP yet to do this)

 

Here are the offending bits of code:

 

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

$categories_htc_title_array = $HTTP_POST_VARS['categories_htc_title_tag'];

$categories_htc_desc_array = $HTTP_POST_VARS['categories_htc_desc_tag'];

$categories_htc_keywords_array = $HTTP_POST_VARS['categories_htc_keywords_tag'];

$categories_htc_description_array = $HTTP_POST_VARS['categories_htc_description'];

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

$language_id = $languages[$i]['id'];

 

// Start Categories images box

$categories_description_front_array = $_POST['categories_description_front'];

 

'categories_description_front' => tep_db_prepare_input ($categories_description_front_array[$language_id] ) ;

// End Categories images box

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

$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),

 

The line in bold is line 80.

 

Could someone please help me out on this one ? I have been through the 154 pages of this thread, and cant find a similar problem.

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

'categories_description_front' => tep_db_prepare_input ($categories_description_front_array[$language_id] );
// End Categories images box
/*** Begin Header Tags SEO ***/
$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),

I think that the first line should be last, like this (also changed a semicolon to a comma):

// End Categories images box
/*** Begin Header Tags SEO ***/
$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),
					'categories_description_front' => tep_db_prepare_input($categories_description_front_array[$language_id] ),

Don't forget to backup before you try it.

Always back up before making changes.

Link to comment
Share on other sites

Hi and thanks - but now I get this error:

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/suppneqs/public_html/admin/categories.php on line 85

 

Line 85 is:

 

'categories_htc_title_tag' => (tep_not_null($categories_htc_title_array[$language_id]) ? tep_db_prepare_input($categories_htc_title_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

 

maybe I should install the supplied version of the categories.php file and get help on merging the categories image box contribution ?

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Which included files? Do you mean the ones in the catalog_for_new_shop_only? I always did a manual install because I am using a website with 2 languages: english and romanian.

That doesn't matter on a clean shop. You would still have to make the additional language changes but the other included files will work.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi and thanks - but now I get this error:

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/suppneqs/public_html/admin/categories.php on line 85

 

Line 85 is:

 

'categories_htc_title_tag' => (tep_not_null($categories_htc_title_array[$language_id]) ? tep_db_prepare_input($categories_htc_title_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

 

maybe I should install the supplied version of the categories.php file and get help on merging the categories image box contribution ?

 

Thanks

See the troubleshooting section in the install files.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

That doesn't matter on a clean shop. You would still have to make the additional language changes but the other included files will work.

 

Jack

 

Thank you very much for all your help. I reinstalled a clean Oscommerce RC2.2 and then I did an automatic install. I installed the romanian language by copying and renaming the english language files to romanian both in the catalog/includes/languages and in admin/includes/languages. I set the romanian language to default.

 

It seems that all the files in english work well: Example product in english , but the romanian don't even if it has the EXACT same files as the english: Example product in romanian . What other changes do I need to to get the romanian to work?

 

Here are the test results:

 

Test Results

 

Default Text Present: explain

The default root text, New Home Page Title, should be removed or changed for index.php with language ID of 4.

The default root text, products new home, should be removed or changed for product_info.php with language ID of 1.

 

 

 

 

Missing Code in File explain

The Header Tags head code for the product_reviews.php file cannot be found.

The Header Tags head code for the product_reviews_info.php file cannot be found.

The Header Tags head code for the product_reviews_write.php file cannot be found.

The Header Tags head code for the specials.php file cannot be found.

 

Thanks a lot!

Link to comment
Share on other sites

It seems that all the files in english work well: Example product in english , but the romanian don't even if it has the EXACT same files as the english: Example product in romanian . What other changes do I need to to get the romanian to work?

Are the check boxes in page control for the index and products_info pages set the same for both languages? If you go into a products edit page, are the meta tags filled in for both languages?

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Are the check boxes in page control for the index and products_info pages set the same for both languages? If you go into a products edit page, are the meta tags filled in for both languages?

 

Jack

 

Yes they are:

 

Page control ->product_info.php

 

fky5qp.jpg

 

Catalog -> page description edit

 

b7o31z.jpg

Link to comment
Share on other sites

Hi all,

 

Just thought I'd give my 2 pence worth and advise on an issue I've been struggling with for a while. I've had the issue a lot of people have mentioned whereby Header Tags SEO (v3.1.5 in my case) and Ultimate SEO URL's (v2.1d on mine) only display the default header information on pages based around index.php. All other pages work fine.

 

I figured it was only pages that had been rewritten to .html, so started playing around. I eventually figured that changing PHP_SELF to $_SERVER[php_self] on line 32 of includes/header_tags.php resolves the issue.

 

Hope this helps a lot of people out as I've read all 150+ pages of this forum thread and been scouring the interweb for days.

 

Cheers

 

Andy

Link to comment
Share on other sites

Hi, I have a problem where all my category pages are showing the folloing code error at the top of the page.

 

/*** Begin Header Tags SEO ***/ if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); else $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $htc = tep_db_fetch_array($db_query); ?>

 

I do not have any manufacturers set up in my shop. Would this be the reason for the error?

 

You can view this at www.jati-keswick.co.uk My store version is 2.2-MS2

 

It looks like the mystore/index.php is being accessed at the time of the error.

 

I have set this contribution up on another shop and had no problems.

 

I have also run the test and have eliminated all errors that were showing but this has not got rid of this problem.

 

Thanks for any help

 

Michael

Link to comment
Share on other sites

Hi all,

 

Just thought I'd give my 2 pence worth and advise on an issue I've been struggling with for a while. I've had the issue a lot of people have mentioned whereby Header Tags SEO (v3.1.5 in my case) and Ultimate SEO URL's (v2.1d on mine) only display the default header information on pages based around index.php. All other pages work fine.

 

I figured it was only pages that had been rewritten to .html, so started playing around. I eventually figured that changing PHP_SELF to $_SERVER

[php_self] on line 32 of includes/header_tags.php resolves the issue.

Hope this helps a lot of people out as I've read all 150+ pages of this forum thread and been scouring the interweb for days.

Cheers

Andy[/quote]
You must be using an older version since 3.1.5 has this code at line 32 already
case (basename($_SERVER['PHP_SELF']) === FILENAME_DEFAULT):

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi, I have a problem where all my category pages are showing the folloing code error at the top of the page.

 

I do not have any manufacturers set up in my shop. Would this be the reason for the error?

 

You can view this at www.jati-keswick.co.uk My store version is 2.2-MS2

 

It looks like the mystore/index.php is being accessed at the time of the error.

 

I have set this contribution up on another shop and had no problems.

 

I have also run the test and have eliminated all errors that were showing but this has not got rid of this problem.

You've made a mistake in the file changes. Either read the troubleshooting instructions or use the included file.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You've made a mistake in the file changes. Either read the troubleshooting instructions or use the included file.

 

Jack

 

Thanks Jack, that was a quick reply.

 

You are correct, I have used a file comparison program and found that I had an extra ?> which should have been removed at line 247 of index.php.

 

Feels great once you find the errors and it works.

 

Thanks for your help

 

Michael

Link to comment
Share on other sites

Hi all,

 

I've written a PHP page for displaying articles from a Wordpress DB (heavily modified version of Wordpress Article Manager - my version is available as the latest download), but header tags SEO is only displaying the default header info.

 

The file is represented within includes/header_tags.php and has an entry that matches within includes/filenames.php, but I still can't seem to get it to display anything other than the default tags.

 

Any ideas where I should be looking ?

 

Cheers

Link to comment
Share on other sites

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.

 

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

 

ERROR: Unclosed quote @ 79

STR: '

SQL: ALTER TABLE `headertags` ADD `append_product` TINYINT( 1 ) NOT NULL DEFAULT \'1\';

ALTER TABLE `headertags` ADD `append_root` TINYINT( 1 ) NOT NULL DEFAULT \'1\';

ALTER TABLE `headertags` ADD `sortorder_product` TINYINT( 1 ) NOT NULL DEFAULT \'10\';

ALTER TABLE `headertags` ADD `sortorder_root` TINYINT( 1 ) NOT NULL DEFAULT \'1\';

 

 

SQL query:

 

ALTER TABLE `headertags` ADD `append_product` TINYINT( 1 ) NOT NULL DEFAULT \'1\'; ALTER TABLE `headertags` ADD `append_root` TINYINT( 1 ) NOT NULL DEFAULT \'1\'; ALTER TABLE `headertags` ADD `sortorder_product` TINYINT( 1 ) NOT NULL DEFAULT \'10\'; ALTER TABLE `headertags` ADD `sortorder_root` TINYINT( 1 ) NOT NULL DEFAULT \'1\';

 

MySQL said:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'1\';

ALTER TABLE `headertags` ADD `append_root` TINYINT( 1 ) NOT NULL DEFAU' at line 1

Link to comment
Share on other sites

Hi all,

 

I've written a PHP page for displaying articles from a Wordpress DB (heavily modified version of Wordpress Article Manager - my version is available as the latest download), but header tags SEO is only displaying the default header info.

 

The file is represented within includes/header_tags.php and has an entry that matches within includes/filenames.php, but I still can't seem to get it to display anything other than the default tags.

 

Any ideas where I should be looking ?

 

Cheers

If it doesn't show in page control, then it is missing the <head> changes.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

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.

There was a mistake in one or two of the sql update staements. Open the headertags_seo_install.php file and remove the statements for updating the products, categories and manufacturers and then run that file. It should update everything correctly. More in-depth instructions are posted in this thread if you need them.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

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!

 

 

 

There was a mistake in one or two of the sql update staements. Open the headertags_seo_install.php file and remove the statements for updating the products, categories and manufacturers and then run that file. It should update everything correctly. More in-depth instructions are posted in this thread if you need them.

 

Jack

Link to comment
Share on other sites

If it doesn't show in page control, then it is missing the <head> changes.

 

Jack

 

Hi Jack,

 

My page is showing in page control. It allows me to enter the header information, which goes into the DB row correctly, but when checking "View Result" it displays the default tags with a yellow background. I'm not sure where I should be looking for the issue.

 

Cheers

Link to comment
Share on other sites

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?

If you run the uninstall and then install, the database will be setup correctly. However that will erase whatever entries you have in your categories. products and manufacturer tags. If you don't have any special ones you want to keep, then just uninstall and install and then run fill tags.

 

The script looks OK.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack,

 

My page is showing in page control. It allows me to enter the header information, which goes into the DB row correctly, but when checking "View Result" it displays the default tags with a yellow background. I'm not sure where I should be looking for the issue.

 

Cheers

You probably have the default tags enabled or the checkboxes for that page set incorrectly.

 

Jack

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You probably have the default tags enabled or the checkboxes for that page set incorrectly.

 

Jack

 

Its ok, I figured out how to work around the problem. I added the page name directly into includes/header_tags.php rather than using its FILENAME_XXXX reference. It's worked, but now I can't add pseudo pages based on the same file... nothing is ever easy ! :)

 

Jack, is there a variable I can pass from my page to header tags so that it picks up the page title/description dynamically rather than me manually adding it in ?

 

Cheers

Link to comment
Share on other sites

Its ok, I figured out how to work around the problem. I added the page name directly into includes/header_tags.php rather than using its FILENAME_XXXX reference. It's worked, but now I can't add pseudo pages based on the same file... nothing is ever easy ! :)

 

Jack, is there a variable I can pass from my page to header tags so that it picks up the page title/description dynamically rather than me manually adding it in ?

 

Cheers

 

Actually, I've worked around that too now. I put an if statement on line 573 of includes/header_tags.php, picked up the variables from my page and echo'd them to the page title/description.

 

Thanks for taking the time to read my posts, Jack.

 

Cheers

 

Andy

Link to comment
Share on other sites

Do you see a difference in the default section for the difference languages?

 

Jack

 

Jack, you were right here. At that point, when I had the oscommerce freshly reinstalled, header tags SEO automatically installed, your contribution worked great. Therefore I continued editing my shop and installing contributions. Among these were the Ultimate SEO urls. Right after I installed that one, I have the problem again. The headertags it is screwed again.

 

I read SpankyAndy's post and I looked through the /header_tags.php file and it seems that, as you said, I have that code inserted. I will paste the entire file at the end of the post. Please tell me what can I do next in order to get both contributions working together. Thanks

 

<?php
/*
 $Id: header_tags_seo.php,v 3.0 2008/01/10 by Jack_mcs

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce
 Portions Copyright 2009 oscommerce-solution.com

 Released under the GNU General Public License
*/ 

require_once(DIR_WS_FUNCTIONS . 'header_tags.php'); 
require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Clean out HTML comments from ALT tags etc.

$header_tags_array = array();
$sortOrder = array();
$tmpTags = array();

$defaultTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS_DEFAULT . " where language_id = '" . (int)$languages_id . "'");
$defaultTags = tep_db_fetch_array($defaultTags_query);
$tmpTags['def_title']	 =  (tep_not_null($defaultTags['default_title'])) ? $defaultTags['default_title'] : '';
$tmpTags['def_desc']	  =  (tep_not_null($defaultTags['default_description'])) ? $defaultTags['default_description'] : '';
$tmpTags['def_keywords']  =  (tep_not_null($defaultTags['default_keywords'])) ? $defaultTags['default_keywords'] : '';
$tmpTags['def_logo_text'] =  (tep_not_null($defaultTags['default_logo_text'])) ? $defaultTags['default_logo_text'] : '';


// Define specific settings per page: 
switch (true) {
 // INDEX.PHP
 case (basename($_SERVER['PHP_SELF']) === FILENAME_DEFAULT):
$pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . FILENAME_DEFAULT . "' and language_id = '" . (int)$languages_id . "'");
$pageTags = tep_db_fetch_array($pageTags_query);

$catStr = "select categories_htc_title_tag as htc_title_tag, categories_htc_desc_tag as htc_desc_tag, categories_htc_keywords_tag as htc_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'";
$manStr = "select mi.manufacturers_htc_title_tag as htc_title_tag, mi.manufacturers_htc_desc_tag as htc_desc_tag, mi.manufacturers_htc_keywords_tag as htc_keywords_tag 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 mi.languages_id = '" . (int)$languages_id . "'";

if ($pageTags['append_root'] || $category_depth == 'top' && ! isset($_GET['manufacturers_id']) )
{
  $sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title']; 
  $sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description']; 
  $sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords']; 
  $sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo'];
  $sortOrder['logo_1'][$pageTags['sortorder_root_1']] = $pageTags['page_logo_1'];
  $sortOrder['logo_2'][$pageTags['sortorder_root_2']] = $pageTags['page_logo_2'];
  $sortOrder['logo_3'][$pageTags['sortorder_root_3']] = $pageTags['page_logo_3'];
  $sortOrder['logo_4'][$pageTags['sortorder_root_4']] = $pageTags['page_logo_4'];
}

$sortOrder = GetCategoryAndManufacturer($sortOrder, $pageTags, $defaultTags, $catStr, $manStr);

if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];

FillHeaderTagsArray($header_tags_array, $sortOrder);  

// Canonical URL add-on
if (tep_not_null($cPath))
  $canonical_url = tep_href_link(FILENAME_DEFAULT, 'cPath='.$cPath);

break;

 // PRODUCT_INFO.PHP
 // PRODUCT_REVIEWS.PHP
 // PRODUCT_REVIEWS_INFO.PHP
 // PRODUCT_REVIEWS_WRITE.PHP
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_INFO):
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS):
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_INFO):
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_WRITE):

switch (true)
{
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_INFO):		  $filename = FILENAME_PRODUCT_INFO;		  break;
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS):	   $filename = FILENAME_PRODUCT_REVIEWS;	   break;
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO;  break;
 case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE; break;
 default: $filename = FILENAME_PRODUCT_INFO;
} 
$pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . $filename . "' and language_id = '" . (int)$languages_id . "'");
$pageTags = tep_db_fetch_array($pageTags_query);

$the_product_info_query = tep_db_query("select p.products_id, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.manufacturers_id 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 ='" .  $languages_id . "'");
$the_product_info = tep_db_fetch_array($the_product_info_query);
$header_tags_array['product'] = $the_product_info['products_head_title_tag'];  //save for use on the logo
$tmpTags['prod_title'] = (tep_not_null($the_product_info['products_head_title_tag'])) ? $the_product_info['products_head_title_tag'] : '';
$tmpTags['prod_desc'] = (tep_not_null($the_product_info['products_head_desc_tag'])) ? $the_product_info['products_head_desc_tag'] : '';
$tmpTags['prod_keywords'] = (tep_not_null($the_product_info['products_head_keywords_tag'])) ? $the_product_info['products_head_keywords_tag'] : '';

$catStr = "select c.categories_htc_title_tag as htc_title_tag, c.categories_htc_desc_tag as htc_desc_tag, c.categories_htc_keywords_tag as htc_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_id = p2c.categories_id and p2c.products_id = '" . (int)$the_product_info['products_id'] . "' and language_id = '" . (int)$languages_id . "'";
$manStr = "select mi.manufacturers_htc_title_tag as htc_title_tag, mi.manufacturers_htc_desc_tag as htc_desc_tag, mi.manufacturers_htc_keywords_tag as htc_keywords_tag from " . TABLE_MANUFACTURERS . " m LEFT JOIN " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id  where m.manufacturers_id = '" . (int)$the_product_info['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "' LIMIT 1";

if ($pageTags['append_root'])
{
  $sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title'];
  $sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description']; 
  $sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords'];
  $sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo']; 
  $sortOrder['logo_1'][$pageTags['sortorder_root_1']] = $pageTags['page_logo_1'];
  $sortOrder['logo_2'][$pageTags['sortorder_root_2']] = $pageTags['page_logo_2'];
  $sortOrder['logo_3'][$pageTags['sortorder_root_3']] = $pageTags['page_logo_3'];
  $sortOrder['logo_4'][$pageTags['sortorder_root_4']] = $pageTags['page_logo_4'];	  
}

if ($pageTags['append_product'])
{	
  $sortOrder['title'][$pageTags['sortorder_product']] = $tmpTags['prod_title'];  //places the product title at the end of the list
  $sortOrder['description'][$pageTags['sortorder_product']] = $tmpTags['prod_desc'];
  $sortOrder['keywords'][$pageTags['sortorder_product']] = $tmpTags['prod_keywords']; 
  $sortOrder['logo'][$pageTags['sortorder_product']] = $tmpTags['prod_title'];
}

$sortOrder = GetCategoryAndManufacturer($sortOrder, $pageTags, $defaultTags, $catStr, $manStr, true);
if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];

FillHeaderTagsArray($header_tags_array, $sortOrder);  

// Canonical URL add-on
if ($_GET['products_id'] != '') {
	$canonical_url = tep_href_link(basename($_SERVER['PHP_SELF']), 'products_id='.(int)$_GET['products_id']);
}	

break;

 // SPECIALS.PHP
 case (basename($_SERVER['PHP_SELF']) === FILENAME_SPECIALS):
$pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . FILENAME_SPECIALS . "' and language_id = '" . (int)$languages_id . "'");
$pageTags = tep_db_fetch_array($pageTags_query);  

// Build a list of ALL specials product names to put in keywords
$new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC ");
$row = 0;
$the_specials='';
while ($new_values = tep_db_fetch_array($new)) {
  $the_specials .= clean_html_comments($new_values['products_name']) . ', ';
}

if (strlen($the_specials) > 30000)				  //arbitrary number - may vary with server setting
 $the_specials = substr($the_specials, 0, 30000);   //adjust as needed

if ($pageTags['append_root'])
{
  $sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title']; 
  $sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description']; 
  $sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords']; 
  $sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo'];
  $sortOrder['logo_1'][$pageTags['sortorder_root']] = $pageTags['page_logo_1'];
  $sortOrder['logo_2'][$pageTags['sortorder_root']] = $pageTags['page_logo_2'];
  $sortOrder['logo_3'][$pageTags['sortorder_root']] = $pageTags['page_logo_3'];
  $sortOrder['logo_4'][$pageTags['sortorder_root']] = $pageTags['page_logo_4'];	  
}

$sortOrder['keywords'][10] = $the_specials;; 

if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];

FillHeaderTagsArray($header_tags_array, $sortOrder);  
  break;

// ALL OTHER PAGES NOT DEFINED ABOVE
 default:
$header_tags_array['title'] = tep_db_prepare_input($defaultTags['default_title']);
$header_tags_array['desc'] = tep_db_prepare_input($defaultTags['default_description']);
$header_tags_array['keywords'] = tep_db_prepare_input($defaultTags['default_keywords']);
break;
 }	

echo ' <title>' . $header_tags_array['title'] . '</title>' . "\n";
echo ' <meta name="Description" content="' . $header_tags_array['desc'] . '" />' . "\n";
echo ' <meta name="Keywords" content="' . $header_tags_array['keywords'] . '" />' . "\n";

if ($defaultTags['meta_google'])   echo ' <meta name="googlebot" content="all" />' . "\n";
if ($defaultTags['meta_language']) echo ' <meta http-equiv="Content-Language" content="en-US" />'."\n";
if ($defaultTags['meta_noodp'])	echo ' <meta name="robots" content="noodp" />' . "\n";
if ($defaultTags['meta_noydir'])   echo ' <meta name="slurp" content="noydir" />' . "\n";
if ($defaultTags['meta_revisit'])  echo ' <meta name="revisit-after" content="1 days" />' . "\n";
if ($defaultTags['meta_robots'])   echo ' <meta name="robots" content="index, follow" />' . "\n";
if ($defaultTags['meta_unspam'])   echo ' <meta name="no-email-collection" value="' . HTTP_SERVER . '" />' . "\n";
if ($defaultTags['meta_replyto'])  echo ' <meta name="Reply-to" content="' . STORE_OWNER_EMAIL_ADDRESS . '"/>' . "\n";
if (tep_not_null($canonical_url))  echo ' <link rel="canonical" href="'.$canonical_url.'" />'. "\n";

echo ' <meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET  . '" />'."\n";
echo '<!-- EOF: Header Tags SEO Generated Meta Tags -->' . "\n";
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...