Guest Posted February 12, 2009 Share Posted February 12, 2009 I have the old version of header tags installed. It was all running fine until I tried to make a change today. I accidentally deleted index.php (header control) and when I added it back in I got this error: Parse error: syntax error, unexpected T_CASE in /xxxx/xxxxx/xxxxx/includes/header_tags.php on line 113 Now, no matter what I add I get the error. There is a test at the bottom header_tags.php that is causing the problem. I had to comment it out because it was bringing the whole site down. Now the filler tags on the products quit working as well. I'm very baffled, as I have not made any changes, database or otherwise. I did try to find this in the support thread but was unable to find a resolution, as it is quite large. Here's the code, look towards the bottom. It's the last case logic. <?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; // Help.php case (strstr($_SERVER['PHP_SELF'],FILENAME_HELP) or strstr($PHP_SELF, FILENAME_HELP)); $tags_array = tep_header_tag_page(HTTA_HELP_ON, HEAD_TITLE_TAG_HELP, HTDA_HELP_ON, HEAD_DESC_TAG_HELP, HTKA_HELP_ON, HEAD_KEY_TAG_HELP ); break; // Help1.php case (strstr($_SERVER['PHP_SELF'],FILENAME_HELP1) or strstr($PHP_SELF, FILENAME_HELP1)); $tags_array = tep_header_tag_page(HTTA_HELP1_ON, HEAD_TITLE_TAG_HELP1, HTDA_HELP1_ON, HEAD_DESC_TAG_HELP1, HTKA_HELP1_ON, HEAD_KEY_TAG_HELP1 ); break; // Help2.php case (strstr($_SERVER['PHP_SELF'],FILENAME_HELP2) or strstr($PHP_SELF, FILENAME_HELP2)); $tags_array = tep_header_tag_page(HTTA_HELP2_ON, HEAD_TITLE_TAG_HELP2, HTDA_HELP2_ON, HEAD_DESC_TAG_HELP2, HTKA_HELP2_ON, HEAD_KEY_TAG_HELP2 ); 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"; // index.php /* case (strstr($_SERVER['PHP_SELF'],FILENAME_INDEX) or strstr($PHP_SELF, FILENAME_INDEX)); $tags_array = tep_header_tag_page(HTTA_INDEX_ON, HEAD_TITLE_TAG_INDEX, HTDA_INDEX_ON, HEAD_DESC_TAG_INDEX, HTKA_INDEX_ON, HEAD_KEY_TAG_INDEX ); break; */ ?> If anyone has any clue what might be causing this, it would be much appreciated. I'm having another problem with the shopping carts (in another post). Makes me wonder if the host is doing something. I'm running osCommerce 2.2MS2 I'm running PHP 5.2.6 I'm running MySQL 5.0.67-community This is the original source. I don't have copies because that PC bit the dust before I took a backup of it. This is my site if you want to look at it The headers are hard coded in index.php until this gets resolved. Thanks in advance. Sorry in advance for my hideous site. It's very functional, but doen't look for much. That will be addressed in the upgrade. Link to comment Share on other sites More sharing options...
germ Posted February 12, 2009 Share Posted February 12, 2009 // 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; } [color="#FF0000"][b]<-- this is the end of the "switch"[/b][/color] Your "case" is out of the context of the "switch" statement... :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Guest Posted February 13, 2009 Share Posted February 13, 2009 // 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; } [color="#FF0000"][b]<-- this is the end of the "switch"[/b][/color] Your "case" is out of the context of the "switch" statement... :blush: Thanks. You're right, as usual. I moved it up and the fatal error went away. However, the tags aren't working. They are in the database but not being displayed. I'll dig around a bit and see what happens. I'm still baffled how this happened, but oh well. Thanks again, germ. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.