Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

I just took a look at your index file and it has some duplicated code in it that is preventing the description from being displayed.

 

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

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

I just took a look at your index file and it has some duplicated code in it that is preventing the description from being displayed.

 

Jack

Hi Jack,

 

Was this reply for me and is it in regards to the descriptions not showing for the subcategories?

And if it is in regards to the subcategories, where and how can I fix the error?

 

Denice

Edited by jewelrytrends
Link to comment
Share on other sites

Hi Jack,

 

Was this reply for me and is it in regards to the descriptions not showing for the subcategories?

And if it is in regards to the subcategories, where and how can I fix the error?

 

Denice

Sorry for this second post, but I would like to explain a little more of what I'm trying to do. I think I should be able to do this with this contrib, but maybe I need to install another contrib to acomplish this.

 

If I understand the seo rules correctly, it is important to have at least 200 readable (for the customers, so not for the search engines) words to reach higher placing in the search engine. I would like to do this by placing a short description of each categorie and subcategorie on the categoriepages. Can I do this with headertags? I'm pretty sure I can, but would like to be sure.

 

I hope you understand what I'm trying to do, and that I didn't confuse you with my rambling :blink:

 

Denice

Link to comment
Share on other sites

Yes, that was for you. The part of your index page that deals with that part of site has the code duplicated for some reason. So the first part s not allowing the second part to see the code added by header tags. You will need to go into that file and remove the extra code, which is going to be difficult unless you have an original copy.

 

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 People,

 

All new categories created fail to populate the title, meta description and meta keywords, categories made some time ago are still populated. When looking at the source these section's are all blank. However when creating products it works as normal. This has only started happening recently and I dont know what I have changed to cauise this to happen.

 

An example can be found here:

 

http://www.voipon.co.uk/index.php?cPath=1_61

 

Could it be somthing i have adjusted in the admin section??

 

Any pointers would be much appreciated.

Link to comment
Share on other sites

Are you saying that if you enter text into the header tags fields in a category, they are not recorded or are you saying that they are not filling in automatically? If the latter, that is not how it works. If the former, have you tried the Fill Tags option. If it works after that, then the code in the cateogires file is not working properly.

 

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 all!

 

Is there a way to inlcude the category keywords in to the pruduct keywords tag?

 

Example:

The category tag contains: "Car, cars, auto"

The product tag contains: "Ford, mustang"

 

I would like the product tag to contain "Ford, mustang, cars, car, auto"

 

Is this possible in any way?

 

Thanks!

Link to comment
Share on other sites

You would need to edit the includes/header_tags.php file to read in the database for the particular category. It isn't recommended since it would do harm to the optimization for that product page.

 

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,

 

Apologies if this has already been covered, but I couldn't find a fix to the following problem.

 

I have installed the Header Tags controller contrib and have tried updating the default settings via Text Control. I have entered a new Title, Description and Keywords and it appeared to update, however checking my site only the Title tag is updated successfully, the Description and Keywords are not updated. When I click back on Text Control, it has reverted to the original settings for Description (e.g. What'''s New Here?) and Keywords (e.g. Hardware Software DVD Movies).

 

Any ideas as to what the problem may be?

 

Cheers

Link to comment
Share on other sites

Also, when I now click on Catalog in admin, the following error message is displayed:

 

Parse error: parse error, unexpected T_ELSEIF in /home/sansal00/public_html/admin/categories.php on line 734

 

I have checked admin/categories.php but I cannot see the problem:

 

731 </table></form>
732 <!-- HTC BOC //-->	 
733 <?php
734  } elseif ($action == 'new_product_preview') {
735	if (tep_not_null($HTTP_POST_VARS)) {
736	  $pInfo = new objectInfo($HTTP_POST_VARS);

 

Does anyone have any suggestions?

 

Thanks

Edited by toby_uk
Link to comment
Share on other sites

It could be done on the admin side, when adding a product, so no problem with the parse time of the page.

What Jack is talking about is the search optimizing. It "can" be done without too much affect on the performance, but it shouldn't for search optimizing reasons. The most optimized page title, description, and keywords tags for a "Ford, mustang" is "Ford, mustang", or actually better yet "mustang, Ford". By adding other keywords, you are simply diluting the optimizing effect. The best place for "Car, cars, auto" would be in the category's tags.

Link to comment
Share on other sites

When I click back on Text Control, it has reverted to the original settings for Description (e.g. What'''s New Here?) and Keywords

