Jump to content
Sign in to follow this  
Farrukh

[Contribution] Header Tags Controller for Admin MS 2.2

Recommended Posts

It appears the title and meta tags don't change on the product info page. If you have not ran Fill Tags, go to admin->Header Tags->Fill Tags and run it. Then go to admin->Header Tags->Text Control and be sure to uncheck all of the HT.. boxes for the product_info section. Does that make a difference?

 

Jack

That makes no difference. :(

Share this post


Link to post
Share on other sites

If the code is in products_info.php, the section for product info is not selected in Text Control and your meta tags for your products are filled in when you edit a product, that pretty much covers it. I can't think of anything else to suggest.

 

Jack

Share this post


Link to post
Share on other sites
The size of the keywords box is 255 characters. You can change that by going to admin/header_tags_english.php and changing this line of code
		  <td class="smallText" ><?php echo tep_draw_input_field('main_keyword', tep_not_null($main_key) ? $main_key : '', 'maxlength="255", size="60"', false); ?> </td>

But if your keywords are over 255 characters, you are probably doing something wrong and I wouldn't recommend increasing the size.

 

Jack

I just have a lot of keywords I would like to use in my meta tags. I think that 255 characters for keywords (about 33 different length words) are not enough for me. Do you know what is the recommended keywords allowance for the search engines? I heard that title and description are what is matter, but what about keywords? Should I also type spaces in between the keywords or it's not necessary?

 

Thanks.

Edited by Irin

Share this post


Link to post
Share on other sites

Is there any way to fill Categories meta description with Categories Description just like Products with Products Description in Admin/Header Tags/Fill Tags? We already have Categories Description saved in the database, so why not use it for Categories meta description? That also will be a great idea to implement Language Selector into Admin/Text Control so meta tags for all languages could be filled.

 

Thanks.

Share this post


Link to post
Share on other sites

i am trying to install this contribution but having a problem. I have uploaded and ran the database_setup.php file and it comes up it is installed successfully. I then start the next bit of the installation which is the catalog side. The first part says add the following before the last ?> of the /catalog/includes/application_top.php file. when i add this line and go to my website all i get is a blank white screen but as soon as i undo the change my site works again, please help.

it tells you to add the following to the application_top.php file:-

 

// BOF: WebMakers.com Added: Header Tags Controller v2.5.7

require(DIR_WS_FUNCTIONS . 'header_tags.php');

// Clean out HTML comments from ALT tags etc.

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

// EOF: WebMakers.com Added: Header Tags Controller v2.5.7

Share this post


Link to post
Share on other sites
I just have a lot of keywords I would like to use in my meta tags. I think that 255 characters for keywords (about 33 different length words) are not enough for me. Do you know what is the recommended keywords allowance for the search engines? I heard that title and description are what is matter, but what about keywords? Should I also type spaces in between the keywords or it's not necessary?

 

Thanks.

Having that many keywords is a waste of time and will, most likely, do you more harm than good. I don't know that there is a limit on the number of words you can enter. The SE's will typically cut off the title after 60-80 characters (maybe 120 for yahoo) and about 200-250 characters for the description. So I doubt that they take more than that but they might. I don't know if anyone ever bothered to check since it is a waste to use more than three usually and three would never be that long. You don't need to use spaces between the keywords but they do need to be separated by commas.

 

Jack

Share this post


Link to post
Share on other sites
Is there any way to fill Categories meta description with Categories Description just like Products with Products Description in Admin/Header Tags/Fill Tags? We already have Categories Description saved in the database, so why not use it for Categories meta description? That also will be a great idea to implement Language Selector into Admin/Text Control so meta tags for all languages could be filled.

 

Thanks.

The only way to do that now is to edit the category and copy the text into the meta tag.

 

Jack

Share this post


Link to post
Share on other sites

Please post the last half of your application_top file with that code installed.

 

Jack

Share this post


Link to post
Share on other sites
Please post the last half of your application_top file with that code installed.

 

Jack

here is part of my application_top file:

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

 

// Shopping cart actions

if (isset($HTTP_GET_VARS['action'])) {

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid');

} else {

$goto = basename($PHP_SELF);

if ($HTTP_GET_VARS['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id');

} else {

$parameters = array('action', 'pid');

}

}

switch ($HTTP_GET_VARS['action']) {

// customer wants to update the product quantity in their shopping cart

case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {

if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {

$cart->remove($HTTP_POST_VARS['products_id'][$i]);

} else {

if (PHP_VERSION < 4) {

// if PHP3, make correction for lack of multidimensional array.

reset($HTTP_POST_VARS);

while (list($key, $value) = each($HTTP_POST_VARS)) {

if (is_array($value)) {

while (list($key2, $value2) = each($value)) {

if (ereg ("(.*)\]\[(.*)", $key2, $var)) {

$id2[$var[1]][$var[2]] = $value2;

}

}

}

}

$attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';

} else {

$attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';

}

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// performed by the 'buy now' button in product listings and review page

case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

} else {

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

case 'notify' : if (tep_session_is_registered('customer_id')) {

if (isset($HTTP_GET_VARS['products_id'])) {

$notify = $HTTP_GET_VARS['products_id'];

} elseif (isset($HTTP_GET_VARS['notify'])) {

$notify = $HTTP_GET_VARS['notify'];

} elseif (isset($HTTP_POST_VARS['notify'])) {

$notify = $HTTP_POST_VARS['notify'];

} else {

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

}

if (!is_array($notify)) $notify = array($notify);

for ($i=0, $n=sizeof($notify); $i<$n; $i++) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] < 1) {

tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");

}

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));

} else {

$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

}

}

 

