Jump to content



Latest News: (loading..)

* * * * - 8 votes

Article Manager v1.0


  • Please log in to reply
2154 replies to this topic

#2001   kevinb456

kevinb456
  • Members
  • 23 posts
  • Real Name:Kevin

Posted 06 October 2011 - 10:35 PM

View PostJack_mcs, on 05 October 2011 - 11:46 PM, said:

So if you have an article that is named "My Article," you can change it the title of that page to "My Article?" And you don't get an error in admin when you add the article? I don't see how you can do that without Header Tags installed but if it works for you, that's all that matters.

Well, If I set 'HTML Page title', 'meta description' and 'meta keywords' fields when making an article, they then appear in the title, meta description and keywords parts of the HTML once I navigate to the article page.

The only part wrong is that there are also other things included in the title/description/keywords which I think are some default ones I set ages ago in KissMT, but I'm pretty sure I can remove them just haven't put the time in to find out where they're defined yet.

I don't know... perhaps I've inadvertantly installed Header Tag SEO. I don't really know what files are which, but I didn't download that contribution specifically so I assumed I didn't. But I DO have the file includes/article_header_tags.php on my server, which is what pulls the title and meta tags from the database and inserts them in the head, so I'm not too surprised that it works - the code is there after all! This does seem like a direct 'include' of 'article_header_tags.php' though, and this file, entirely on its own, sets the title and header tags. So I still don't see even if I did install Header Tags SEO how would it hook-in to it?

Jeez maybe I just installed a different version of the contribution to what I thought.... no idea lol. As you say though, if it works who cares. Thanks for your assistance.

Be happy all. Live it.

#2002   larndoc

larndoc
  • Members
  • 3 posts
  • Real Name:Christoph Larndorfer

Posted 08 October 2011 - 12:17 PM

View PostJack_mcs, on 05 October 2011 - 11:52 PM, said:

The latest version shouldn't have this problem so be sure you are using my latest version. If you are, you could look back through the thread since this has been addressed several times. Maybe on of those posts will help.

Latest version was installed, still the problem was there. Sweeped thru the forum and found that if there is an empty row in the topics table it has to be deleted!

So for all others which encounter similar problems - go on phpmyadmin or sth similar on your database and put the sql command
SELECT *
FROM `topics`
LIMIT 0 , 30

if there is an empty row in your database, delete this one - then it works!

#2003   mattwhi

mattwhi
  • Members
  • 6 posts
  • Real Name:Matthew White
  • Gender:Male

Posted 21 October 2011 - 01:26 PM

Hi Can someone tellme how I can style the side menu, i cannot seem to find the right file for the side menu?
Matthew White

#2004   antob

antob
  • Members
  • 1 posts
  • Real Name:Antonio Obrinovski

Posted 29 October 2011 - 02:10 PM

Hi Guys,

New to OScommerce.

Installed this addin and have following error when trying to add author:


"
Fatal error: Call to undefined function tep_hide_session_id() in /usr/www/users/iwjdes/oldsite/admin/authors.php on line 190
"
[img]http://forums.oscommerce.com//public/style_emoticons/default/innocent.gif[/img]

Any pointer greatly appreciated!!

#2005   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 29 October 2011 - 03:35 PM

View Postantob, on 29 October 2011 - 02:10 PM, said:

Hi Guys,

New to OScommerce.

Installed this addin and have following error when trying to add author:


"
Fatal error: Call to undefined function tep_hide_session_id() in /usr/www/users/iwjdes/oldsite/admin/authors.php on line 190
"
[img]http://forums.oscommerce.com//public/style_emoticons/default/innocent.gif[/img]

Any pointer greatly appreciated!!
That's a standard function in oscommerce except in very old versions. To fix it, add the following in the admin/includes/functions/html_output.php before the last ?>
////
// Hide form elements
  function tep_hide_session_id() {
	$string = '';
	if (defined('SID') && tep_not_null(SID)) {
	  $string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
	}
	return $string;
  }


#2006   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 08 November 2011 - 04:55 AM

Slogging my way through the changes from 2.2 to 2.3, and reinstalling all the packages I had on my pre-existing site.  I think I have everything up and running properly, but when I get to the tell-a-friend function, the email never sends - the page is an endless loop of hitting continue, and never moves beyond that.

