Jump to content
Sign in to follow this  
Farrukh

[Contribution] Header Tags Controller for Admin MS 2.2

Recommended Posts

ok, I made it work for me :D

 

The first point is that some constants wern't the same (ex: FILENAME_INDEX was undefined I hab FILENAME_DEFAULT).

 

I dont know if it was particular on my OSC version (MS 2.2 ...) but it was so I had to define it and then recode some part of the contrib to work with as you'll see hereunder.

 

The second point was that my OSC version didnt use "product_all" files and constant.

 

I fixed that so maybe those who had the same problem and version should try this :

 

 

in /catalog/includes/filenames.php

I added this part :

	define('FILENAME_INDEX', 'index.php');
define('FILENAME_PRODUCTS_NEW', 'new_products.php');
define('FILENAME_ABOUT_US', 'about_us.php');

 

in /catalog/includes/header_tags.php

I added this part :

 case (strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCT_INFO) or strstr($PHP_SELF,FILENAME_PRODUCT_INFO) ):
$the_product_query = tep_db_query("select p.products_id, pd.products_name, pd.products_head_desc_tag, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$the_product = tep_db_fetch_array($the_product_query);

	$the_category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
$the_category = tep_db_fetch_array($the_category_query);

$the_manufacturers_query= tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");
$the_manufacturers = tep_db_fetch_array($the_manufacturers_query);

if (HTDA_PRODUCT_INFO_ON=='1') {
  $tags_array['desc']= $the_product['products_head_desc_tag'] . ' ' .HEAD_DESC_TAG_PRODUCT_INFO . ' ' . HEAD_DESC_TAG_ALL;
} else {
  $tags_array['desc']= HEAD_DESC_TAG_PRODUCT_INFO;
}

if (HTKA_PRODUCT_INFO_ON=='1') {
  $tags_array['keywords']= $the_product['products_name'] . ' ' .$the_category['categories_name'] . ' ' . HEAD_KEY_TAG_PRODUCT_INFO . ' ' . HEAD_KEY_TAG_ALL;
} else {
  $tags_array['keywords']= $the_product['products_name'] . ' ' .$the_category['categories_name'] . ' ' . HEAD_KEY_TAG_PRODUCT_INFO;
}

if (HTTA_PRODUCT_INFO_ON=='1') {
  $tags_array['title']= $the_product['products_name'] . ' ' .$the_category['categories_name'] . ' ' . HEAD_TITLE_TAG_ALL . " " . HEAD_TITLE_TAG_PRODUCT_INFO . $the_manufacturers['manufacturers_name'];
} else {
  $tags_array['title']= HEAD_TITLE_TAG_PRODUCT_INFO;
}
break;

 

So ... it was just a complience problem, thanks for this great contrib !

Share this post


Link to post
Share on other sites

Where are you seeing FILENAME_INDEX at? I can't find it anywhere in my version.

 

Jack

Share this post


Link to post
Share on other sites

Guys all is working fine except when trying to browse categories.. Checkout the link below, as this is the error I am encounting on my web page.

 

Link: http://rcgalaxy.com.au/index.php?manufacturers_id=10

 

This is the text error:

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); else $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $htc = tep_db_fetch_array($db_query); ?>

 

Am I getting this error becuase I have no products in these categories yet? Everything else seems fine with the way HTC works.

 

Also why can't I still find my website in google and yahoo? Is there something else I need to perform?

 

Much appreciated guys..

 

Great Contribution also, makes life easier.

Share this post


Link to post
Share on other sites
Where are you seeing FILENAME_INDEX at? I can't find it anywhere in my version.

 

Jack

 

???

FILENAME_INDEX isn't defined in filenames.php I had to define it 'cos your contrib works on it and only FILENAME_DEFAULT constant is available in my version.

 

rgds

Edited by c01

Share this post


Link to post
Share on other sites
Guys all is working fine except when trying to browse categories.. Checkout the link below, as this is the error I am encounting on my web page.

 

Link: http://rcgalaxy.com.au/index.php?manufacturers_id=10

 

This is the text error:

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); else $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $htc = tep_db_fetch_array($db_query); ?>

 

Am I getting this error becuase I have no products in these categories yet? Everything else seems fine with the way HTC works.

 