// include the who's online functions

require(DIR_WS_FUNCTIONS . 'whos_online.php');

tep_update_whos_online();

 

// include the password crypto functions

require(DIR_WS_FUNCTIONS . 'password_funcs.php');

 

// include validation functions (right now only email address)

require(DIR_WS_FUNCTIONS . 'validations.php');

 

// split-page-results

require(DIR_WS_CLASSES . 'split_page_results.php');

 

// infobox

require(DIR_WS_CLASSES . 'boxes.php');

 

// auto activate and expire banners

require(DIR_WS_FUNCTIONS . 'banner.php');

tep_activate_banners();

tep_expire_banners();

 

// auto expire special products

require(DIR_WS_FUNCTIONS . 'specials.php');

tep_expire_specials();

 

// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

} else {

$cPath = '';

}

 

if (tep_not_null($cPath)) {

$cPath_array = tep_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];

} else {

$current_category_id = 0;

}

 

// include the breadcrumb class and start the breadcrumb trail

require(DIR_WS_CLASSES . 'breadcrumb.php');

$breadcrumb = new breadcrumb;

 

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

$breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

 

// add category names or the manufacturer name to the breadcrumb trail

if (isset($cPath_array)) {

for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {

$categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($categories_query) > 0) {

$categories = tep_db_fetch_array($categories_query);

$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

} else {

break;

}

}

} elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {

$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

if (tep_db_num_rows($manufacturers_query)) {

$manufacturers = tep_db_fetch_array($manufacturers_query);

$breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));

}

}

 

// add the products model to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

if (tep_db_num_rows($model_query)) {

$model = tep_db_fetch_array($model_query);

$breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

}

}

 

// initialize the message stack for output messages

require(DIR_WS_CLASSES . 'message_stack.php');

$messageStack = new messageStack;

 

// set which precautions should be checked

define('WARN_INSTALL_EXISTENCE', 'true');

define('WARN_CONFIG_WRITEABLE', 'true');

define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');

define('WARN_SESSION_AUTO_START', 'true');

define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');

 

// BOF: WebMakers.com Added: Header Tags Controller v2.5.7

require(DIR_WS_FUNCTIONS . 'header_tags.php');

// Clean out HTML comments from ALT tags etc.

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

// EOF: WebMakers.com Added: Header Tags Controller v2.5.7

?>

Share this post


Link to post
Share on other sites

