Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What the....?! - header tags


Guest

Recommended Posts

Don't even know what to say...Don't know what I've done... See for yourself what appears on top of my site...And if you can, please please help!

 

www.muccelmic.com

 

/* /catalog/includes/header_tags.php WebMakers.com Added: Header Tags Generator v2.0 Add META TAGS and Modify TITLE NOTE: Globally replace all fields in products table with current product name just to get things started: In phpMyAdmin use: UPDATE products_description set PRODUCTS_HEAD_TITLE_TAG = PRODUCTS_NAME Shoppe Enhancement Controller - Copyright © 2003 WebMakers.com Linda McGrath - [email protected] */ require(DIR_WS_LANGUAGES . $language . '/' . 'header_tags.php'); $tags_array = array(); // Define specific settings per page: switch (true) { // ALLPRODS.PHP case (strstr($_SERVER['PHP_SELF'],FILENAME_ALLPRODS) or strstr($PHP_SELF,FILENAME_ALLPRODS) ): $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_ALLPRODS_ON=='1') { $tags_array['desc']= HEAD_DESC_TAG_ALLPRODS . ' ' . HEAD_DESC_TAG_ALL; } else { $tags_array['desc']= HEAD_DESC_TAG_ALLPRODS; } if (HTKA_ALLPRODS_ON=='1') { $tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_ALLPRODS; } else { $tags_array['keywords']= HEAD_KEY_TAG_ALLPRODS; } if (HTTA_ALLPRODS_ON=='1') { $tags_array['title']= HEAD_TITLE_TAG_ALLPRODS . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name']; } else { $tags_array['title']= HEAD_TITLE_TAG_ALLPRODS; } break; // products_all.PHP case (strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCTS_ALL) or strstr($PHP_SELF,FILENAME_PRODUCTS_ALL) ): $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_PRODUCTS_ALL_ON=='1') { $tags_array['desc']= HEAD_DESC_TAG_PRODUCTS_ALL . ' ' . HEAD_DESC_TAG_ALL; } else { $tags_array['desc']= HEAD_DESC_TAG_PRODUCTS_ALL; } if (HTKA_PRODUCTS_ALL_ON=='1') { $tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_PRODUCTS_ALL; } else { $tags_array['keywords']= HEAD_KEY_TAG_PRODUCTS_ALL; } if (HTTA_ALLPRODS_ON=='1') { $tags_array['title']= HEAD_TITLE_TAG_PRODUCTS_ALL . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name']; } else { $tags_array['title']= HEAD_TITLE_TAG_PRODUCTS_ALL; } break; // .php case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_)); $tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_, HTDA__ON, HEAD_DESC_TAG_, HTKA__ON, HEAD_KEY_TAG_ ); break; // .php case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_)); $tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_, HTDA__ON, HEAD_DESC_TAG_, HTKA__ON, HEAD_KEY_TAG_ ); break; // .php case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_)); $tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_, HTDA__ON, HEAD_DESC_TAG_, HTKA__ON, HEAD_KEY_TAG_ ); break; // ALL OTHER PAGES NOT DEFINED ABOVE default: $tags_array['desc'] = HEAD_DESC_TAG_ALL; $tags_array['keywords'] = HEAD_KEY_TAG_ALL; $tags_array['title'] = HEAD_TITLE_TAG_ALL; break; } echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' '."\n"; echo ' ' . "\n"; echo '' . "\n"; // .php case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_)); $tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_, HTDA__ON, HEAD_DESC_TAG_, HTKA__ON, HEAD_KEY_TAG_ ); break; ?>

Link to comment
Share on other sites

You don't know what you've done?

 

I supposed that also means you didn't make a backup before you done it?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Well, I have a backup, from before installing header tags controller, I could replace the files I've modified, but I'm not sure on how to go about the db sql file. Should I go to phpMyadmin and then what?. Replace the db with the backuped sql file and that's it? Because I don't know if that removes the sql file for header tags....Is this the only solution?

Link to comment
Share on other sites

What version of Header Tags are you using? That problem was known but I thought I fixed it in the last version. In any event, the problem is that, most likely, your includes/header_tags file is missing a beginning <?php. You can either add that or replace the file. If that doesn't fix it, try the same for the english/header_tags.php file. It's one or the other.

 

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's v 2.4.6. This error didn't appear from start, but later and I don't exactly know the moment. Thanks, that is fixed, but I get another error:

 

<?php

/*

/catalog/includes/header_tags.php

WebMakers.com Added: Header Tags Generator v2.0

Add META TAGS and Modify TITLE

 

NOTE: Globally replace all fields in products table with current product name just to get things started:

In phpMyAdmin use: UPDATE products_description set PRODUCTS_HEAD_TITLE_TAG = PRODUCTS_NAME

 

Shoppe Enhancement Controller - Copyright © 2003 WebMakers.com

Linda McGrath - [email protected]

*/

 

 