I will say the stock code on this page was the one that least lined up with the instructions (difference between the 2.2 code and the new themeroller part of 2.3, I believe), so it wouldn't surprise me if I mis-coded something, but everything else appears to be working properly so I wondered what I might have missed.  No error message is delivered, just when you click "Continue" it just refreshes the page.

#2007   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 November 2011 - 01:18 PM

View Postakansan, on 08 November 2011 - 04:55 AM, said:

I will say the stock code on this page was the one that least lined up with the instructions (difference between the 2.2 code and the new themeroller part of 2.3, I believe), so it wouldn't surprise me if I mis-coded something, but everything else appears to be working properly so I wondered what I might have missed.  No error message is delivered, just when you click "Continue" it just refreshes the page.
There is a completed file in the package that you can compare your changes against or, if your template doesn't add much to the file, it could just be used as is.

#2008   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 08 November 2011 - 02:55 PM

I have my back-up file of it, but I might see what happens if I just replace the completed file from the package with the one I'm currently using.  I don't think any of my other contribs I have installed affected that page at all (except possibly Header Tags?), but I'd need to verify. Also found a bug on that page on my site in the breadcrumbs (shows the product name, doesn't show the article name) - it seems where-ever it's asked to choose between article or product on this page is where it's freaking out.  (And possibly related - if you aren't logged in when you attempt to tell-a-friend, and have to log in to do so, it loses the article name.)

I'll upload the file from the package and see what happens.

#2009   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 08 November 2011 - 03:16 PM

Just tried the file straight from the contribution - I get the message "Product not found!" when I try to tell-a-friend from the article with that file.  If I hit the continue button from there, it takes me back to my home page.

#2010   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 November 2011 - 04:21 PM

I don't know why it is failing for you. It works correctly in my installation here but I will look at it when I get a chance.

#2011   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 08 November 2011 - 05:50 PM

I figured out why the file straight from the contribution doesn't work - it's not edited in any way. There's no addition of the article manager code to it.  I re-downloaded the contribution to verify, but it is indeed the un-altered file from an initial install of 2.3.1 rather than a file with the code added to it.

#2012   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 08 November 2011 - 06:11 PM

Okay - and figured out why it was not sending.  The form code has changed with the new buttons.  You have that it should be:
<!-- body_text //-->
	<?php /**** BEGIN ARTICLE MANAGER ****/ ?>
	<td width="100%" valign="top">
	<?php
	  // Modify form processing depending on whether product or article
	  if ($valid_product) {
		echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id']));
		} else if ($valid_article) {
		  echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&articles_id=' . $HTTP_GET_VARS['articles_id']));
	  }
	?><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="pageHeading">
			<?php
			  // Modify heading depending on whether product or article
			  if ($valid_product) {
				 $title = $product_info['products_name'];
				 } else if ($valid_article) {
				   $title = $article_info['articles_name'];
			  }
			  echo sprintf(HEADING_TITLE, $title);
			?>
			 </td>
   <?php /**** END ARTICLE MANAGER ****/ ?>

and with the new forms and buttons, it should be:

 
<h1><?php  // Modify heading depending on whether product or article
			  if ($valid_product) {
				 $title = $product_info['products_name'];
				 } else if ($valid_article) {
				   $title = $article_info['articles_name'];
			  }
			  echo sprintf(HEADING_TITLE, $title);
			?>
</h1>
 
<?php
  if ($messageStack->size('friend') > 0) {
	echo $messageStack->output('friend');
  }
?>
 
<?php
	  // Modify form processing depending on whether product or article - Article Manager
	  if ($valid_product) {
		echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' . (int)$HTTP_GET_VARS['products_id']), 'post', '', true);
		}
else if ($valid_article) {
		echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&articles_id=' . (int)$HTTP_GET_VARS['articles_id']), 'post', '', true);
	  } // End Article Manager
	?>

Likewise, the back button code has changed.  You have:
 <td><?php
					/**** BEGIN ARTICLE MANAGER ****/
					// Modify back button depending on whether product or article
					if ($valid_product) {
					  echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';
					  } else if ($valid_article) {
						echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $HTTP_GET_VARS['articles_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';
					}
					/**** END ARTICLE MANAGER ****/
					   ?></td>

And with the new buttons, it needs to be:
 <?php  /**** BEGIN ARTICLE MANAGER ****/
	   // Modify back button depending on whether product or article
					if ($valid_product) {
					  echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id']));
					  } else if ($valid_article) {
echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . (int)$HTTP_GET_VARS['products_id']));					  
					}
					/**** END ARTICLE MANAGER ****/
					   ?>