I believe this issue has been addressed in the last few pages. I believe it was an old version issue. Is this the most recent "Header Tags Controller v2.5.5 Complete Jack_mcs 7 Sep 2005" version?

 

As far as your error goes, sounds like you have made an error in the integration of HTC. Try recomparing the additions. Sounds like you have an extra closing brace somewhere above that. This is the "elseif" for the "if" on line 377 of the HTC package admin/categories.php file.

 

Also, make sure you actually replaced the "} elseif ($action == 'new_product_preview') {" of the original file and not just added the HTC block after.

Link to comment
Share on other sites

Thanks for your reply.

 

I believe this issue has been addressed in the last few pages. I believe it was an old version issue. Is this the most recent "Header Tags Controller v2.5.5 Complete Jack_mcs 7 Sep 2005" version?

It was definitely HTC v2.5.5, but I'm not sure if it was the Jack_mcs version. I have fixed the first problem by manually editing /includes/languages/english/header_tags.php.

 

As far as your error goes, sounds like you have made an error in the integration of HTC. Try recomparing the additions. Sounds like you have an extra closing brace somewhere above that. This is the "elseif" for the "if" on line 377 of the HTC package admin/categories.php file.

 

Also, make sure you actually replaced the "} elseif ($action == 'new_product_preview') {" of the original file and not just added the HTC block after.

I have compared the additions and as far as I can see it appears to be correct, but my php skills are somewhat lacking, so I may have missed something simple. Would you mind if I posted the code for you to take a look?

 

Thanks for your help.

Link to comment
Share on other sites

I have compared the additions and as far as I can see it appears to be correct, but my php skills are somewhat lacking, so I may have missed something simple.

And guess what I had made a simple mistake, I'd deleted a '?>' by mistake, all seems to be working now, thanks for the help :blush: :thumbsup:

Edited by toby_uk
Link to comment
Share on other sites

Hi everyone,

 

I have installed this contrib and almost everything is working well. I installed 2.5.5 with a new install on a fairly heavily modded site. I do have one problem and have spent days looking for it!

 

The catalog side is working well and the admin area installed ok and from the link in the main admin gage takes me to the right place and all looks good. However when I try to click on "catalog" (to add / amend some products I receive a Parse error (below) and cannot see what I have done wrong. I have gone through the code a dozen times to compare but must keep missing it. Please would someone point me in the right direction??

 

Parse error: parse error, unexpected T_CASE in /homepages/30/d116518341/htdocs/catalog/admin/categories.php on line 372 (Highlighted in bold)

 

The code from lines 278 to 449 is enclosed (and note I have the short product description mod installed so have added the appropriate lines. Please have a look and let me know where I have gone wrong....

 

//HTC BOC

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

 

'short_desc' => tep_db_prepare_input($HTTP_POST_VARS['short_desc'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]),

'products_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),

'products_head_desc_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_desc_tag'][$language_id]),

'products_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$language_id]));

//HTC EOC

 

if ($action == 'insert_product') {

$insert_sql_data = array('products_id' => $products_id,

'language_id' => $language_id);

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_product') {

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");

}

}

// Category Fields

$extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id);

while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {

$extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];

}

 

if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.

foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {

if (isset($extra_product_entry[$key])) { // an entry exists

if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);

else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);

}

else { // an entry does not exist

if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");

}

}

}

// Category Fields EOF

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

}

