Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

This is the support thread for the new Header Tags SEO contribution. It is based on the Header Tags Controller but is not compatible.

 

Why the new name?

There are a couple of reasons for this. First, so much has changed in the code that it is mostly a different package and maintaining it would be difficult if it were considered just an update. But beyond that, a lot of people mistakenly confuse the Header Tags Controller as just a meta tags handler. It is that but has gone beyond that basic function for some time now. So to compare it to the other meta tags contributions is just wrong. And I should say here that if all you are looking for is a way to handle the meta tags of your shop, you should not install this contribution since it is definitely overkill. But when you consider that the keywords meta tag is rarely used by google at all nowadays, I can't imagine why someone would want to install a package that relied on that tag so much. And that is the real reason for the new name. This contribution is the only one of its kind to tie together so many Search Engine Optimization (SEO) tricks, that the new namejust made sense.

 

What's the difference?

The following are the major changes (or the ones I could remember) in this new

contribution:

 

-> The code is 100% langage compliant.

-> Removed the english/header_tags.php file in favor of database entries.

-> Fixed a bug introduced in a previous version. A spelling mistake would make Page Control fail in some cases. I only mention this here because it was a nasty little bug I could never locate. So anyone having that problem should consider upgrading.

-> Added control options to admin->Configuration.

-> Added additional meta tag options. It is doubtful these will be used that much but a number of requests were received for this option so it was added.

-> Added an option to view the title and meta tags on the actual web page from admin.

-> Added Social Bookmark code.

-> Added code to apply mouseover text to the sites logo - unique for each page.

-> Added code to have the breadcrumb use the header tags titles.

-> Added an exclude list in admin/includes/functions/header_tags.php that prevents header tags code from being added to certain files (like checkout pages). This is because those pages don't need tags and excluding them will simplify matters.

-> Added option to Page Control and Fill Tags so that the keywords can be dynamically generated from the pages on the site. Currently, the code only supports single keywords but I plan on changing that. There is an option in admin to only pick keywords that fall within the keyword density settings.

-> Added an automatic page add feature. You still have to edit the actual file in the root but that's all.

-> Added easy install instruction for STS shops. There is just one change to make and the two contribution work together.

-> Added code to have the new features work with BTS based shops. There may be a few cases where an option doesn't work due to how BTS handles the files, but they should be minimal and not anything to cause a great stir.

-> Changed how title, description and keywords are built. This should provide more flexibility for those that want that option. Each item has a sort order and is displayed in the string of text based on that sort order. So, for example, the title of a page can contain some entered text, the default title and the category and manufacturers names (if applicable), in any order.

-> Added an Un-Install file to completely remove Header Tags from the database. This should make testing and troubleshooting easier.

-> Added code to use curl instead of standard php file calls. The code will try curl first and then switch to a file command if it is not present.

-> Tested in MS2, RC2, STS and BTS shops.

 

 

Special thanks to the following for their suggestions:

 

bkellum

java roasters

surfalot

 

A lot of time went into creating this contribuiton. I hope it proves useful.

 

Jack

Edited by Jack_mcs

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

Adam & Bill - thanks.

 

Paul - there is an update file with instructions on how to convert your version to this one. There weren't any changes to the admin/categories.php file, which is the most difficult part of the installation, but there are still quite a few changes. Just be sure to backup your database before trying the conversion.

 

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

As always, Great work Jack.

I installed this from the update file last night, everything went smooth. This thing is awesome!

However, you did leave out a few things in the upgrade instructions --- uploading the social bookmark module and overwriting the includes/headertags.php and includes/functions headertags.php

Nothing anyone thats already installed the previous version cant figure out.

Thanks

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Wnated to confirm this block of code:

In catalog/includes/header_tags.php

Lines 65 & 66 read:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_WRITE;   break;

 

Is that correct? Or should it be:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE;   break;

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

I'm gonna add an upgrade with an extremely useless addition that will be irrelevant to all but those who live in a tiny village in the most northern reaches of Lapland muahahaha! (sorry I've had a few beers tonight I'll get my coat)

 

Nice work Jack looks great! I'll bash it about a bit and feed back.

Edited by FWR Media
Link to comment
Share on other sites