require(DIR_WS_LANGUAGES . $language . '/' . 'header_tags.php');

 

$tags_array = array();

 

// Define specific settings per page:

switch (true) {

// ALLPRODS.PHP

case (strstr($_SERVER['PHP_SELF'],FILENAME_ALLPRODS) or strstr($PHP_SELF,FILENAME_ALLPRODS) ):

$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_ALLPRODS_ON=='1') {

$tags_array['desc']= HEAD_DESC_TAG_ALLPRODS . ' ' . HEAD_DESC_TAG_ALL;

} else {

$tags_array['desc']= HEAD_DESC_TAG_ALLPRODS;

}

 

if (HTKA_ALLPRODS_ON=='1') {

$tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_ALLPRODS;

} else {

$tags_array['keywords']= HEAD_KEY_TAG_ALLPRODS;

}

 

if (HTTA_ALLPRODS_ON=='1') {

$tags_array['title']= HEAD_TITLE_TAG_ALLPRODS . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'];

} else {

$tags_array['title']= HEAD_TITLE_TAG_ALLPRODS;

}

break;

 

// products_all.PHP

case (strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCTS_ALL) or strstr($PHP_SELF,FILENAME_PRODUCTS_ALL) ):

$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_PRODUCTS_ALL_ON=='1') {

$tags_array['desc']= HEAD_DESC_TAG_PRODUCTS_ALL . ' ' . HEAD_DESC_TAG_ALL;

} else {

$tags_array['desc']= HEAD_DESC_TAG_PRODUCTS_ALL;

}

 

if (HTKA_PRODUCTS_ALL_ON=='1') {

$tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_PRODUCTS_ALL;

} else {

$tags_array['keywords']= HEAD_KEY_TAG_PRODUCTS_ALL;

}

 

if (HTTA_ALLPRODS_ON=='1') {

$tags_array['title']= HEAD_TITLE_TAG_PRODUCTS_ALL . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'];

} else {

$tags_array['title']= HEAD_TITLE_TAG_PRODUCTS_ALL;

}

break;

 

// .php

case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_));

$tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_,

HTDA__ON, HEAD_DESC_TAG_,

HTKA__ON, HEAD_KEY_TAG_ );

break;

 

// .php

case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_));

$tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_,

HTDA__ON, HEAD_DESC_TAG_,

HTKA__ON, HEAD_KEY_TAG_ );

break;

 

// .php

case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_));

$tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_,

HTDA__ON, HEAD_DESC_TAG_,

HTKA__ON, HEAD_KEY_TAG_ );

break;

 

// ALL OTHER PAGES NOT DEFINED ABOVE

default:

$tags_array['desc'] = HEAD_DESC_TAG_ALL;

$tags_array['keywords'] = HEAD_KEY_TAG_ALL;

$tags_array['title'] = HEAD_TITLE_TAG_ALL;

break;

}

 

echo ' <title>' . $tags_array['title'] . '</title>' . "\n";

echo ' <META NAME="Description" Content="' . $tags_array['desc'] . '">' . "\n";

echo ' <META NAME="Keywords" CONTENT="' . $tags_array['keywords'] . '">' . "\n";

echo ' <meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">'."\n";

echo ' <META NAME="Reply-to" CONTENT="' . HEAD_REPLY_TAG_ALL . '">' . "\n";

 

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

 

// .php

case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_));

$tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_,

HTDA__ON, HEAD_DESC_TAG_,

HTKA__ON, HEAD_KEY_TAG_ );

break;

 

// CONTACT_US.php

case (strstr($_SERVER['PHP_SELF'],FILENAME_CONTACT_US) or strstr($PHP_SELF, FILENAME_CONTACT_US));

$tags_array = tep_header_tag_page(HTTA_CONTACT_US_ON, HEAD_TITLE_TAG_CONTACT_US,

HTDA_CONTACT_US_ON, HEAD_DESC_TAG_CONTACT_US,

HTKA_CONTACT_US_ON, HEAD_KEY_TAG_CONTACT_US );

break;

?>

 

 

It seems so complicated to me...I don't even understand yet how header tags works...Is it complicated or it's just me?:)

Link to comment
Share on other sites

This code is invalid. It doesn't contain a filename.

// .php
case (strstr($_SERVER['PHP_SELF'],FILENAME_) or strstr($PHP_SELF, FILENAME_));
$tags_array = tep_header_tag_page(HTTA__ON, HEAD_TITLE_TAG_, 
HTDA__ON, HEAD_DESC_TAG_, 
HTKA__ON, HEAD_KEY_TAG_ );
break;

 

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

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