Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

The includes/header_tags.php and english/header_tags.php files have to match. You can't just replace one if there have been changes made. Jack

I am trying to understand this, & thinking (mmmm) do you mean that the entries in each file made for each page/new page has to be the same? ie I can't have the code for one page in one but not the other, which might happen if this has all messed up.

 

Therefore easiest way is the re-upload the folder with all the new shop files? Great & I don't mind (much) the re-entering data, as long as I don't have to go through the WHOLE contribution again. PLEASE don't say THAT.

 

Julie

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

The includes/header_tags.php and english/header_tags.php files have to match. You can't just replace one if there have been changes made. I suggest replacing all of the files in the new shop directory and see what happens. Changing the admin files won't matter since those are not changed by anything you do. Changing the ones in the shop will cause you to lose some of your changes but they are easily replaced so it would be worth the try.

 

Jack

OK student asking teacher one more question ;) (no fluttering eyelids pics available)

 

Going by what you said & the fact that this is still working (mostly) up to the 2.6.2 version I'm thinking the following is possible?

 

Upload from V2.6.3

admin/header_tags_controller.php

admin/header_tags_english.php

admin/includes/boxes/header_tags_controller.php

includes/header_tags.php (without the amendment for the bug fix for certain stores)

AND includes/languages/english/header_tags.php

 

This will put me back to an upgraded V2.6.3 but with both the includes/header_tags.php (without the amendment for the bug fix for certain stores) AND includes/languages/english/header_tags.php back to a default mode. This makes them both the same & I will need to add the new pages & text again.

 

During this I haven't touched any other files, so they should still be the same as the V2.6.2 which worked, only mixing some of the english codes around.

 

I will obviously check that the inc/lang/eng/header_tags.php is writing ok, but if the old bug happens again I would just amend the english/header_tags.php manually.

 

I have read the install instructions & it says "DON'T upload the new shop files if you have other contributions as you WILL break your shop" I don't want to do that.

 

Anyhow, my mouse is now playing up & I need to renew my test side, which is also not right, before I try this or what ever you come back with. :D Please correct me if my thinking is way off line. I need a glass of wine & I have to be up early tomorrow for an ALL day Cancer charity event so I'll give you all a rest from my rantings.

 

I'll speak to you soon Jack. :thumbsup:

Thanks for being patient.

Julie

Link to comment
Share on other sites

Replacing any of the files in header tags won;t change what you have setup for your categories and products. Only the page information is stored in the files (index, product_info and whatever other ones use header tags). Anytime there is an upgrade (at least one of mine), you can safely replace the files in admin. The only thing that might be required is a database update, but that would not delete anything from what you have. On the shop side, the includes/header_tags.php and english/header_tags.php files work together to display information on a page, exactly the same way any page in oscommerce works. The file in includes provides the code to display or handle the text. The file in english has the actual text. So if you have added a page named abc.php using page control in admin, then there will be code in both of those files for abc. If you replace one of them with an upgrade, then they no longer match and that page will not work as expected.

 

When you are having the kinds of problems you are having, it is best to replace them completely since you hay have deleted something, either on purpose or by accident, that is causing a problem. Once they are replaced, it would take only minutes to re-type the default and index keywords in Text Control for those pages. If you wanted to add other pages, maybe another ten minutes. So you can see it is not a big deal to replace all of the files.

 

I hope the above clears it up for you.

 

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!

This is my first post, but I found a solution to a little bug in this contrib, and maybe this will be useful for somebody.

 

I was having this error:

 

1406 - Data too long for column 'products_head_title_tag' at row 1

 

This was because the database type for products_head_title_tag is VARCHAR(80) and I added tinyMCE contrib before, which was adding a lot of text to textareafield.

 

Solution?

 

you should change only 1 line in admin/categories.php

 

find:

 

<td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

and replace with:

 