Wnated to confirm this block of code:

In catalog/includes/header_tags.php

Lines 65 & 66 read:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_WRITE;   break;

 

Is that correct? Or should it be:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE;   break;

Yes, you are correct. The change you posted is the correct code.

 

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

USING:

 

Update instructions for updating Header Tags Controller version 2.6.3 to

Header Tags SEO V 3.0 by Jack_mcs

 

Step 3 says:

 

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 ***/

 

But I found this:

 

// define HTC

define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php');

define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php');

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

I don't think I should have to define the same thing twice so I deleted all three lines not just the two.

 

 

~~~Tapuahk

Link to comment
Share on other sites

Step 3 says:

But I found this:

I don't think I should have to define the same thing twice so I deleted all three lines not just the two.

~~~Tapuahk

I'm not sure I follow but you will need the definitions for this contribution. If you do it wrong, it will just display the text in capital letters so it will be obvious where the mistake it.

 

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

Update instructions for updating Header Tags Controller version 2.6.3 to

Header Tags SEO V 3.0 by Jack_mcs

 

 

says

12) Find the following in catalog/index.php

 

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

 

i think you meant catalog/product_info.php

 

??

Link to comment
Share on other sites

I'm not sure I follow but you will need the definitions for this contribution. If you do it wrong, it will just display the text in capital letters so it will be obvious where the mistake it.

 

Jack

 

Just saying if I blindly follow instructions I would have two lines saying

 

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

as a line saying

 

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

exists and you don't say to remove it.

Link to comment
Share on other sites

Received the following error when running admin/headertags_seo_update.php

 

admin/headertags_seo_update.php

 

Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in /international/catalog/admin/includes/functions/database.php on line 125

 

Administration | Online Catalog | Support Site Logged in as: admin (Logoff)

Header Tags Controller Setup

 

 

Database successfully updated!!!

 

???

 

I'm stopping here until I figure what went wrong.

Edited by tapuahk
Link to comment
Share on other sites

Hey Jack,

 

Thanks for the contribution..

 

Im having a slight problem.. doesnt really make sense so maybe you can help..

 

everything has been installed..

 

I ran fill tags..

 

Now in the SEO Page.. I have setup the default tags and data... I selected one of the pages on the site.. and just hit the checkboxes (do I need to enter numbers beside them or can I leave them blank) .. I left the the other text fields for the specific page blank.. I hit 'view result' and it came back with

 

New Home Page Title

new description

new keywords1,keywords2

 

Shouldnt it come back with the default data on the right side of the page?

 

So I then tried entering something into the text fields of the specific page..

 

Then when I view result .. it comes back with the default data from the right side of the page.. BUT it doesnt include the data I entered in the text boxes for the specific page.. two peculiar results which don't make sense to me..

 

any thoughts?

 

J

Link to comment
Share on other sites

Ok im pretty sure this is the problem

 

in catalog/includes/header_tags.php

// 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;
 }

 

Shouldnt the default tags be appended to the tags of each specific page.. this section seems incomplete... it seems it is why each page no matter what I set the tags to .. only the default tags are showing up..

Link to comment
Share on other sites

Received the following error when running admin/headertags_seo_update.php

 

admin/headertags_seo_update.php

 

Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in /international/catalog/admin/includes/functions/database.php on line 125

 

Administration | Online Catalog | Support Site Logged in as: admin (Logoff)

Header Tags Controller Setup

 

 

Database successfully updated!!!

 

???

 

I'm stopping here until I figure what went wrong.

I saw that on a few of the servers I installed it on. It probably has to do with the php version but the script runs successfully so it can be ignored.

 

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

Hey Jack,

 

Thanks for the contribution..

 

Im having a slight problem.. doesnt really make sense so maybe you can help..

 

everything has been installed..

 

I ran fill tags..

 

Now in the SEO Page.. I have setup the default tags and data... I selected one of the pages on the site.. and just hit the checkboxes (do I need to enter numbers beside them or can I leave them blank) .. I left the the other text fields for the specific page blank.. I hit 'view result' and it came back with

J

You have to enter a sort number.

 

Jack

Edited by Jack_mcs

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 have to enter a sort number.

 

Jack

 

