Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

FILNAME_WISHLIST is a mistake, or a poorly chosen definition. It may be confusing the code in Header Tags due to the wishlist part. I suggest deleting that entry or rename it to something else. If you do the latter, you will need to search your code to make sure any code that uses it is also changed.

Share this post


Link to post
Share on other sites

@Jack_mcs

 

I don't get it, so I hope you can re-explain it to me with the sitemap.php. This sitemap is yours. b.t.w the sitemap does not work either in header tags seo.
In page control When I look at the dropdown the sitemap will show up. when I click in the dropdow on sitemap.php and type the title, description and keywords it will not showing up on the webpage code.

beneath I have the following in my webpage.

 

in index.php I have the following scripts.(from sitemaps)

<!-- Begin Sitemap SEO-->
           <script type='text/javascript' src='javascript/sitemap_seo.js'></script>
           <?php
           require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SITEMAP_SEO);
           include(DIR_WS_MODULES . FILENAME_SITEMAP_SEO_CATEGORY);
           ?>
<!-- End Sitemap SEO -->

<!-- Begin Sitemap SEO-->
      <script type='text/javascript' src='javascript/sitemap_seo.js'></script>
      <?php
      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SITEMAP_SEO);
      $mapMod = (isset($_GET['manufacturers_id']) ? FILENAME_SITEMAP_SEO_MANUFACTURERS : FILENAME_SITEMAP_SEO_CATEGORY);
      include(DIR_WS_MODULES . $mapMod);
      ?>
<!-- End Sitemap SEO -->

in includes/filenames.php I have the following entry.

  /***** Begin Sitemap_SEO *****/
  define('FILENAME_SITEMAP_SEO', 'sitemap.php');
  define('FILENAME_SITEMAP_SEO_CATEGORY', 'sitemap_category.php');
  define('FILENAME_SITEMAP_SEO_PRODUCT', 'sitemap_product.php');
  define('FILENAME_SITEMAP_SEO_MANUFACTURERS', 'sitemap_manufacturers.php');  
  /***** End Sitemap_SEO *****/

in languages/english I have sitemap.php

<?php
/*
  $Id: sitemap_seo.php 2008-12-20 by Jack_mcs

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

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Sitemap');
define('HEADING_TITLE', 'Sitemap');

define('TEXT_CATEGORY_NAME', 'Other products in the <b>%s</b> category');
define('TEXT_MANUFACTURERS_NAME', 'Products by Manufacturer: <b>%s</b>');

define('TEXT_INFORMATION', '<p>Please contact us if you experience any problems finding what you need:</p> ' . 
 nl2br(STORE_ADDRESS) . '<br>' .
 'Phone: '. STORE_PHONE . '<br>' .
 '<a mailto:' . STORE_OWNER_EMAIL_ADDRESS . '>' . STORE_OWNER_EMAIL_ADDRESS . '</a>' 
);
 
define('TEXT_SITEMAP_RELATED_PRODUCTS', 'Related Products');
define('TEXT_SITEMAP_RELATED_CATEGORIES', 'Related Categories');
define('TEXT_SITEMAP_RELATED_MANUFACTURERS', 'Related Manufacturers');

define('TEXT_NO_MANUFACTURERS_FOUND', 'No other products were found for this manufacturer.');

define('TEXT_HIDE_PRODUCTS', '(hide products)');
define('TEXT_SHOW_PRODUCTS', '(show products)');

?>
Edited by dinopacha

Share this post


Link to post
Share on other sites

The changes in Page Control is only for pages. You show the entries for index.php - the two are not related. You should have a page on your site like ...com/sitemap.php. That is where the detail in Page Control will show up.

Share this post


Link to post
Share on other sites

Hi Jack,

Sitemap.php is standing in the root but it has no header tag seo (head code).

I have a bootstrap version.

You said (The main file, in the root, has to have the Header Tags SEO <head> code. If this is a 2.3 shop then that will automatically be done.)

Do I have to put it in manually?

And what do I have to put in?

Share this post


Link to post
Share on other sites

In a 2.3 shop (any version), the header tags head code is added to the includes/template_top.php file so it gets included automatically for all pages. I assume you added it to that file or your other pages wouldn't work either. In that case, be sure the sitemap.php file is a 2.3 version (calls template_top.php). If both of those are true, then view its source to be sure the Header Tags SEO code is being included. If it is, then the problem is in Page Control. Maybe you didn't enter anything for the page, or something like that.

Share this post


Link to post
Share on other sites

@Jack_mcs

 

I found the fault why headertags not see the sitemap.

in includes/header_tags.php I had the following.

// sitemap.php
  case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_SITEMAP):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
      $header_tags_array = tep_header_tag_page(FILENAME_SITEMAP);
      WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
    }
  break;

and it has to be:

// sitemap.php
  case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_SITEMAP_SEO):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
      $header_tags_array = tep_header_tag_page(FILENAME_SITEMAP_SEO);
      WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
    }
  break;

Now it works all correctly. :thumbsup:

Edited by dinopacha

Share this post


Link to post
Share on other sites

Hi Jack,

 

I've been using HTC 3.2.9 on osC 2.3.3 for some time and it works very fine with PHP 5.3. Yesterday I started an upgrade to osc 2.3.3.4. That still works fine with PHP 5.3, but I want to upgrade to PHP 5.6 and that doesn't work yet. So now I started to upgrade HTC step by step to the latest version. The upgrade to 3.3.0 worked fine, but when upgrading to 3.3.1 a problem occured. In admin/categories.php I should find

      $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];
      $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];
      $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];
      $products_head_listing_text = $HTTP_POST_VARS['products_head_listing_text'];
      $products_head_sub_text = $HTTP_POST_VARS['products_head_sub_text'];
      $products_url = $HTTP_POST_VARS['products_url'];
    } else {
      $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
      $product = tep_db_fetch_array($product_query);
      /*** End Header Tags SEO ***/