Hope this helps, and thanks for bearing with me!

Edited by akansan, 08 November 2011 - 06:13 PM.


#2013   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 November 2011 - 06:24 PM

Thank you for posting the fixes. I must not have included the file I tested with in the package. Your posting should help others.

#2014   akansan

akansan
  • Members
  • 26 posts
  • Real Name:Ronda

Posted 10 November 2011 - 03:35 PM

Back again with another fix, sorry.  When I have the Article Manager box enabled in a side column, IE 7+ (checked in both IE 7 and IE 9) refuses to display that column. It appears to be an issue with how the styles are defined in the bm_articles.php file. I moved those styles to stylesheet.css and the problems resolved itself.

The problem code:

 
 
<style type="text/css">
	  .separatorArticle {
	  height: 1px;
	  color: #FF0000;
	  }
	  .separatorBlogArticle {
	  height: 1px;
	  color: #FF0000;
	  }
	  .separatorNewArticle {
	  height: 1px;
	  color: #FF0000;
	  }
	  .separatorTopic {
	  height: 1px;
	  color: #FF0000;
	  }
	  </style>

This bit of code is placed above the head tag in IE, which breaks the page.

#2015   IWAS

IWAS
  • Members
  • 58 posts
  • Real Name:Dave
  • Gender:Male

Posted 13 November 2011 - 04:32 PM

I have both the latest versions of Header Tags SEO and Article Manager.  Great work as always Jack.

Anyway when I try to update the tags for an article in page control  It only updates them to the default pages.  It works fine when I edit products and add them in categories.php.   There doesn't seam to be a way to edit in the article description except for the meta description.

Am I doing something wrong or am I trying to do it from the wrong place?

[img]http://insightwas.com/images/articlespagecontrol.jpg[/img]


Here is a link to the page

http://absolutelysco...outing-a-1.html

Edited by IWAS, 13 November 2011 - 04:33 PM.


#2016   IWAS

IWAS
  • Members
  • 58 posts
  • Real Name:Dave
  • Gender:Male

Posted 13 November 2011 - 04:33 PM

guess the image tags don't work

http://insightwas.com/images/articlespagecontrol.jpg

Edited by IWAS, 13 November 2011 - 04:35 PM.


#2017   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 14 November 2011 - 01:20 AM

View PostIWAS, on 13 November 2011 - 04:32 PM, said:

I have both the latest versions of Header Tags SEO and Article Manager.  Great work as always Jack.

Anyway when I try to update the tags for an article in page control  It only updates them to the default pages.  It works fine when I edit products and add them in categories.php.   There doesn't seam to be a way to edit in the article description except for the meta description.

Am I doing something wrong or am I trying to do it from the wrong place?

[img]http://insightwas.com/images/articlespagecontrol.jpg[/img]


Here is a link to the page

http://absolutelysco...outing-a-1.html
Header Tags is only meant to control the title and tags for articles. For regular text, you use Article Manager section in admin.

#2018   IWAS

IWAS
  • Members
  • 58 posts
  • Real Name:Dave
  • Gender:Male

Posted 14 November 2011 - 04:35 AM

View PostJack_mcs, on 14 November 2011 - 01:20 AM, said:

Header Tags is only meant to control the title and tags for articles. For regular text, you use Article Manager section in admin.
I think that's what I am talking about, it is not updating the header tags for the article.  The screen shot shows that I entered the stuff in the header tags for keywords and title for that article, and the only thing showing up in the articles header tags is default title & default keywords.

Even when I click on the preview checkbox it goes to the default title and default keywords  (also in the screenshot).

When I repull this up from a fresh login, using the dropdown select an option, It still displays it like the screen shot, so it is obviously storing it in the database, but if you view source of the article it is Default title and default keywords default description listed in the meta tags.

http://insightwas.com/images/articlespagecontrol.jpg Screenshot of header tags for the article

http://absolutelyscooterparts.net/catalog/hose-routing-a-1.html   Actual article page