Jack.. I did add sort numbers and they had no effect.. not until I changed the code from this (in catalog/includes/header_tags.php) did it finally work as it should.. with still a slight hiccup in the admin section with respect to sort orders (below)

 

// 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;
 }

 

to this

 

// ALL OTHER PAGES NOT DEFINED ABOVE
 default:
$pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . basename($PHP_SELF) . "' and language_id = '" . (int)$languages_id . "'");
$pageTags = tep_db_fetch_array($pageTags_query);  

$sortOrder['title'][0] = $pageTags['page_title'];
$sortOrder['description'][0] = $pageTags['page_description']; 
$sortOrder['keywords'][0] = $pageTags['page_keywords'];
$sortOrder['logo'][0] = $pageTags['page_logo']; 

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;
 }

 

 

As for the sort orders.. I get these errors..

 

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

 

I put in a sort order of 2 for the title and sort order of 2 for description.. I dont see why this is a problem..

 

However, with the change in code above.. specific page titles are now being appended by the default page titles.. this wasnt happening before..

Edited by insaini
Link to comment
Share on other sites

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

 

I put in a sort order of 2 for the title and sort order of 2 for description.. I dont see why this is a problem..

 

However, with the change in code above.. specific page titles are now being appended by the default page titles.. this wasnt happening before..

The error message says duplicate sort orders are not allowed but you have decided that is not the case. So you are editing the code to make it fit your idea of the way it should work. That is fine but it isn't necessary. If you set it up properly, it 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

A new version has been uploaded. Thanks to everyone that found problems with the code and instructions. I hope this new version fixes all of those problems. The following changes were made.

 

-> Fixed coding mistake in includes/header_tags.php for reviews pages

-> Added code to clear separators if a field is missing

-> Added code to display an error if the sort order filed is missing

-> Update convert instructions

 

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

The error message says duplicate sort orders are not allowed but you have decided that is not the case. So you are editing the code to make it fit your idea of the way it should work. That is fine but it isn't necessary. If you set it up properly, it will work.

 

Jack

 

 

No I havent touched anything to do with Sort Orders.. .. the code I changed was necessary to show the Page Title appended with the Default Page title..

 

Im not sure why you dont see that it seems pretty obvious that code change needs to be done..

 

Basically.. take any page say 'Contact Us'

 

Now fresh out of the box this is what the browser says for its title .. ( - Mozilla Firefox )

Now I set up the default page title, description and keywords (say "WEBPAGE" for each title, description and keywords) in admin .. now that same 'Contact Us' page now says .. ( WEBPAGE - Mozilla Firefox )

 

Now I specify for the 'Contact Us' page .. Title, description and keywords as "Contact Us" .. now when I go to the Contact Us page.. behold the title still says ( WEBPAGE - Mozilla Firefox ) .. when it should say .. ( Contact Us - WEBPAGE - Mozilla Firefox ) ..

 

Well that code change i posted above fixes this .. not sure why you didnt get this.. :huh:

Link to comment
Share on other sites

No I havent touched anything to do with Sort Orders.. .. the code I changed was necessary to show the Page Title appended with the Default Page title..

 

Im not sure why you dont see that it seems pretty obvious that code change needs to be done..

 

Basically.. take any page say 'Contact Us'

 

Now fresh out of the box this is what the browser says for its title .. ( - Mozilla Firefox )

Now I set up the default page title, description and keywords (say "WEBPAGE" for each title, description and keywords) in admin .. now that same 'Contact Us' page now says .. ( WEBPAGE - Mozilla Firefox )

 

Now I specify for the 'Contact Us' page .. Title, description and keywords as "Contact Us" .. now when I go to the Contact Us page.. behold the title still says ( WEBPAGE - Mozilla Firefox ) .. when it should say .. ( Contact Us - WEBPAGE - Mozilla Firefox ) ..

 

Well that code change i posted above fixes this .. not sure why you didnt get this.. :huh:

It works fine for me as it is. Maybe some others can test it to see if it happens for them. The only thing I can think of is that the includes/header_tags.php file was not updated properly for some reason. Try replacing that file with the original and then run the headertags_seo_uninstall.php and the headertags_seo_install.php 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

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...