but that code is not included in admin/categories.php. HTC 3.2.9 had been the first version I used to install. I checked the files included in that release, but I didn't find anything what I've done wrong.

 

Do you have any idea, where the missing code can be found?

 

Yours, Martin

Share this post


Link to post
Share on other sites

@@AlbenShop24 There isn't such code in the later versions of oscommerce. While running through the individual update files will get you to where you need to be, it is a waste of time and effort for a new shop. I suggest you start over and use these steps:

 

First, if you are not using the Bootstrap version of oscommerce, then you should switch to it.

 

Once the new shop is ready to go, then use the files for the correct version and compare them to make changes. Instructions are not included for the BS version yet. They are for the non-BS version but I don't recall if they are up-to-date.

 

Assuming you have converted the database and have the original HTC database tables, apply the database changes in the manual update files. You only need to do that through version 3.3.

 

Then run the update file as headertags_seo_update.php?reset_options=true.

 

Good luck.

Share this post


Link to post
Share on other sites

Hello Jack,

 

I have installed Header Tags SEO V3.3.3_1 ond a oscommerce 2.3.4 BS (gold from Burt) and everything works fine except when i fill in a test keyword at one product and search for it: nothing shows up but in the admin HTS says that the keyword where is searched for was found.

I use the advanced_search_result.php from the HTS contribution.

 

What could be the case?

 

Further on: I want to use the Products Page Sub Text and include it in the search results: how do I do that?

Share this post


Link to post
Share on other sites

@@revamp For the first problem, you're not using one of my versions so I can't help much with that. 

 

For searching, I think the following will work though I've not tried it. This change is based on my version so it may not match the one you are using. In the advanced_search_result.php file, find

    $select_str .= ", hts.keyword ";

and add this beneath it

    $select_str .= ", pd.products_sub_text ";

Then find

            $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";

and add this beneath it

            $where_str .= " or pd.products_sub_text like '%" . tep_db_input($keyword) . "%'";

Share this post


Link to post
Share on other sites

 

 

 

@@revamp For the first problem, you're not using one of my versions so I can't help much with that. 

 

 

 

Sorry Jack, I use this contribution   http://addons.oscommerce.com/info/5851  and that carries your name...in the download it is called: HeaderTags_SEO_V_3.3.3_1.zip, sorry for the confusion.

 

Thanks for the hint with the search adjustment, I will try it.

Share this post


Link to post
Share on other sites

You said you are using version 3.3.3_1. I don't have a version like that.  There is a 3.3.1 and a 3.3.3 but I never use the underscore in my version numbers. Did you mistype?

Share this post


Link to post
Share on other sites

The search adjustment gives this:

 

1054 - Unknown column 'pd.products_sub_text' in 'where clause'

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id left join headertags_search hts on p.products_id = hts.product_id , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '2' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%revamp%' or p.products_model like '%revamp%' or m.manufacturers_name like '%revamp%' or hts.keyword like '%revamp%' or pd.products_sub_text like '%revamp%') )

[TEP STOP]

 

But when I change "pd.products_sub_text" to "pd.products_head_sub_text" (the actual database field) it works like a charme!

 

Thanks Jack.

Share this post


Link to post
Share on other sites

You said you are using version 3.3.3_1. I don't have a version like that.  There is a 3.3.1 and a 3.3.3 but I never use the underscore in my version numbers. Did you mistype?

 