<td class="main"><?php echo tep_draw_input_field('products_head_title_tag[' . $languages[$i]['id'] . ']', (isset($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

 

:rolleyes:

Link to comment
Share on other sites

Hi,

First, thanks for a really great contribution. I installed it a few months ago and it works well for me, generating my desired page titles, descriptions, meta descriptions and meta key words.

 

Now my site has been well indexed by google I have noticed 2 issues with some of the google search results.

 

1) Sometimes Google does not display relevant text from my page or its meta description. Instead, it displays text from the manufacturers box or categories box - i.e. a fairly meaningless list of manufactures names or categories

e.g

blue widget for sale

Blue widgets(55) -> Pink widgets(7) ->purple widgets(6)

(this text has been taken by google from the categories box)

 

Whereas I want it to show

Blue widget for sale

This blue widget has 27 ball bearings

(this text is on my page and in the meta desc)

 

Is there a way of making sure relevant text is used by Google?

Why would some of Googles search results for my site have this problem and not others?

 

2) My second problem may be related. It is a little off topic I think but I will mention it in case it is relevant.

The problem is Google is showing search results which include session ids in the URLs. Virtually all of this type of search result has the problem I mention above in (1). Further, Google seems to be constantly spidering my site. I suspect this is related.

 

I would greatly appreciate any guidance on how to solve these problems.

 

Kind regards

Peter

Link to comment
Share on other sites

1) Sometimes Google does not display relevant text from my page or its meta description. Instead, it displays text from the manufacturers box or categories box - i.e. a fairly meaningless list of manufactures names or categories

 

2) My second problem may be related. It is a little off topic I think but I will mention it in case it is relevant.

The problem is Google is showing search results which include session ids in the URLs. Virtually all of this type of search result has the problem I mention above in (1). Further, Google seems to be constantly spidering my site. I suspect this is related.

1 - You can't control what google, or any search engine, uses in their listings. The others will usually use what one would expect but google builds the text itself and, at times, doesn't seem to make much sense. What you have to do is guide google to show it what needs to be displayed. If you want it to say, "This blue widget has 27 ball bearings," then use that phase several times on the page, in the meta description and in the logo's alt tag text. Google may get the idea but there is no guarantee.

 

2 - Be sure the prevent spider sessions in admin->configuration->sessions is set to true. If it is, then the links in the listings are from a previous time. You should apply the code to remove those. Search the forums for "sessions remove."

 

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

1 - You can't control what google, or any search engine, uses in their listings. The others will usually use what one would expect but google builds the text itself and, at times, doesn't seem to make much sense. What you have to do is guide google to show it what needs to be displayed. If you want it to say, "This blue widget has 27 ball bearings," then use that phase several times on the page, in the meta description and in the logo's alt tag text. Google may get the idea but there is no guarantee.

 

2 - Be sure the prevent spider sessions in admin->configuration->sessions is set to true. If it is, then the links in the listings are from a previous time. You should apply the code to remove those. Search the forums for "sessions remove."

 

Jack

Jack,

 

Thanks very much for your guidance. I understand we cannot fully control what text google uses in search results. It is a mystery how it manages to use relevant text from some of my pages and not others. All my product pages have unique descriptions, titles etc. Oh well, it sounds like there is little I can do about this other than study in detail differences betwee my pages and try and learn what works.

 

I have implemented fixes for the problem of session ids in search results. I'll mention what I did even if it is a little off topic in case it assists others:

1. in admin/configuration/sessions set "prevent spider sessions" to true

2. Upload a better spider.txt file to my server. See contribution "Updated Spiders.txt" http://www.oscommerce.com/community/contributions,2455

3. Used contribution "spider session remover" http://www.oscommerce.com/community/contributions,2819 to help remove SE results with session ids in them

 

Cheers

Pete

Link to comment
Share on other sites

I assume that if properly implemented, there should be the ability to edit the meta tag category database fields in admin, similar to editing ability for the product meta tag fields. Is there a specific section of logic in /admin/categories.php that could cause the categories_htc* fields to not be displayed in the New Category and Edit Category admin screens?

 

In my installation these database fields all seem to function correctly and populate the correct meta tags for the category pages, but I don’t have the ability to edit or even display the fields in admin/categories.php. I have been using phpMyAdmin to edit these fields but would like to figure out what is wrong.

 

I’m using HTC259 which was integrated with the STS4.2 contribution package. I performed a complete new shop install back in October 2006 and have no reason to think anything went wrong with that install. Everything except for admin editing of the category meta tags fields works as expected, including meta tag editing in the product description pages.

 

I’ve run through the required changes for /admin/categories.php and did not find that anything was missing. I was wondering if there is some database field or localization setting that might be capable of completely “turning off” the HTC category fields in admin/categories.php? Any input is appreciated.

Link to comment
Share on other sites