Edited by IWAS, 14 November 2011 - 04:38 AM.


#2019   Jack_mcs

Jack_mcs
  • Members
  • 25,303 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 14 November 2011 - 02:40 PM

View PostIWAS, on 14 November 2011 - 04:35 AM, said:

I think that's what I am talking about, it is not updating the header tags for the article.  The screen shot shows that I entered the stuff in the header tags for keywords and title for that article, and the only thing showing up in the articles header tags is default title & default keywords.

Even when I click on the preview checkbox it goes to the default title and default keywords  (also in the screenshot).

When I repull this up from a fresh login, using the dropdown select an option, It still displays it like the screen shot, so it is obviously storing it in the database, but if you view source of the article it is Default title and default keywords default description listed in the meta tags.

http://insightwas.co...pagecontrol.jpg Screenshot of header tags for the article

http://absolutelysco...outing-a-1.html   Actual article page
The preview button won't work for pseudo pages. The only thing I can think of is that the includes/header_tags.php file is not writeable. When you add a pseudo page a special piece of code is added to that file. If it is not writeable, that code won't get added. You should look in that file for the article info section. Compare it to some other page, like privacy, and you should see a big difference.

#2020   IWAS

IWAS
  • Members
  • 58 posts
  • Real Name:Dave
  • Gender:Male

Posted 15 November 2011 - 02:45 AM

View PostJack_mcs, on 14 November 2011 - 02:40 PM, said:

The preview button won't work for pseudo pages. The only thing I can think of is that the includes/header_tags.php file is not writeable. When you add a pseudo page a special piece of code is added to that file. If it is not writeable, that code won't get added. You should look in that file for the article info section. Compare it to some other page, like privacy, and you should see a big difference.


Permissions for includes/header_tags is 755

Here is the contents.

<?php
/*

// article_info.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_INFO):
    $page = 'article_info.php?articles_id=';
    $parts = explode("?",$page);
    $getStr = substr($parts[1], 0, -1);
    $getID = isset($_GET[$getStr]) ? $_GET[$getStr] : '';
    $parts = explode("=", $parts[1]);
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID)) {
  if (isset($parts[0])) {
   $found = false;
   $name = FILENAME_ARTICLE_INFO . "?" . $parts[0] . "=";
   $pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . $name . "%' and language_id = '" . (int)$languages_id . "'");
    if (tep_db_num_rows($pageTags_query) > 0) {
  while($pageTags = tep_db_fetch_array($pageTags_query)) {
    if ($name . $_GET[$parts[0]] === $pageTags['page_name']) {
   $header_tags_array = tep_header_tag_page($pageTags['page_name']);
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
   $found = true;
   break;
    } } }
    if (! $found) {
   $found = true;
   $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_INFO);
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
   } } else {
    $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_INFO);
    WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
  }  
    $page = 'articles.php?tPath=';
    $parts = explode("?",$page);
    $getStr = substr($parts[1], 0, -1);
    $getID = isset($_GET[$getStr]) ? $_GET[$getStr] : '';
    $parts = explode("=", $parts[1]);
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID)) {
  if (isset($parts[0])) {
   $found = false;
   $name = FILENAME_ARTICLES . "?" . $parts[0] . "=";
   $pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . $name . "%' and language_id = '" . (int)$languages_id . "'");
    if (tep_db_num_rows($pageTags_query) > 0) {
  while($pageTags = tep_db_fetch_array($pageTags_query)) {
    if ($name . $_GET[$parts[0]] === $pageTags['page_name']) {
   $header_tags_array = tep_header_tag_page($pageTags['page_name']);
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
   $found = true;
   break;
    } } }
    if (! $found) {
   $found = true;
   $header_tags_array = tep_header_tag_page(FILENAME_ARTICLES);
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
   } } else {
    $header_tags_array = tep_header_tag_page(FILENAME_ARTICLES);
    WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $getID);
  }  
  http://www.oscommerce.com

  Copyright © 2003 osCommerce
  Portions Copyright 2009 oscommerce-solution.com

  Released under the GNU General Public License
*/

require_once(DIR_WS_FUNCTIONS . 'header_tags.php');
require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Clean out HTML comments from ALT tags etc.

$cache_output = '';
$canonical_url = '';
$header_tags_array = array();
$sortOrder = array();
$tmpTags = array();

$defaultTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS_DEFAULT . " where language_id = '" . (int)$languages_id . "'");
$defaultTags = tep_db_fetch_array($defaultTags_query);
$tmpTags['def_title'] =  (tep_not_null($defaultTags['default_title'])) ? $defaultTags['default_title'] : '';
$tmpTags['def_desc']   =  (tep_not_null($defaultTags['default_description'])) ? $defaultTags['default_description'] : '';
$tmpTags['def_keywords']  =  (tep_not_null($defaultTags['default_keywords'])) ? $defaultTags['default_keywords'] : '';
$tmpTags['def_logo_text'] =  (tep_not_null($defaultTags['default_logo_text'])) ? $defaultTags['default_logo_text'] : '';

// Define specific settings per page:
switch (true) {
  // INDEX.PHP
  case (basename($_SERVER['PHP_SELF']) === FILENAME_DEFAULT):
    $id = ($current_category_id ? 'c_' . (int)$current_category_id : (($_GET['manufacturers_id'] ? 'm_' . (int)$_GET['manufacturers_id'] : '')));

    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $id))
    {
   $pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . FILENAME_DEFAULT . "' and language_id = '" . (int)$languages_id . "'");
   $pageTags = tep_db_fetch_array($pageTags_query);
  
   $catStr = "select categories_htc_title_tag as htc_title_tag, categories_htc_desc_tag as htc_desc_tag, categories_htc_keywords_tag as htc_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "' limit 1";
   $manStr = '';
   if (isset($_GET['manufacturers_id']) && $category_depth == 'top')
