madmanbean Posted June 27, 2006 Posted June 27, 2006 ust added some specials to the site www.littleplumber.com and when you try to call us the specials.php page I get the following error. "Fatal error: Call to undefined function: clean_html_comments() in /home/splendid/public_html/includes/header_tags.php on line 141" Do not know where to start in solving this one! All ideas and suggestions appreciated
Guest Posted June 27, 2006 Posted June 27, 2006 open your catalog\includes\application_top.php file Locate this code: // ALSO, if you DO NOT have Header Tags Installed, add the following (else don't!) // add only if Header Tags not already installed require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); Read it, then replace it with this: // ALSO, if you DO NOT have Header Tags Installed, add the following (else don't!) // add only if Header Tags not already installed // require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');
madmanbean Posted June 27, 2006 Author Posted June 27, 2006 Dear Mark Thanks for your reply.. cannot find the code you mention and am a little perplexed as both the boxes in your posting show the same code!! Am I being stupid (probably) or did you paste the new text twice??
Guest Posted June 27, 2006 Posted June 27, 2006 No the code I posted is fine and there is a difference. Perhaps you missed the function from the contribution. Check your catalog\includes\functions\clean_html_comments.php You should have that file. If not check the contribution install instructions.
madmanbean Posted June 27, 2006 Author Posted June 27, 2006 this is very frustrating!! I cannot find that piece of code in that file!! in fact there is no reference to clean_html_comments.php at all I do have clean_html_comments.php installed though.. Have looked at your two boxes again in your first message and they are the same code!! Hope I am not missing something obvious!! Thanks for your help No the code I posted is fine and there is a difference. Perhaps you missed the function from the contribution. Check your catalog\includes\functions\clean_html_comments.php You should have that file. If not check the contribution install instructions.
Guest Posted June 28, 2006 Posted June 28, 2006 this is very frustrating!!I cannot find that piece of code in that file!! in fact there is no reference to clean_html_comments.php at all I do have clean_html_comments.php installed though.. Have looked at your two boxes again in your first message and they are the same code!! Hope I am not missing something obvious!! Thanks for your help You should have that file where I mentioned. Within it has this code: <?php //// // Clean out HTML comments code function clean_html_comments($clean_html) { global $its_cleaned; if ( strpos($clean_html,'<!--//*')>1 ) { $the_end1= strpos($clean_html,'<!--//*')-1; $the_start2= strpos($clean_html,'*//-->')+7; $its_cleaned= substr($clean_html,0,$the_end1); $its_cleaned.= substr($clean_html,$the_start2); } else { $its_cleaned= $clean_html; } return $its_cleaned; } ?> Have looked at your two boxes again in your first message and they are the same code!! They are different but doesn't matter since you do not have it.
madmanbean Posted June 28, 2006 Author Posted June 28, 2006 Ok I have found that.. this is the code that I have and it seems to be the same as yours!! Really appreciate you trying to help me but can you tell me why this error is occuring?? (not to mentiona solution!! Will certainly reciprocate with a few links if I can!! //// // Clean out HTML comments code function clean_html_comments($clean_html) { global $its_cleaned; if ( strpos($clean_html,'<!--//*')>1 ) { $the_end1= strpos($clean_html,'<!--//*')-1; $the_start2= strpos($clean_html,'*//-->')+7; $its_cleaned= substr($clean_html,0,$the_end1); $its_cleaned.= substr($clean_html,$the_start2); } else { $its_cleaned= $clean_html; } return $its_cleaned; } ?> You should have that file where I mentioned. Within it has this code: <?php //// // Clean out HTML comments code function clean_html_comments($clean_html) { global $its_cleaned; if ( strpos($clean_html,'<!--//*')>1 ) { $the_end1= strpos($clean_html,'<!--//*')-1; $the_start2= strpos($clean_html,'*//-->')+7; $its_cleaned= substr($clean_html,0,$the_end1); $its_cleaned.= substr($clean_html,$the_start2); } else { $its_cleaned= $clean_html; } return $its_cleaned; } ?> They are different but doesn't matter since you do not have it.
Guest Posted June 28, 2006 Posted June 28, 2006 yes but is it at the right spot? And is it included with your code? So check where the file is (should be in catalog\includes\functions) and then also check where it is included. Must be in includes\application_top.php or includes\functions\general.php
madmanbean Posted June 28, 2006 Author Posted June 28, 2006 Now you have really lost me!! I feel so stupid! The file is located in catalog\includes\functions but do not understand what you mean by the next bit.."is it included in your code?" I can locate both the files you mention in their respective locations but am not sure what it is that is missing! yes but is it at the right spot? And is it included with your code? So check where the file is (should be in catalog\includes\functions) and then also check where it is included. Must be in includes\application_top.php or includes\functions\general.php
Guest Posted June 29, 2006 Posted June 29, 2006 if you have a search tool, (even explorer will do) search the php files for the following string clean_html_comments.php probably you will not find it. Following the instructions should be: Add to /catalog/includes/application_top.php at the end of the file right before the last ?> // BOF: WebMakers.com Added: Header Tags Controller v2.5.7 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // EOF: WebMakers.com Added: Header Tags Controller v2.5.7
madmanbean Posted June 29, 2006 Author Posted June 29, 2006 Well I added the code you say at the end of application_top.php and the whole site stops working!! the message is Fatal error: Cannot redeclare clean_html_comments() (previously declared in /home/splendid/public_html/includes/functions/clean_html_comments.php:13) in /home/splendid/public_html/includes/functions/clean_html_comments.php on line 13 even more confused now!!!
Guest Posted June 29, 2006 Posted June 29, 2006 didn't I mentioned to search first if the file is included in one of the php files in your store? Did you search for it?
madmanbean Posted June 29, 2006 Author Posted June 29, 2006 Sorry about that..please bear with me here.. ok have searched site and have two entries one in file includes/functions/clean_html_comments.php the entry states <?php // /catalog/includes/functions/clean_html_comments.php // WebMakers.com Added: Header Tags Generator v2.0 // WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC. v3.0 // // BE CAREFUL NOT to use this function where it will effect currencies.php or the listings for product name // This is used for cosmetic purposes for what the visitor sees and not for what the php code sees. The php code needs to see the HTML comment tags. // // Removes the <!--//* and *//--> from Product Names the other is includes/sts_display_output.php and the entry about of a third down the page says // STS: ADD: Support for WebMakers.com's Header Tag Controller contribution // Capture the output require(STS_START_CAPTURE); // 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_FUNCTIONS . 'clean_html_comments.php'); require(DIR_WS_FUNCTIONS . 'header_tags.php'); require(DIR_WS_INCLUDES . 'header_tags.php'); } else { echo "<title>" . TITLE . "</title>"; } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 $sts_block_name = 'headertags'; require(STS_STOP_CAPTURE); // STS: EOADD: Support for WebMakers.com's Header Tag Controller contribution ///////////////////////////////////////////// hope that means something to you! Would like to know in laymans terms what is going wrong too! Thanks again Terry didn't I mentioned to search first if the file is included in one of the php files in your store? Did you search for it?
Guest Posted June 29, 2006 Posted June 29, 2006 Well looks like you have the sts framework at the top and its hard to tell why the file is not included properly. Have you checked the STS support thread?
madmanbean Posted June 29, 2006 Author Posted June 29, 2006 Not a major problem as it only happens if you click on the link. Just bugs me that is does not work!! Have I discovered a bug??? Would you suggest I try posting there.. Really appreciate your help and input as this is all above my head. If I do find a solution and resong then I will post it here!! Well looks like you have the sts framework at the top and its hard to tell why the file is not included properly. Have you checked the STS support thread?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.