I assume that if properly implemented, there should be the ability to edit the meta tag category database fields in admin, similar to editing ability for the product meta tag fields.
Yes, that is correct. If you have teh Categories Description contribution installed, you have to turn it off to see the fields when you edit a category. If you don't have that installed, then there is a mistake in the admin/categories.php file. You can use the one from the contribution to verify it works and then compare the two to find the problem.

 

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,

 

Firstly thank you very much for your work on this contribution! I have done some research and found that this is probably the best meta/title contribution for osc. I was just wondering, does this have the ability to automatically generate meta tags?

Link to comment
Share on other sites

I just installed STS 4.5 with the HTC and when I go to edit any of the products, manufactures or categories I get these types of errors:

 

Manufacturers	  

Fatal error: Call to undefined function tep_get_manufacturer_htc_title() in /home/chineseh/public_html/devosc/admin/manufacturers.php on line 246

 

Categories / Products	   	
Fatal error: Call to undefined function tep_get_category_htc_title() in /home/chineseh/public_html/devosc/admin/categories.php on line 1016

 

Meta Tag Information
Product Title Tag: 	
English	  
Fatal error: Call to undefined function tep_get_products_head_title_tag() in /home/chineseh/public_html/devosc/admin/categories.php on line 583

 

 

Any ideas what I did wrong?

Link to comment
Share on other sites

Yes, that is correct. If you have teh Categories Description contribution installed, you have to turn it off to see the fields when you edit a category. If you don't have that installed, then there is a mistake in the admin/categories.php file. You can use the one from the contribution to verify it works and then compare the two to find the problem.

 

Jack

 