Also why can't I still find my website in google and yahoo? Is there something else I need to perform?

 

Much appreciated guys..

 

Great Contribution also, makes life easier.

I'm not seeing an error on that page.

 

Jack

Share this post


Link to post
Share on other sites
???

FILENAME_INDEX isn't defined in filenames.php I had to define it 'cos your contrib works on it and only FILENAME_DEFAULT constant is available in my version.

 

rgds

What I was asking is where do oyu see FILENAME_INDEX in the Header Tags package?

 

Jack

Share this post


Link to post
Share on other sites

hey i am getting this error on admin>catalog> manufacturer.php

 

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

 

i get this error when i select the manufacturer and click the edit tab.

 

this is the code on line 246

 

$manufacturer_htc_title_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_htc_title_tag[' . $languages[$i]['id'] . ']', tep_get_manufacturer_htc_title($mInfo->manufacturers_id, $languages[$i]['id']));

 

 

any help is very much apprecaited

 

thankyou

Share this post


Link to post
Share on other sites

I must have done something wrong somehow.

 

Everything seems to be funstioning no errors, and titles display , descriptions are updated fine etc....

 

But, I just went in and made a chenge to a products title (one word added to it) and now it displays no title at on that products listing. And made a small change to that's products meta description tag at the same time.

 

 

Could this be related to mod. It's a fairly new oscommerce install 3 moths old. And I believe it was installed with no mods so this was the first.

 

If I mucked up something during the install any ideas where to start looking for a mistake?

 

Thks

Share this post


Link to post
Share on other sites
hey i am getting this error on admin>catalog> manufacturer.php

 

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

 

i get this error when i select the manufacturer and click the edit tab.

 

this is the code on line 246

 

$manufacturer_htc_title_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('manufacturers_htc_title_tag[' . $languages[$i]['id'] . ']', tep_get_manufacturer_htc_title($mInfo->manufacturers_id, $languages[$i]['id']));

any help is very much apprecaited

 

thankyou

That means you probably didn't add that code to admin/includes/functions/general.php file. Re-read the instructions or compare your general.php file with the included one.

 

Jack

Share this post


Link to post
Share on other sites
I must have done something wrong somehow.

 

Everything seems to be funstioning no errors, and titles display , descriptions are updated fine etc....

 

But, I just went in and made a chenge to a products title (one word added to it) and now it displays no title at on that products listing. And made a small change to that's products meta description tag at the same time.

Could this be related to mod. It's a fairly new oscommerce install 3 moths old. And I believe it was installed with no mods so this was the first.

 

If I mucked up something during the install any ideas where to start looking for a mistake?

 

Thks

If you go back into the products page in admin. is the change you made still there? If not, the try it again to be sure you updated properly. If it still fails, then there is a mistake in your categories.php file.

 

Jack

Share this post


Link to post
Share on other sites
If you go back into the products page in admin. is the change you made still there? If not, the try it again to be sure you updated properly. If it still fails, then there is a mistake in your categories.php file.

 

Jack

 

 

That was it.. categories.. made a mistake ... found it in 5 minutes after you told me where to look.. much appreciated.

Share this post


Link to post
Share on other sites

This is one of the greatest mods I've ever seen in any software. So powerful.

 

One more question

 

What files do I need to look at to remove thehypens that are automatically placed in the meta title?

 

 

Ok how about two questions? Cause after this I need to work on SEO friendly URL's..

Any suggestions for good mod?

Share this post


Link to post
Share on other sites

Hello.

 

I just installed this mod on a heavily modified shop and for some reason the admin side is stuck on a string of code that hasn't been altered.

 

This is what I'm getting:

 

Parse error: parse error, unexpected T_CASE in /xx/html/test/catalog/admin/categories.php on line 526

 

and this is the block of code before and after the line. The line it's focused on is "case 'new_product_preview':".

			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':
// 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;
}
 }

 

 

Can anyone help me fix this?


Thanks!

Clesha

Share this post


Link to post
Share on other sites
This is one of the greatest mods I've ever seen in any software. So powerful.

 

One more question

 

What files do I need to look at to remove thehypens that are automatically placed in the meta title?

Ok how about two questions? Cause after this I need to work on SEO friendly URL's..

