ExtraB Posted December 9, 2004 Share Posted December 9, 2004 If header_tags.php is already included by application_top.php a second require would cause error messages. As far as I know this is always circumvented by using include_once or require_once when calling code that might already have been included... require_once(DIR_WS_FUNCTIONS . 'header_tags.php'); <{POST_SNAPBACK}> How do I check if header_tags.php is already included by application_top.php ? Is this what my problem is? In my application_top.php include file I have the following code at the very bottom of the file... // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 ?> Should I change this section of code to // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 ?> In my product_reviews.php file I have the following code <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v1.0 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> Should I do the same with this product_reviews.php file and use <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v1.0 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require_once(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> If so then there must be some other problem because I just tried using the require_once in the product_reviews.php file as shown above and got the following error still Fatal error: Call to undefined function: tep_get_header_tag_products_desc() in /home/htdocs/users/ebonni34/ebonni34/bonafideauthentics.com/catalog/includes/header_tags.php on line 168 Please help I am losing my mind and going cross eyed at the same time... B) Eric B Quote AJ2000 Link to comment Share on other sites More sharing options...
ExtraB Posted December 9, 2004 Share Posted December 9, 2004 How do I check if header_tags.php is already included by application_top.php ? Is this what my problem is? In my application_top.php include file I have the following code at the very bottom of the file... // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 ? ?> Should I change this section of code to // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 ? ?> In my product_reviews.php file I have the following code <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v1.0 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { ?require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> ?<title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> Should I do the same with this product_reviews.php file and use <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v1.0 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { ?require_once(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> ?<title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> If so then there must be some other problem because I just tried using the require_once in the product_reviews.php file as shown above and got the following error still Fatal error: Call to undefined function: tep_get_header_tag_products_desc() in /home/htdocs/users/ebonni34/ebonni34/bonafideauthentics.com/catalog/includes/header_tags.php on line 168 Please help I am losing my mind and going cross eyed at the same time... B) Eric B <{POST_SNAPBACK}> IT WORKS NOW!!!! Here is what I did... I just did as JanZ suggested.... I changed the code in application_top.php to // BOF: WebMakers.com Added: Header Tags Controller v1.0 // note the following line was changed from require to require_once // thats because for some reason the product_reviews.php file was not working // a forum member, JanZ, said it was because, If header_tags.php is already included // by application_top.php a second require would cause error messages require_once(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 Thanks JanZ :thumbsup: Sincerely, Eric B Quote AJ2000 Link to comment Share on other sites More sharing options...
mes Posted December 10, 2004 Share Posted December 10, 2004 I'm having a problem with header tags. it works on the admin side but when i add the lines to application_top.php i get the red error message Fatal error: Failed opening required 'includes/functions/header_tags.php' (include_path='.:/usr/share/pear') in /home/food/public_html/catalog/includes/application_top.php on line 59 when i remove the lines the site works. i am using sts templates but with the displayoutput contrib it should work.. thanks guys.. mes Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted December 10, 2004 Share Posted December 10, 2004 Mes, Two things: 1. Make sure the file includes/header_tags.php is there and has the correct permissions to be read by the webserver. 2. Either change the line 59 (something like: "require(DIRWS_FUNCTIONS. header_tags.php)" from the top of my head) to "include_once(etc.)" or comment it out. There might very well be no need for the include of that file in application_top.php (I don't have it and the site works fine, though I use HTC only for the products_info.php pages). See what works best for you. Quote Link to comment Share on other sites More sharing options...
mes Posted December 10, 2004 Share Posted December 10, 2004 Thanks janz your right didnt need the include. cheers. Quote Link to comment Share on other sites More sharing options...
dsatchell Posted December 11, 2004 Share Posted December 11, 2004 How does this contribuition fit in with the various search engine optimization contributions? I'm putting together two stores over the next couple of weeks and I will be using this contrib (already have in one) but I also want to make sure that search engines will be able to spider everything in the stores also. What is the best route to take? One will be a computer store and the other will be jewelry store. Thanx, Dave. Quote Link to comment Share on other sites More sharing options...
sicanada Posted December 15, 2004 Share Posted December 15, 2004 Hello; I would like to add in the product_info.php the Product Model and Product Name and Description. How can this be done. I have tried to use this contrb. but all what happens is I get the default that is specified in /english/header_tag.php? Any suggestions? Quote Link to comment Share on other sites More sharing options...
ExtraB Posted December 15, 2004 Share Posted December 15, 2004 Hello; I would like to add in the product_info.php the Product Model and Product Name and Description. How can this be done. I have tried to use this contrb. but all what happens is I get the default that is specified in /english/header_tag.php? Any suggestions? <{POST_SNAPBACK}> After you have this contribution installed, you have to login to your admin area... go to your product catalog... and click on each product.. then update the listing... you will see three new form fields for you to add the product description, keywords, and title for the header area of the product_info.php page that comes up for each of your products. Eric B Quote AJ2000 Link to comment Share on other sites More sharing options...
DriWashSolutions Posted December 22, 2004 Share Posted December 22, 2004 I have the Header Tags Controller contrib installed, but for some reason, it has stopped working. All of my pages now have the pathname as the title of the page. Viewing source shows that there are no META tags in the file. Can anyone point me in the right direction? Quote John Skurka Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 22, 2004 Share Posted December 22, 2004 Just totally guessing here since there is no link to go on but have you looked at the actual catalog files to see if the code is still in there? Jack Quote 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 More sharing options...
DriWashSolutions Posted December 22, 2004 Share Posted December 22, 2004 Just totally guessing here since there is no link to go on but have you looked at the actual catalog files to see if the code is still in there? I'm looking at it right now - I see the webmakers code in the catalog/index.php file. One thing I forgot to mention is that my shop is modified pretty good, at I'm also running SimpleTemplateSystem, with which Headertags is supposed to work well with. The URL: DriWash Solutions Thanks Jack Quote John Skurka Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 22, 2004 Share Posted December 22, 2004 It has been a while since I played around with STS but when I view your source I notice it is missing standard things like doc type, title and meta tags. I doubt that STS sites normally look like that but I could be wrong. I'm thinking something has gotten deleted at some point since you should at least see the doc type and none of the contributions mess with that. I just looked at the STS template and it has this <!--$headcontent--> at the begining. Without that statement, the code would look just like it is on your site. So you need to verify that is present in your STS template file. If it appears OK, then replace your template file with the original (be sure to make a backup of yours) and see if the doc type appears. Jack Quote 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 More sharing options...
DriWashSolutions Posted December 22, 2004 Share Posted December 22, 2004 I just looked at the STS template and it has this <!--$headcontent--> at the begining. Without that statement, the code would look just like it is on your site. Jack - YOU ARE THE MAN! It WAS missing, and now everything looks to be working! I'm sure this happened when I FTP'd the template file to another machine, made some mods, the FTP'd it back. That little comment tag got lost. Thanks again for the quick turn around! Quote John Skurka Link to comment Share on other sites More sharing options...
amorella Posted December 24, 2004 Share Posted December 24, 2004 Hi, I have searched for help on this & could only find a posting by bloom which was similar, but didn't offer a solution... righty, I have been a really good boy & tried my damndist to get this sorted on my own, but now I must ask for help, please make my Christmas & answer this little stinker... I get this on the New Product page, where the meta tage boxes should be: Fatal error: Call to undefined function: tep_get_products_head_title_tag() in /home/.sites/84/site107/web/admin/categories.php on line 803 I've been through the documentation & can't work it out, my php is minimal (but improving!), the offending code is... <?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_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']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> What have a failed to do? I followed the instructions to the T... I have also just installed the catagory description contrib, which works like a charm. But could that be interfering? Many thanks guys, Nick, Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2004 Share Posted December 24, 2004 Nick - that error is telling you the function cannot be found. Usually this means it was not added when you installed the contribution. Try opening admin/includes/functions/general.php and searching for tep_get_products_head_title_tag Is it there? Jack Quote 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 More sharing options...
amorella Posted December 24, 2004 Share Posted December 24, 2004 (edited) Nick - that error is telling you the function cannot be found. Usually this means it was not added when you installed the contribution. Try opening admin/includes/functions/general.php and searching for tep_get_products_head_title_tag Is it there? Jack <{POST_SNAPBACK}> Thanks for the quick reply, but yes I should have said, that was what I thought the problem could have been & found it in general.php, the code looks like this: function tep_get_products_url($product_id, $language_id) { $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); --> function tep_get_products_head_title_tag($product_id, $language_id) { $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_head_title_tag']; } The arrow isn't actually in the code, that would be a simple mistake!! Does this mean the problem is going to be complex? Eek! Fingers x'ed, together we'll do this thing! Many thanks, Nick, Edited December 24, 2004 by amorella Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2004 Share Posted December 24, 2004 When you added the code, you added inside another function. It should look something like this: function tep_get_products_url($product_id, $language_id) { $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); } function tep_get_products_head_title_tag($product_id, $language_id) { $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_head_title_tag']; } Jack Quote 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 More sharing options...
amorella Posted December 24, 2004 Share Posted December 24, 2004 Jack, thanks ever so much, those little {}'s are really catching me out! After I fixed it I got a parsing error, but I sorted that, but now... The product name field has disappeared & I've now got 2 product description fields, one at top & one at bottom of the 3 meta tag fields. I have not modified that part of general.php, it's identical to the vanilla install, but just incase: function tep_get_products_name($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_name']; } function tep_get_products_description($product_id, $language_id) { $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_description']; } function tep_get_products_url($product_id, $language_id) { $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_url']; } function tep_get_products_head_title_tag($product_id, $language_id) { $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_head_title_tag']; } function tep_get_products_head_desc_tag($product_id, $language_id) { $product_query = tep_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_head_desc_tag']; } function tep_get_products_head_keywords_tag($product_id, $language_id) { $product_query = tep_db_query("select products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_head_keywords_tag']; } Where else could I look to find the solution? I really feel this is in my grasp for completion! Then my site will be virtually finished (!!). Anyway, it's 5am, so I better get some sleep & come straight back to this first thing tommorow. Many thanks & merry Chirstmas, Nick, Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2004 Share Posted December 24, 2004 It doesn't do any good to post partial code. The problem could be the one line above the code you post. Jack Quote 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 More sharing options...
amorella Posted December 24, 2004 Share Posted December 24, 2004 Sorry my friend, I didn't want to clutter the forum & thought that'd be what was needed, so I've upped a txt file of it here: general.txt That way it doesn't clog up the forum with hundreds of lines of code. Your help is really appreciated Jack! Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2004 Share Posted December 24, 2004 That file looks good to me so that only leaves the admin/categories.php file assuming it is a problem with the installed HTC. Try comparing your categories.php to the one in the contribution or even temporairly replacing yours with the original to see if the fields return. Jack Quote 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 More sharing options...
amorella Posted December 24, 2004 Share Posted December 24, 2004 It was the catagories.php which was the problem, cheers! Quote Link to comment Share on other sites More sharing options...
hoff10000 Posted January 6, 2005 Share Posted January 6, 2005 (edited) When I include the header tag controller functions in my application_top.php file: // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 My site breaks (the browser show nothing but a blank page). I installed both files in my includes/functions directory. What could be the cause of this? Edited January 6, 2005 by hoff10000 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted January 6, 2005 Share Posted January 6, 2005 Are you adding the code near the top or the bottom of application_top.php? Jack Quote 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 More sharing options...
sugaree Posted January 16, 2005 Share Posted January 16, 2005 I am using STS and HTC on a couple of sites and I just noticed today that something may be wrong with one of the sites. I ran a spider simulator on both sites and one site returns all the information seen by the simulator., eg. Title, Description, Keywords. My other site shows the Title but the Description and Keywords show this , "text/html; charset=".. Now when I go to view source in Internet Explorer, the Description and Keywords are in the source. Could it be the spider simulator or is it something else I need to fix? Any suggestions much appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.