$manStr = "select mi.manufacturers_htc_title_tag as htc_title_tag, mi.manufacturers_htc_desc_tag as htc_desc_tag, mi.manufacturers_htc_keywords_tag as htc_keywords_tag from " . TABLE_MANUFACTURERS . " m LEFT JOIN " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "' limit 1";
  
   if ($pageTags['append_root'] || $category_depth == 'top' && ! isset($_GET['manufacturers_id']) )
   {
$sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title'];
$sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description'];
$sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords'];
$sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo'];
$sortOrder['logo_1'][$pageTags['sortorder_root_1']] = $pageTags['page_logo_1'];
$sortOrder['logo_2'][$pageTags['sortorder_root_2']] = $pageTags['page_logo_2'];
$sortOrder['logo_3'][$pageTags['sortorder_root_3']] = $pageTags['page_logo_3'];
$sortOrder['logo_4'][$pageTags['sortorder_root_4']] = $pageTags['page_logo_4'];
   }
  
   $sortOrder = GetCategoryAndManufacturer($sortOrder, $pageTags, $defaultTags, $catStr, $manStr);
  
   if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
   if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
   if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
   if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];
    
   FillHeaderTagsArray($header_tags_array, $sortOrder);  
  
   // Canonical URL add-on
   if (tep_not_null($cPath) || (isset($_GET['manufacturers_id']) && $category_depth == 'top'))
   {
  $args = tep_get_all_get_params(array('action','currency', tep_session_name(),'sort','page'));
  $canonical_url = StripSID(tep_href_link(FILENAME_DEFAULT, $args, 'NONSSL', false) );
   }
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $id);
    }
    break;
    
  // PRODUCT_INFO.PHP
  // PRODUCT_REVIEWS.PHP
  // PRODUCT_REVIEWS_INFO.PHP
  // PRODUCT_REVIEWS_WRITE.PHP
  case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_INFO):
  case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS):
  case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_INFO):
  case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_WRITE):

    switch (true)
    {
case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_INFO):   $filename = FILENAME_PRODUCT_INFO;   break;
case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS):    $filename = FILENAME_PRODUCT_REVIEWS;    break;
case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO;  break;
case (basename($_SERVER['PHP_SELF']) === FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE; break;
default: $filename = FILENAME_PRODUCT_INFO;
    }

    $id = ($_GET['products_id'] ? 'p_' . (int)$_GET['products_id'] : '');

    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $id))
    {
   $pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . $filename . "' and language_id = '" . (int)$languages_id . "'");
   $pageTags = tep_db_fetch_array($pageTags_query);
    
   $the_product_info_query = tep_db_query("select p.products_id, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.manufacturers_id, p.products_model from " . TABLE_PRODUCTS . " p inner join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '" . (int)$_GET['products_id'] . "' and pd.language_id ='" .  (int)$languages_id . "' limit 1");
   $the_product_info = tep_db_fetch_array($the_product_info_query);
   $header_tags_array['product'] = $the_product_info['products_head_title_tag'];  //save for use on the logo
   $tmpTags['prod_title'] = (tep_not_null($the_product_info['products_head_title_tag'])) ? $the_product_info['products_head_title_tag'] : '';
   $tmpTags['prod_desc'] = (tep_not_null($the_product_info['products_head_desc_tag'])) ? $the_product_info['products_head_desc_tag'] : '';
   $tmpTags['prod_keywords'] = (tep_not_null($the_product_info['products_head_keywords_tag'])) ? $the_product_info['products_head_keywords_tag'] : '';
   $tmpTags['prod_model'] = (tep_not_null($the_product_info['products_model'])) ? $the_product_info['products_model'] : '';
  
   $catStr = "select c.categories_htc_title_tag as htc_title_tag, c.categories_htc_desc_tag as htc_desc_tag, c.categories_htc_keywords_tag as htc_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_id = p2c.categories_id and p2c.products_id = '" . (int)$the_product_info['products_id'] . "' and language_id = '" . (int)$languages_id . "'";
   $manStr = "select mi.manufacturers_htc_title_tag as htc_title_tag, mi.manufacturers_htc_desc_tag as htc_desc_tag, mi.manufacturers_htc_keywords_tag as htc_keywords_tag from " . TABLE_MANUFACTURERS . " m LEFT JOIN " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id  where m.manufacturers_id = '" . (int)$the_product_info['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "' LIMIT 1";
  
   if ($pageTags['append_root'])
   {
$sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title'];
$sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description'];
$sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords'];
$sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo'];
$sortOrder['logo_1'][$pageTags['sortorder_root_1']] = $pageTags['page_logo_1'];
$sortOrder['logo_2'][$pageTags['sortorder_root_2']] = $pageTags['page_logo_2'];
$sortOrder['logo_3'][$pageTags['sortorder_root_3']] = $pageTags['page_logo_3'];
$sortOrder['logo_4'][$pageTags['sortorder_root_4']] = $pageTags['page_logo_4'];   
   }

   if ($pageTags['append_product'])
   {    
$sortOrder['title'][$pageTags['sortorder_product']] = $tmpTags['prod_title'];  //places the product title at the end of the list
$sortOrder['description'][$pageTags['sortorder_product']] = $tmpTags['prod_desc'];
$sortOrder['keywords'][$pageTags['sortorder_product']] = $tmpTags['prod_keywords'];
$sortOrder['logo'][$pageTags['sortorder_product']] = $tmpTags['prod_title'];
   }
  
   if ($pageTags['append_model'])
   {    
$sortOrder['title'][$pageTags['sortorder_model']] = $tmpTags['prod_model'];  //places the product title at the end of the list
$sortOrder['description'][$pageTags['sortorder_model']] = $tmpTags['prod_model'];
$sortOrder['keywords'][$pageTags['sortorder_model']] = $tmpTags['prod_model'];
$sortOrder['logo'][$pageTags['sortorder_model']] = $tmpTags['prod_model'];
   }
  
   $sortOrder = GetCategoryAndManufacturer($sortOrder, $pageTags, $defaultTags, $catStr, $manStr, true);
  
   if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
   if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
   if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
   if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];
    
   FillHeaderTagsArray($header_tags_array, $sortOrder);  
  
   // Canonical URL add-on
   if ($_GET['products_id'] != '') {
   $canonical_url = StripSID(tep_href_link(basename($_SERVER['PHP_SELF']), 'products_id='.(int)$_GET['products_id']));
   }    
  
   WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, $id);
    }
    break;
    
  // SPECIALS.PHP
  case (basename($_SERVER['PHP_SELF']) === FILENAME_SPECIALS):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, ''))
    {
   $pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . FILENAME_SPECIALS . "' and language_id = '" . (int)$languages_id . "'");
   $pageTags = tep_db_fetch_array($pageTags_query);  
  
   // Build a list of ALL specials product names to put in keywords
   $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC ");
   $row = 0;
   $the_specials='';
   while ($new_values = tep_db_fetch_array($new)) {
$the_specials .= clean_html_comments($new_values['products_name']) . ', ';
   }
  
   if (strlen($the_specials) > 30000)   //arbitrary number - may vary with server setting
    $the_specials = substr($the_specials, 0, 30000);   //adjust as needed
    
   if ($pageTags['append_root'])
   {
$sortOrder['title'][$pageTags['sortorder_root']] = $pageTags['page_title'];
$sortOrder['description'][$pageTags['sortorder_root']] = $pageTags['page_description'];
$sortOrder['keywords'][$pageTags['sortorder_root']] = $pageTags['page_keywords'];
$sortOrder['logo'][$pageTags['sortorder_root']] = $pageTags['page_logo'];
$sortOrder['logo_1'][$pageTags['sortorder_root']] = $pageTags['page_logo_1'];
$sortOrder['logo_2'][$pageTags['sortorder_root']] = $pageTags['page_logo_2'];
$sortOrder['logo_3'][$pageTags['sortorder_root']] = $pageTags['page_logo_3'];
$sortOrder['logo_4'][$pageTags['sortorder_root']] = $pageTags['page_logo_4'];   
   }
    
   $sortOrder['keywords'][10] = $the_specials;;
  
   if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
   if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
   if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
   if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];
  
   FillHeaderTagsArray($header_tags_array, $sortOrder);  
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// article-topics.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_TOPICS):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_TOPICS);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// article_blog.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_BLOG):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_BLOG);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// articles_new.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLES_NEW):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLES_NEW);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// article_reviews.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_REVIEWS):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_REVIEWS);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// article_reviews_write.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_REVIEWS_WRITE):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_REVIEWS_WRITE);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// article_reviews_info.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLE_REVIEWS_INFO):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLE_REVIEWS_INFO);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// articles.php
  case (basename($_SERVER['PHP_SELF']) === FILENAME_ARTICLES):
    if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '')) {
  $header_tags_array = tep_header_tag_page(FILENAME_ARTICLES);
  WriteCacheHeaderTags($header_tags_array, basename($_SERVER['PHP_SELF']), $language, '');
    }
  break;