Any suggestions for good mod?

The hypens are added in the includes/header_tags.php file. Ultimate SEO would great for the url's.

 

Jack

Share this post


Link to post
Share on other sites

Clesha - Line numbers in errors don't always point to the problem. Since it was working before Header Tags and now it doesn't, you need to look at the changes you made for Header Tags prior to that line number.

 

Jack

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Jack,

 

I just wanted to add that I installed HTC without a hitch. The install was simple easy and works like a charm. First time go and absolutely 0 errors. :thumbsup:

 

Thanks for your hard work,

 

Eric


Eric

 

Keep up on osCommerce changes and updates at

Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.

Share this post


Link to post
Share on other sites

Hi Jack,

 

First off I want to say Thank You what a great contribution!!!

Quick question I was installing this part of the code where it states to change line 519 in Admin/Categories.php my line of codes does not exactly appear as the code you posted on the page... can you help as to what I should do...please & thank you..

 

My code shows this:

 

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

 

Your code shows this....

 

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

It shows to replace with this code:

 

<!-- HTC BOC //-->

<?php

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

?>

<tr>

<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

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

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<?php

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

?>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_PAGE_TITLE; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

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

</tr>

</table></td>

</tr>

<?php

}

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

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_HEADER_DESCRIPTION; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

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

</tr>

</table></td>

</tr>

<?php

}

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

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_KEYWORDS; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

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

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td colspan="2" class="main"><hr></td>

</tr>

<!-- HTC EOC //-->

Share this post


Link to post
Share on other sites

oops sorry your code shows this...

 

 

<?php

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

?>

<tr>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

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

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

Share this post


Link to post
Share on other sites

Forgive me - I found it - it was on line 530 and to think I thought I made sure to have looked and looked before posting - uh my eyes... sorry Jack...

*smile*

Share this post


Link to post
Share on other sites

I installed the header tag controller and it worked fine, however, upon editing a product I discovered that the Product Name input field was gone. When I tried to preview the product I received the following error message:

 

"Warning: Invalid argument supplied for foreach() in /home/content/n/i/g/nightvisiong/html/admin/categories.php on line 824"

 

Here is fragment of the categories.php file with that 824 line marked //824

 

<?php

echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"');

$extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS);

while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {

$extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];

}

 

if ($HTTP_GET_VARS['read'] == 'only') {

$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_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];

}

}

else {

$extra_fields_array = $HTTP_POST_VARS['extra_field'];

}

//824 START

foreach ($extra_fields_array as $key=>$val) {

//824 END

?>

<b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />

<?

}

 

echo "<br />" . $pInfo->products_description;

?>

</td>

<!-- Category Fields EOF //-->

</tr>

<?php

if ($pInfo->products_url) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>

</tr>

<?php

 

After submitting the product the Title line was gone....

 

Please Help!

 

Peter

Share this post


Link to post
Share on other sites

Hi, I am very new to this and this is my second install of an contrubtion. All went very well and I have no errors. This may sound really stupid but I am looking at all this and although the fill tags went greatly, is there somewhere that explains how to use it?

Thanks

Lexi

Share this post


Link to post
Share on other sites

There is a file in the contribution that gives an overview of what you need to do. The main point is to pcik ot the proper keywords for the home page (the products and categories are already set up). Picking the correct keyword is important but not something coverred by Header Tags. You can search the forums and/or the web for how to properly pick keywords.

 

Jack

Share this post


Link to post
Share on other sites

Finally... this version worked great. Before, I had STS 3 and HTC 2.5.5, but HTC didn't work as it should. Now I removed STS 3, installed STS 4.1, removed HTC 2.5.5 (completelly) and installed HTC 2.5.9, but only database, admin side and copied the new files in the catalog side, but I haven't modified the files from the catalog side, and now it works ok. So in case someone else has problems with STS and HTC, this versions worked for me. Also read in the docs of STS what else you must do when you install STS to have HTC working with it.

 

I also run in the same problem as I head with HTC 2.5.5: double slashes in the admin side. If someone else has this problem, look at post http://forums.oscommerce.com/index.php?sho...78entry762178 and a few posts after to see a solution...

 

Hope this helps someone :)

Edited by umc

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  

×