break;

case 'copy_to_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) {

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

if ($HTTP_POST_VARS['copy_as'] == 'link') {

if ($categories_id != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'");

$check = tep_db_fetch_array($check_query);

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

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')");

}

} else {

$messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$product = tep_db_fetch_array($product_query);

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

$dup_products_id = tep_db_insert_id();

 

//HTC BOC

$description_query = tep_db_query("select language_id, products_name, products_description, short_desc, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_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 ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

//HTC EOC

}

$description_query = tep_db_query("select language_id, products_name, products_description, short_desc, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, short_desc, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['short_desc']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));

 

break;

case 'new_product_preview': Line 370

// copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

break;

}

}

 

// check if the catalog image directory exists

if (is_dir(DIR_FS_CATALOG_IMAGES)) {

if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');

} else {

$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">

<div id="spiffycalendar" class="text"></div>

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top">

<?php

if ($action == 'new_product') {

$parameters = array('products_name' => '',

'products_description' => '',

'short_desc' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '',

'products_model' => '',

'products_image' => '',

'products_price' => '',

'products_weight' => '',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

$pInfo = new objectInfo($parameters);

 

//HTC BOC

if (isset ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {

// Category Fields

$products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);

while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {

$extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];

}

$extra_field_array=array('extra_field'=>$extra_field);

$pInfo->objectInfo($extra_field_array);

// Category Fields EOF

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

//HTC EOC

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

I have one slight issue remaining. Its not a major problem as the whole contrib works like a dream! When I check out my "About Us" page the title in the bar at the top reads HEAD_TITLE_TAG_ABOUTUS.

 

Could someone please advise me what I have done wrong and how I can correct this. I think that it is something I must have done previously as everything else is working well.

 

Many thanks.

You will never learn if you don't try. And boy am I trying....!

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

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 means HEAD_TITLE_TAG_ABOUTUS is not defined. Check your filenames.php file. It is probably someting like HEAD_TITLE_TAG_ABOUT_US.

 

Jack

 

 

Many thanks Jack,

 

How silly was that! Changed it to

 

define('FILENAME_ABOUT', 'about.php');

 

and it worked a treat. Thank you.

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

I've just installed header tags V2.5.5 and made changes as advised in the Corrections to Header Tags Controller.

 

The link is in the admin panel but when I click on it I get the following error:

Warning: main(includes/languages/english/header_tags_controller.php): failed to open stream: No such file or directory in /home/.sites/133/site55/web/catalog/staff/header_tags_controller.php on line 15

 

Warning: main(includes/languages/english/header_tags_controller.php): failed to open stream: No such file or directory in /home/.sites/133/site55/web/catalog/staff/header_tags_controller.php on line 15

 

Fatal error: main(): Failed opening required 'includes/languages/english/header_tags_controller.php' (include_path='.:/usr/local/lib/php') in /home/.sites/133/site55/web/catalog/staff/header_tags_controller.php on line 15

 

 

Line 15 is:

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_HEADER_TAGS_CONTROLLER);

 

I'm not quite sure where my error is. I have gone back over all the changes and I can't see what I have done wrong. Hoping someone can help. Thanks.

Edited by Dubs
Link to comment
Share on other sites

Okay... well it all seems to be working now - no more errors BUT the page titles don't appear to be changing. What have I missed? I am using the STS template system (latest version) and I did install the extra files for this but when added the file name in the field for "files for normal template" in the admin panel it gave me more error messages so I removed it. Help

Link to comment
Share on other sites

So this is where I am at:

 

I tried the additional code and file for the STS template system

 

When I try to look at my pages I get:

 

 

Fatal error: Cannot redeclare tep_get_header_tag_products_title() (previously declared in /home/.sites/133/site55/web/catalog/includes/functions/header_tags.php:8) in /home/.sites/133/site55/web/catalog/includes/functions/header_tags.php on line 8

 

Please help.

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