Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

Hi,

 

First thanks for your contribution.

 

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
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/
 if ($messageStack->size('header') > 0) {
   echo '<div class="grid_24">' . $messageStack->output('header') . '</div>';
}
?>
<?php /*** Begin Header Tags SEO ***/
if (HEADER_TAGS_DISPLAY_PAGE_TOP_TITLE == 'true') {
?>
<div style="text-align:center; color:#aaa; font-size:10px;"><?php echo $header_tags_array['title']; ?></div>
<?php
}
/*** End Header Tags SEO ***/
?>
<div id="header">
<?php include_once(DIR_WS_INCLUDES . 'sub_header.php'); ?>
</div>
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
   <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>
 </tr>
</table>
<?php
 }
 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
   <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>
 </tr>
</table>
<?php
 }
?>

 

And i have to insert this part of your code:

 

FIND:
 <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div>
REPLACE with:
 <?php /*** Begin Header Tags SEO ***/ ?>
 <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', (tep_not_null($header_tags_array['logo_text']) ? $header_tags_array['logo_text'] : STORE_NAME)) . '</a>'; ?></div>
 <?php /*** End Header Tags SEO ***/ ?>

 

As you can see there is no <div id="storeLogo"><?php etc.

 

My question is , were do i put the last part of your code?

 

Many thanks in advance for your help.

 

Regards,

 

Rob

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
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 ?


Paint for VietNamese :

Share this post


Link to post
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 ***/

Share this post


Link to post
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.

Share this post


Link to post
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."

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Just a quick follow up. Turning off the url mod allowed header tags to work correctly. All my previous issues went away.

 

Tim

Share this post


Link to post
Share on other sites

@@knifeman

 

Have a read through the urls5 support forum, i seem to remember reading there somewhere that someone else was having a similar problem getting headertags_seo and urls5 to work together. I may be wrong though.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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....

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×