// ALL OTHER PAGES NOT DEFINED ABOVE
  default:
    $header_tags_array['title'] = tep_db_prepare_input($defaultTags['default_title']);
    $header_tags_array['desc'] = tep_db_prepare_input($defaultTags['default_description']);
    $header_tags_array['keywords'] = tep_db_prepare_input($defaultTags['default_keywords']);
    break;
  }    

echo ' <meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET  . '" >'."\n";
echo ' <title>' . $header_tags_array['title'] . '</title>' . "\n";
echo ' <meta name="Description" content="' . $header_tags_array['desc'] . '" >' . "\n";
echo ' <meta name="Keywords" content="' . $header_tags_array['keywords'] . '" >' . "\n";

if ($defaultTags['meta_language']) { $langName = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); echo ' <meta http-equiv="Content-Language" content="' . $langName[0] . '" >'."\n"; }
if ($defaultTags['meta_google'])    echo ' <meta name="googlebot" content="all" >' . "\n";
if ($defaultTags['meta_noodp']) echo ' <meta name="robots" content="noodp" >' . "\n";
if ($defaultTags['meta_noydir'])    echo ' <meta name="slurp" content="noydir" >' . "\n";
if ($defaultTags['meta_revisit'])   echo ' <meta name="revisit-after" content="1 days" >' . "\n";
if ($defaultTags['meta_robots'])    echo ' <meta name="robots" content="index, follow" >' . "\n";
if ($defaultTags['meta_unspam'])    echo ' <meta name="no-email-collection" value="' . HTTP_SERVER . '" >' . "\n";
if ($defaultTags['meta_replyto'])   echo ' <meta name="Reply-to" content="' . STORE_OWNER_EMAIL_ADDRESS . '">' . "\n";
if ($defaultTags['meta_canonical']) echo (tep_not_null($canonical_url) ? ' <link rel="canonical" href="'.$canonical_url.'" >'. "\n" : ' <link rel="canonical" href="'.GetCanonicalURL().'" >'. "\n");

echo '<!-- EOF: Header Tags SEO Generated Meta Tags -->' . "\n";
?>