It looks OK. Try removing one of those statements, like require(DIR_WS_FUNCTIONS . 'header_tags.php');, and see if it still fails. If it doesn't, try putting it back in and remove the other.

 

Jack

Share this post


Link to post
Share on other sites
It looks OK. Try removing one of those statements, like require(DIR_WS_FUNCTIONS . 'header_tags.php');, and see if it still fails. If it doesn't, try putting it back in and remove the other.

 

Jack

 

i tried removing one but it still does the same thing. i try removing the other one but thats the same also. does it make a difference that i am using an oscommerce template i got from the internet. my site is www.aiop.co.uk so you can see what i mean

Share this post


Link to post
Share on other sites

No, it shouldn't matter. Header Tags works with any version of oscommerce.

 

Jack

Share this post


Link to post
Share on other sites

Hi, I have just started adding inventory and noticed that my Product Name field appears to be missing. I have HTC & SEO URLS installed and I "think" this may be something to do with HTC. Basically on the product description page there is no field for me to enter the product name, heres what I get: http://www.zenadsl2129.zen.co.uk/OSC/NewProduct.jpg .

On my Admin/Categories/Products page the products appear, but with no name as I'm not able to enter one. Here's what it looks like: http://www.zenadsl2129.zen.co.uk/OSC/ProductName.jpg .

 

When viewing a product in the store the model number appears at the top, but above that there is obviously no product name.

 

I hope it's ok to post the image links, seemed the best way to describe what's happening.

Any help in finding the elusive Product Name field would be very much appreciated. If I can get this sorted I'll be back in business. If you need any of my code please let me know. Thanks.

Share this post


Link to post
Share on other sites

It's a mistake in your admin/categories.php file. Compare yours to the included one to find the problem.

 

Jack

Share this post


Link to post
Share on other sites
It's a mistake in your admin/categories.php file. Compare yours to the included one to find the problem.

 

Jack

 

 

By jove Holmes I think you've got it!

I reinstalled the supplied file and made the other minor changes for SEO URLs. Just seemed easier :)

 

Thanks Jack :thumbsup:

Share this post


Link to post
Share on other sites

Hi,

 

I searched the forum and couldn't find an answer to this problem....

 

Just noticed that I cannot duplicate products after the Header Tags Controller install. I've seen some posts that are similar, but none with my specific error:

 

1136 - Column count doesn't match value count at row 1

 