As I explained (badly), I use version 3.3.3 and called it by mistake 3.3.3_1 (that is the name of the zip file, see it for yourself at http://addons.oscommerce.com/info/5851 ...

Share this post


Link to post
Share on other sites

I think the search problem for keywords is in "hts.keyword" (in advanced_search_result.php): to which table and tablefield does that refer?

Not to headertags_keywords I think because that table contains the keyword (revamp) I used for testing.

So shuold it be the products_description tabele? Then the field should be "products_head_keywords_tag"...

Share this post


Link to post
Share on other sites

@@revamp Regarding the advanced search change, your correction is how it should be.

 

Regarding the version, that's strange that the _1 is being added. I think I may have uploaded a 3.3.3 version that was missing something so I uploaded it again. The addon system must have noticed that and deleted the first one.

 

The word that is searched for is handled in the includes/modules/header_tags_keywords.php file. It checks to see if the word is in the categories, manufacturers or products or doesn't add it. It doesn't check the descriptions but since it is finding something, the word must be somewhere in there.

Share this post


Link to post
Share on other sites

@@revamp Regarding the advanced search change, your correction is how it should be.

 

Regarding the version, that's strange that the _1 is being added. I think I may have uploaded a 3.3.3 version that was missing something so I uploaded it again. The addon system must have noticed that and deleted the first one.

 

The word that is searched for is handled in the includes/modules/header_tags_keywords.php file. It checks to see if the word is in the categories, manufacturers or products or doesn't add it. It doesn't check the descriptions but since it is finding something, the word must be somewhere in there.

That is strange Jack, because when the search word is in one of the categories, manufacturers or products (title), why nothing is showing up when you search for the word?

 

I think it is in the hts.keyword , I think that is not declared properly: hts stands for the headertages_search table I presume and that table is empty...(as you explained before: $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";).

When I add/change that ($where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";) to ($where_str .= $where_str .= " or pd.products_head_sub_text like '%" . tep_db_input($keyword) . "%'";) . "%'";) it works fine...

Share this post


Link to post
Share on other sites

Sorry for the persistence: I refer to the frog legs as you explain in the help with the keywords: frog legs is a name of a product but when someone searches for froglegs he/she won't find anything, so put in the keyword froglegs beside frog legs, you explain in the help...

Share this post


Link to post
Share on other sites

Yes, that is what it says. Did you mean to ask a question?

Yes I like to ask a question: why nothing shows up in the front shop when I search for a keyword?

I used "froglegs" as an example...

Share this post


Link to post
Share on other sites

Hello Jack,

 

Totally other question:

 

I see you use the Ultimate SEO URLs contribution from Chemo Bobby, how is your experience with that? Do you have a website where I can see it in use?

 

I use your Header Tags SEO since 2005 and I noticed that Google has no problems with it (thanks to your great Header Tags SEO contribution). The products are showing up in the search result with the old, ugly osCommerce paths (http://www.mysite.com/product_info.php?products_id=30 or http://www.mysite.com/index.php?cPath=1 and so on...)

 

I like to get rid off these ugly URLs and want to have something like:  http://www.mysite.com/froglegs or maybe better:  http://www.mysite.com/eatables/froglegs where eatables is the category where froglegs is in.

Share this post


Link to post
Share on other sites

@@revamp If you have a product with the name of froglegs, for example, and you search your site for froglegs and it doesn't show up, then there is a problem with your shops search code. It doesn't have anything to do with this addon unless, I suppose, if you made a mistake in the edits of the advanced_search_result.php file.

 

Ultimate SEO works great. I use it on my own site. But it doesn't provide the type of url's you mention. You can try the SEO 5 rewriter, which can provide urls similar to that, though it will cause words that are of no use to your site to be ranked and, in my opinion, water down the SEO affect.

Share this post


Link to post
Share on other sites

@@revamp If you have a product with the name of froglegs, for example, and you search your site for froglegs and it doesn't show up, then there is a problem with your shops search code. It doesn't have anything to do with this addon unless, I suppose, if you made a mistake in the edits of the advanced_search_result.php file.

 

Ultimate SEO works great. I use it on my own site. But it doesn't provide the type of url's you mention. You can try the SEO 5 rewriter, which can provide urls similar to that, though it will cause words that are of no use to your site to be ranked and, in my opinion, water down the SEO affect.

I use the advanced_search_result.php from the HTS contribution...

Share this post


Link to post
Share on other sites

I use the advanced_search_result.php from the HTS contribution...

Hmm, I'm getting an idea: I will compare the original file against yours...

Share this post


Link to post
Share on other sites

Hmm, I'm getting an idea: I will compare the original file against yours...

HMM they are the same except your adjustments and again I think it is in ($select_str .= ", hts.keyword ";):hts is not declared.

 

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

×