Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

I have a bit of a problem installing some parts of it.

I use the "Header Footer Content" addon by Gergely and my header.php looks like this:

 

<?php include_once(DIR_WS_INCLUDES . 'sub_header.php'); ?>

The above line is telling the code to use a different file for the header. You will need to make the change in that file, includes/sub_header.php.

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

No, it's not currently possible. It was coded that way because that is proper SEO but others have asked for it so it will be in a future version.

 

It would be great to be able to edit the title tags for google but not have all this text on the page as a title. So I'm waiting for the new version!!! Thanks!

Link to comment
Share on other sites

Hi , Thanks for the previous response , i will need to resolve that part later.

 

I am now installing the admin side and this code for " Manufacturers.php" in your manual comes the other way around in my code , i mean , the part of "around line 224" comes after the "around line 243".

 

Is this correct?

 

Thanks in advance for your response.

 

Gr, Rob

 

 

   -------------------------------------------------------------------------------
FIND (around line 224):
  $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
ADD BENEATH:
  /*** Begin Header Tags SEO ***/
  $contents[] = array('text' => '<br>' . 'Header Tags Manufacturer Title' . $manufacturer_htc_title_string);
  $contents[] = array('text' => '<br>' . 'Header Tags Manufacturer Description' . $manufacturer_htc_desc_string);
  $contents[] = array('text' => '<br>' . 'Header Tags Manufacturer Keywords' . $manufacturer_htc_keywords_string);
  $contents[] = array('text' => '<br>' . 'Header Tags Manufacturer Description' . $manufacturer_htc_description_string);
  /*** End Header Tags SEO ***/
   -------------------------------------------------------------------------------
FIND (around line 243):
  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
    $manufacturer_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']', tep_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i]['id']));