insert into products_description (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('284', '1', '6ft Comfort Sac - Lounger Sac', 'The Comfort Sac Lounger is the big daddie in the Comfort Sac line. The Lounger has just over 6 feet of pillow soft shredded foam seating. For those who demand more the lounger is similar to the size of a sofa, but designed to offer 360 degrees of super-sized comfort. It\'s the new funky sofa that\'s out of the ordinary, and all the rage.

 

Features:

 

Made in the U.S.A.

Long Lasting & Durable

Double stitched with double overlap folded seam

Childproof safety lock zipper pulls

Dimensions: 73\" x 52\" x 32\"

Circumference 210?

Recommended Seating Age: Teen to Adult

Spot Clean with gentle soap and water

Free inner liner

1 Year Limited Warranty

 

 

Usually Ships in 7-10 business days

 

 

Click here to see color options

', '', '0')

 

[TEP STOP]

 

 

Any help would be greatly appreciated.

 

Sean

Share this post


Link to post
Share on other sites

It's a mistake in your admin/categories.php file. Compare yours to the included one to find the problem.

 

Jack

Share this post


Link to post
Share on other sites
It means HEAD_TITLE_TAG_ABOUTUS is not defined. Check your filenames.php file. It is probably someting like HEAD_TITLE_TAG_ABOUT_US.

 

Jack

Jack,

 

Thanks for enhancing and supporting this contribution. HTC is working fine for catalog index, category, subcategory, product info pages, new products, but I noticed that HTC title, description, and kewords is as follows for the store information pages:

 

HEAD_TITLE_TAG_CONTACT_US for contact_us.php

HEAD_TITLE_TAG_ABOUTUS for about_us.php

HEAD_TITLE_TAG_CONDOTIONS for conditions.php

HEAD_TITLE_TAG_PRIVACY for privacy.php

HEAD_TITLE_TAG_SHIPPING for shipping.php

 

I noted the your post on 1/20/06 regarding defining HEAD_TITLE_TAG_ABOUT_US in includes/filenames.php however I can see that these pages are defined as follows:

 

define('FILENAME_CONTACT_US', 'contact_us.php');

define('FILENAME_ABOUT_US', 'about_us.php');

define('FILENAME_CONDITIONS', 'conditions.php');

define('FILENAME_PRIVACY', 'privacy.php');

define('FILENAME_SHIPPING', 'shipping.php');

 

Any clues to resolving this problem ?

Share this post


Link to post
Share on other sites

Have you installed the Header Tags code for the title on those pages?

 

Jack

Share this post


Link to post
Share on other sites

Jack, I have another question. I'm trying to find where is a string length for Header Tags Category Description and Header Tags Category Keywords in admin/categories.php is defined. The lenght is set to 30 characters for both fields. Could you please help me?

 

Thanks.

Share this post


Link to post
Share on other sites

Those aren't set as I recall. They are left empty and just use the default setting. I just tried entering a very long meta description and category description and they both took hundreds of characters. If you want to change them, open the Install_Admin.txt file and search for

tep_draw_input_field

for the categories changes. That is where you would change the size.

 

Jack

Share this post


Link to post
Share on other sites
Have you installed the Header Tags code for the title on those pages?

 

Jack

 

The following block of code exists between <head> ....</head> statements for those catalog pages.

 

<?php
// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2
// Replaced by header_tags.php - 6/10/06 modified for STS 4.1
if ($sts->display_template_output==false) {
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
	  require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
  <title><?php echo TITLE; ?></title>
<?php
}
 }
// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2
?>

Share this post


Link to post
Share on other sites

I don't use STS but that code looks like it is saying to use Header Tags if STS is disabled. As a test, try removing this code

if ($sts->display_template_output==false)

Note that that doesn't not include the { at the end.

 

Jack

Share this post


Link to post
Share on other sites
I don't use STS but that code looks like it is saying to use Header Tags if STS is disabled. As a test, try removing this code
if ($sts->display_template_output==false)

Note that that doesn't not include the { at the end.

 

Jack

Jack,

I commented it out to test, result was page Title went ftom HEADER_TAG_TITLE_PRIVACY to no Title, description, or keywords. Basically HTC became disabled for that page. Also catalog/index.php and product_info.php have the same exact block of code between the <head> statements.

Share this post


Link to post
Share on other sites
Those aren't set as I recall. They are left empty and just use the default setting. I just tried entering a very long meta description and category description and they both took hundreds of characters. If you want to change them, open the Install_Admin.txt file and search for
tep_draw_input_field

for the categories changes. That is where you would change the size.

 

Jack

I don't know why am I having a problem with those fields limited to just 30 characters if you say that it's not set anywhere. Any way, I replaced tep_draw_input_field for $category_htc_keywords_string and $category_htc_description_string to tep_draw_textarea_field:

$category_htc_keywords_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('categories_htc_keywords_tag[' . $languages[$i]['id'] . ']', 'hard', 30, 3, tep_get_category_htc_keywords($cInfo->categories_id, $languages[$i]['id']));

$category_htc_description_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('categories_htc_description[' . $languages[$i]['id'] . ']', 'hard', 30, 5, tep_get_category_htc_description($cInfo->categories_id, $languages[$i]['id']));

Now I have a text box to enter my Category Description and Keywords. It's just when I look at my page source, the words in Description are wrapped. Is there anyhow I can change it?

And another question, I don't know if it's possible or not. I want my index.php display store's default description and keywords (HTDA & HTKA checked) but index.php?cPath=... display just specified in admin/categories.php description and keywords (HTDA & HTKA unchecked). I know it's sounds silly and it's all index.php page, but is there anyhow I can make it that way?

 

Thanks in advance.

Edited by Irin

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
Sign in to follow this  

×