Hey there Jack. Right again….I do have the Category Descriptions contribution installed. I turned it off and now I see the HTC category fields. So what is the difference between “Header Tags Category Description” (database field categories_htc_title_tag and “Header Tags Categories Description” (database field categories_htc_description)? I’m having trouble figuring out what categories_htc_description does. It doesn’t appear to do anything in my shop.

Link to comment
Share on other sites

Hi Jack,

 

Firstly thank you very much for your work on this contribution! I have done some research and found that this is probably the best meta/title contribution for osc. I was just wondering, does this have the ability to automatically generate meta tags?

n a sense. If you enter a new product (or edit an exsisting one) that doesn't have entries in the header tags fields, it will add them. If you run Fill Tags initially, which you should, then there should never be a case of a product or category not having an entry in one of the header tags fields.

 

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

I just installed STS 4.5 with the HTC and when I go to edit any of the products, manufactures or categories I get these types of errors:

 

Manufacturers	  

Fatal error: Call to undefined function tep_get_manufacturer_htc_title() in /home/chineseh/public_html/devosc/admin/manufacturers.php on line 246

 

Categories / Products	   	
Fatal error: Call to undefined function tep_get_category_htc_title() in /home/chineseh/public_html/devosc/admin/categories.php on line 1016

 

Meta Tag Information
Product Title Tag: 	
English	  
Fatal error: Call to undefined function tep_get_products_head_title_tag() in /home/chineseh/public_html/devosc/admin/categories.php on line 583

Any ideas what I did wrong?

It sounds like you didn't install the new code into the general.php file. Read through the instructions named Install_Admin.txt and see if you missed that step.

 

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 there Jack. Right again….I do have the Category Descriptions contribution installed. I turned it off and now I see the HTC category fields. So what is the difference between “Header Tags Category Description” (database field categories_htc_title_tag and “Header Tags Categories Description” (database field categories_htc_description)? I’m having trouble figuring out what categories_htc_description does. It doesn’t appear to do anything in my shop.
It won't work in your shop, unless you have changed the code in index.php to allow it. That field in header tags is used to display categories text on the page, which is what Categories Description does. They both use the same section of code in index.php but the code itself is different between the two so you can only use that option from one of the contributions. It is posible to edit the code in index.php to use either based on the admin setting for Categories Description, but that seems a waste of time.

 

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

It sounds like you didn't install the new code into the general.php file. Read through the instructions named Install_Admin.txt and see if you missed that step.

 

Jack

 

Thanks Jack, that fixed it. I don't remeber seeing that in the STS PP install anywhere. I appreicate the quick response.

Link to comment
Share on other sites

Thanks Jack, that fixed it. I don't remeber seeing that in the STS PP install anywhere. I appreicate the quick response.

Oops...you must have missed that file during your installation. :blink:

 

I hope this does not sound "too" defensive but the modifications to the admin/includes/functions/general.php file are includled in the STS & HTC bundle (at least my version of it anyway that is dated May 10, 2007 and posted in the STS Power Pack site). :-

 

Glad Jack was able to help you out anyway. :thumbsup:

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Not defensive at all, sometimes I just get overwhelmed with the amount of instructions some of these plugins have. So I am the first to admit it was probably me.

Thanks again for all the help.

 

Oops...you must have missed that file during your installation. :blink:

 

I hope this does not sound "too" defensive but the modifications to the admin/includes/functions/general.php file are includled in the STS & HTC bundle (at least my version of it anyway that is dated May 10, 2007 and posted in the STS Power Pack site). :-

 

Glad Jack was able to help you out anyway. :thumbsup:

Link to comment
Share on other sites

It won't work in your shop, unless you have changed the code in index.php to allow it. That field in header tags is used to display categories text on the page, which is what Categories Description does. They both use the same section of code in index.php but the code itself is different between the two so you can only use that option from one of the contributions. It is posible to edit the code in index.php to use either based on the admin setting for Categories Description, but that seems a waste of time.

 

Jack

 

I'm not sure why I even installed the Category Descriptions contribution since I could have gotten the same functionality from HTC. Young and stupid at the time I guess. Thanks for explaining the situation. If I want to use the full admin features for HTC, it sounds like I will have to remove the Category Descriptions contribution. Otherwise, I'll keep using myPHPAdmin to edit the category meta tags.

 

Thanks again for the help Jack

Link to comment
Share on other sites

I'm not sure why I even installed the Category Descriptions contribution since I could have gotten the same functionality from HTC. Young and stupid at the time I guess. Thanks for explaining the situation. If I want to use the full admin features for HTC, it sounds like I will have to remove the Category Descriptions contribution. Otherwise, I'll keep using myPHPAdmin to edit the category meta tags.

 

Thanks again for the help Jack

There's no reason to use phpmyadmin. People with the two contributions installed just have to go through a few extra steps (note Categories Description = CD in the following):

 

- with CD enabled in admin (default), go to admin->Catalog and edit the categories description entry for CD

- turn off the CD option in admin and go to admin->Catalog and edit the title and meta tags for Header Tags. You can edit the categories desciption entry here too but it is not used in your setup).

- re-enable cd in admin.

 

You could also just leave CD turned off and change the code in index.php to use Header Tags. That would remove CD from the shop side. You may not have to remove it from the categories file, depending upon how you installed Header Tags. You would have to test it to be sure.

 

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 could also just leave CD turned off and change the code in index.php to use Header Tags. That would remove CD from the shop side. You may not have to remove it from the categories file, depending upon how you installed Header Tags. You would have to test it to be sure.

 

Based on what I've seen, I think I would just have to fix index.php and leave CD turned off in admin. I'm just glad to know what is happening and why. I've been troubled by this issue for some time but never got around to researching the problem. I'm still trying to remember why I even installed CD.

 

Thanks again for the help.

Link to comment
Share on other sites

Just started to install this contrib today. I made the database changes. I followed the catalog intallation exactly (as far as I can tell). I want to move on, but I am not getting the "Home Page" title on my index page. No errors, no indication that the store has changed. I don't even know where to start troubleshooting this. The store is http://www.specterstore.com/store. Thanks in advance for any help.

Link to comment
Share on other sites

To get the shop side to work, you need to upload the files for the shop and make the changes to the files as described in the Install_Catalog.txt file. If it is not working, you will need to go over those few steps again. Also, if you are using STS, the steps are different.

 

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

Assuming you have ran Fill Tags, try replacing your categories.php file. Make sure you have made the required changes to the product_info.php file. If it still fails, try replacing the includes/header_tags.php and english/header_tags.php files to see if the problem is fixed.

 

Jack

 

Hi Jack,

 

I tried but doesnt work still.

 

Can i get your help with this ? I read through the installation guide.

The index file has this sentence,

 

 

if ($category_depth == 'nested') {

$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

 

and replace with

 

if ($category_depth == 'nested') {

$category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

 

 

but for the product_info.php

 

it just get me to

 

FIND

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

REPLACE with

 

<td valign="top"><h1><?php echo $products_name; ?></h1></td>

<td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td>

 

Wonder if it's because missed out the SQL query?

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