ADD BENEATH:
   /*** Begin Header Tags SEO ***/
    $manufacturer_htc_title_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_htc_title_tag[' . $languages[$i]['id'] . ']', tep_get_manufacturer_htc_title($mInfo->manufacturers_id, $languages[$i]['id']));
    $manufacturer_htc_desc_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_htc_desc_tag[' . $languages[$i]['id'] . ']', tep_get_manufacturer_htc_desc($mInfo->manufacturers_id, $languages[$i]['id']));
    $manufacturer_htc_keywords_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_htc_keywords_tag[' . $languages[$i]['id'] . ']', tep_get_manufacturer_htc_keywords($mInfo->manufacturers_id, $languages[$i]['id']));
    $manufacturer_htc_description_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('manufacturers_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, tep_get_manufacturer_htc_description($mInfo->manufacturers_id, $languages[$i]['id']));
   /*** End Header Tags SEO ***/

Link to comment
Share on other sites

Hi Mr. Jack, thank for great contribute.

"Display Tag Cloud" set to True but it does not show anything at the footer ! How does it work ?

It records words that are found when someone searches. If you do a search for some product on your site, that keyword should appear in the footer.

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 , Thanks for the previous response , i will need to resolve that part later.

 

I am now installing the admin side and this code for " Manufacturers.php" in your manual comes the other way around in my code , i mean , the part of "around line 224" comes after the "around line 243".

 

Is this correct?

Line numbers are only accurate for new shops and then only if it is the same version shop that I used. That's why it says "around."

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

Line numbers are only accurate for new shops and then only if it is the same version shop that I used. That's why it says "around."

 

Hi Jack,

 

OK , thanks , one less thing to worrie about then.

It seems to work altho i still am trying to find out were to put the files for the header.php as i think they might be responsible for the double line of the social bookmarks on my categorie pages.

 

Gr, Rob

Link to comment
Share on other sites

Jack,

 

I have the latest 3.2.8 version installed and am seeing something odd. I have two sites, one copied to the other with only products changed, so the code is the same.

 

On the index.php page where the page title is set, when the browser loads the page the first two letters are dropped. For instance the page title could 'ABC Widgets', but what displays in the browser tab is 'C Widgets'.

 

I initially thought the text was too long and shortened it, but that didn't help. The other site (with a longer title name) displays properly. Any thoughts? Jim

Edited by iflyamphib
Link to comment
Share on other sites

Jack,

 

I have the latest 3.2.8 version installed and am seeing something odd. I have two sites, one copied to the other with only products changed, so the code is the same.

 

On the index.php page where the page title is set, when the browser loads the page the first two letters are dropped. For instance the page title could 'ABC Widgets', but what displays in the browser tab is 'C Widgets'.

 

I initially thought the text was too long and shortened it, but that didn't help. The other site (with a longer title name) displays properly. Any thoughts? Jim

That used to be a problem for some but I haven't heard of it in a very long time. There are some post about it here. If you are using a url rewriter, try tuning it off. It would seem to be a problem caused by a difference between the two servers but without hands-on, I can't help much.

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

is ultimate seo v 2.2d better to install than Ultimate Seo Urls 5 PRO?

 

im confused which to download and install.

The results are the same as long as you run SEO 5 in rewrite mode, though I recommend V2.2d.

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,

 

I am working on new 2.3.1 store and have the header tags implemented.

I have run into several issues getting them to work.

ie: the text at the bottom of a product page will only show the product name if the default title tag is left blank in page control.

I cannot get any titles to show up on product listing pages. Words go into the Db, but not on the web page.

 

So after some reading, I found out the Seo urls 5 is a problem when installed with header tags. Then I read the the other add on should be set to rewrite method so it will play nice with yours. Ugh, my test setup is in a subdirectory of my live store so i can use the ssl. if I use rewrite, all my links go to my live store.

 

Can you confirm that my issues, at least the 2 I mentioned, are a result of the 2 add ons incompatability? If so, I could turn rewrite on once the site is ready to go live.

 

Tim

Link to comment
Share on other sites

Hi Jack,

 

I am working on new 2.3.1 store and have the header tags implemented.

I have run into several issues getting them to work.

ie: the text at the bottom of a product page will only show the product name if the default title tag is left blank in page control.

I cannot get any titles to show up on product listing pages. Words go into the Db, but not on the web page.

 

So after some reading, I found out the Seo urls 5 is a problem when installed with header tags. Then I read the the other add on should be set to rewrite method so it will play nice with yours. Ugh, my test setup is in a subdirectory of my live store so i can use the ssl. if I use rewrite, all my links go to my live store.

 

Can you confirm that my issues, at least the 2 I mentioned, are a result of the 2 add ons incompatability? If so, I could turn rewrite on once the site is ready to go live.Tim

Any of the url rewriters shouldn't cause such a redirection so it sounds like your configure file for the test shop isn't setup correctly. But that shouldn't matter. Just turn off SEO 5 whle you are testing Header Tags.

 

Regarding the problems you mentioned, no, that is not normal.

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

Any of the url rewriters shouldn't cause such a redirection so it sounds like your configure file for the test shop isn't setup correctly. But that shouldn't matter. Just turn off SEO 5 whle you are testing Header Tags.

 

Regarding the problems you mentioned, no, that is not normal.

Thanks,

 

I thought about that add on might have an on/off switch last night while fretting about the problem. I will turn it off and see what i can do then.

 

Thanks again,

 

Tim

Link to comment
Share on other sites

The support threads are quite long and tedious to find answers. In between work, and developement, I am looking.

I wish I had known they did not play well together before I installed both.

 

What I did read was to set the url mod to rewrite instead of standard.

I am hoping that will work, but won't know for sure until I move the development site to the root. If I set it to rewrite now, the links go to my live store that is in the root.

 

Tim

Link to comment
Share on other sites

The support threads are quite long and tedious to find answers. In between work, and developement, I am looking.

I wish I had known they did not play well together before I installed both.

 

It's not a matter of "playing well together" which suggests an incompatibility in USU5.

 

USU5 works fine the problem is that the header tags code breaks whenever a path based URI is used.

 

Whether it is USU5 like:

www.mysite.com/product_info.php/the-brand-etc/great-product-p-3

 

or the standard osCommerce path based URIs like:

www.mysite.com/product_info.php/products_id/3

 

I can't believe after all this time that people are STILL thinking it is an issue of compatibility with USU5 .. IT ISN'T!

 

Either Jack will fix header tags so that it will work properly with valid URLs .. or if you use header tags you simply can't have path based URIs .. period.

 

To clarify further .. yes you can use USU5 with header tags BUT you can't use all of its functionality due to this problem.

Link to comment
Share on other sites

It's not a matter of "playing well together" which suggests an incompatibility in USU5.

 

 

No offense meant by my terminology. All I know about oscommerce and the add ons is what I read on the forums. I have learned a lot, but still taking small steps in some areas.

 

I opted to install USU5 due to its simpler install. I stayed with header tags because I am familiar with that one and have installed it many times. My sincere thanks to both contributors as I have installed several add ons from both Jack and Robert. I have also had both members answer my help requests on this forum.

 

Tim

Link to comment
Share on other sites

It's not a matter of "playing well together" which suggests an incompatibility in USU5.

 

USU5 works fine the problem is that the header tags code breaks whenever a path based URI is used.

 

Whether it is USU5 like:

www.mysite.com/product_info.php/the-brand-etc/great-product-p-3

 

or the standard osCommerce path based URIs like:

www.mysite.com/product_info.php/products_id/3

 

I can't believe after all this time that people are STILL thinking it is an issue of compatibility with USU5 .. IT ISN'T!

 

Either Jack will fix header tags so that it will work properly with valid URLs .. or if you use header tags you simply can't have path based URIs .. period.

 

To clarify further .. yes you can use USU5 with header tags BUT you can't use all of its functionality due to this problem.

 

I found some time ago this post at http://www.clubosc.com/seourls5-htcseo3.html which explains the fix Jack provided to make HT SEO and USU5 work. I use URI mode = standard (because I'm on a windoze server - long story) and it works great. If you scroll down to near the bottom of the comments on the above-referenced clubosc post, you'll see a question posted from Gurdeep dated May 2, 2012. I also ran into this problem as well, and after some debugging, discovered an issue HT SEO code that was the culprit. It was code that was testing for a boolean FALSE value in a ternary IF statement that was never evaluating properly the prior result of a string position search PHP function as I recall.... I can't remember off hand at the moment exactly which file this was in, and the exact name of the PHP string position search function also escapes me - PHP is not my first language.... if someone needs it, I can try to go back and search when I have some free time.... but I do recall that I fixed this issue by changing the !== to != so as to allow execution of the "true" part of the ternary if statment to execute when the string pos search function found the string it was searching for starting in position zero. A !== requires equality of value AND type, but zero is not the same as a Boolean 'FASLE' when testing for type. So deleting the extra "=", leaving !=, allows the test to work for zero (i.e. the string was found in position 0) as well as FALSE (i.e. the string was not found at all, resulting in a return value of boolean FALSE). I was going to eventually post this on this forum to let Jack know.... but a few weeks went by and I forgot until now....

Link to comment
Share on other sites

Ok, so I just remembered - I made the code fix for the above referenced issue in /includes/header_tags.php. Here's my snippet of code:

// J. Moll 8/3/12 - changed !== below to != since strripos can return 0 if / is in first position, or FALSE if / is not found at all; !== would require $pos to be boolean to work, but we need it to work if 0 is returned as well, so use equaltiy test rather than identity/equality test
$pos = strripos($_SERVER['PHP_SELF'], "/");
$page = ($pos != FALSE) ? basename(substr($_SERVER['PHP_SELF'], 0, $pos)) : basename($_SERVER['PHP_SELF']);

 

I'm not a member at clubosc, so maybe someone here who is would be so kind as to help out "Gurdeep" and post my solution there as a help.

Link to comment
Share on other sites

Ok, so my real reason for visiting this forum this evening was to ask a question. As I've already stated, I'm on a windows platform, with both HT SEO and USU5 working together just fine on osC 2.3.1. What I would like to do is have one set of title/description/keywords meta tag values for the index.php when it's just accessed as the "home page", i.e. no category or sub-category page being displayed. But then when a category or sub-category page is being displayed via index.php, I want just the values I've typed in via the admin for that category to display for title/description/keywords meta tags - NOT both the values specified for index.php "proper" AND the category values. For the life of me I can't figure out a way to manipulate the various options/check boxes to do this. Is there a way that perhaps I'm just missing, or will I need to add a little code in application top or template top to test for when the current page is index.php but not with a category.... any help/ideas would be appreciated. Thanks!

Link to comment
Share on other sites

Ok, so I just remembered - I made the code fix for the above referenced issue in /includes/header_tags.php. Here's my snippet of code:

// J. Moll 8/3/12 - changed !== below to != since strripos can return 0 if / is in first position, or FALSE if / is not found at all; !== would require $pos to be boolean to work, but we need it to work if 0 is returned as well, so use equaltiy test rather than identity/equality test
$pos = strripos($_SERVER['PHP_SELF'], "/");
$page = ($pos != FALSE) ? basename(substr($_SERVER['PHP_SELF'], 0, $pos)) : basename($_SERVER['PHP_SELF']);

 

I'm not a member at clubosc, so maybe someone here who is would be so kind as to help out "Gurdeep" and post my solution there as a help.

This is invalid code. That function return FALSE and must be tested with !==. Changing it to != will not provide the correct results.. Beyond that, the code posted by Gary was from several years ago and should not be needed if you have the latest version of Header Tags installed.

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

...I want just the values I've typed in via the admin for that category to display for title/description/keywords meta tags - NOT both the values specified for index.php "proper" AND the category values. For the life of me I can't figure out a way to manipulate the various options/check boxes to do this. Is there a way that perhaps I'm just missing, or will I need to add a little code in application top or template top to test for when the current page is index.php but not with a category.... any help/ideas would be appreciated. Thanks!

Uncheck the root checkbox in Page Control for index.php.

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

This is invalid code. That function return FALSE and must be tested with !==. Changing it to != will not provide the correct results.. Beyond that, the code posted by Gary was from several years ago and should not be needed if you have the latest version of Header Tags installed.

Hi Jack. Thanks for the response.... but I did quite a bit of debugging on this with echo statements and such, and at least on my server, which is IIS and PHP 5.3 I believe, and for me (having also USU5), I was able to see definitively that the problem was that when strripos would (validly) retrun zero (for example, when testing www.mydomain.com/index.php), the !== test will evaluate TRUE (i.e. zero is equivalent in value to FALSE but not of the same var type as boolean FALSE, so "!==" evaluates "true" in this case), but that then causes the true-part of the ternary if construct to execute, which is "basename(substr($_SERVER['PHP_SELF'], 0, $pos))", but in this case $pos is zero, and so your substring() would return a null string, i.e. starting at position 0 for 0 length.... so, $page as I said is an empty null string, so the subsequent switch evaluating $page fails to execute the desired functionality.

 

After mulling over this and with numerous debug echo's and what not, I came to the belief that what your ternary if was meaning to do was to execute the "true part" of the ternary only if we had a valid, non-zero value for $pos from the prior strripos() - i.e. NOT 0 (meaning "/" found in first position of search string so strripos() returns 0) and NOT FALSE (meaning "/" not found at all so strripos() returns bool FALSE). So, the way to do that, and to therefore insure that the "false part" of the ternary IF is executed if $pos is either zero or FALSE, is to use the "!=", since that will leave out the identity test - i.e. type check - out of the test. In other words, not worrying about matching var type, zero and FALSE will be equivalent. So, now with the conditional check using "!=", $pos equal to zero causes the condition check of the ternary IF to evaluate as "false", and thus execute the correct "false part" code of the ternary, i.e. the "basename($_SERVER['PHP_SELF'])", which then correctly provides a page name value for $page, and then the following code in the switch statement works as expected.

 

So, this change on my system makes HT SEO work as I expect it to, otherwise, the ternary IF statement never returns a page name and so none of the desired $page evaluation code in the switch statement ever gets executed. Maybe it has something to do with USU5 and that I have that in standard mode instead of re-write mode, but I don't think so, as I can re-create this from a page such as simply www.mydomain.com/about_us.php, but in any event, as I've described above, this is a real issue on my system and this "fix" appears to me to be valid, indeed the proof is in the pudding as the tag values for the about_us page etc. stored in the header tags db will never get loaded if $page never returns the current name of the current page, obviously.... if you have a better, more valid, more correct "fix", please let me know..... even though I've been a software developer for over 20 years, I am admittedly not an expert in PHP, so I may have stumbled onto something that on the surface seems to "fix" my problem, but are your saying that may be an illusion? Thanks for your further consideration on this.... the more I get into issues and discussions like this, the more it helps me learn about the PHP world. Thanks!

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