Jump to content


Photo

Help null out a function


  • Please log in to reply
3 replies to this topic

#1 mrjkb

mrjkb
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationChicago

Posted 05 August 2005 - 01:59 PM

I am running an oscommerce site and loaded an new contribution, but cannot get any contribution support to make it work. I am getting an error of:

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/includes/article_header_tags.php on line 134
when I click on New Articles

and

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/articles.php on line 350
when I click on All Articles

and

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/includes/article_header_tags.php on line 104

when I click on an article I posted. All worked well until I posted an article.

This is line 350 from articles.php in the second error

<td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_all['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_all['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>


I have been working down the path of adding this to application_top.php

// articles fix
if (function_exists('clean_html_comments')) {
????(???);
}

but am not sure what to put into the ???? area to get this to null out. Any Help or other suggestions?

#2 cfi

cfi
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationBucharest, Romania

Posted 05 August 2005 - 02:42 PM

clean_html_comments() is a user defined function.
First question is: do you have in that file included another file where clean_html_comments() is defined? have you searched to see where is defined?


function clean_html_comments() could cotain some code with strip_tags(), etc...


googleing showed this:
you have to add this line in application.top
require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
zend_errors.h

#3 mrjkb

mrjkb
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationChicago

Posted 05 August 2005 - 03:05 PM

clean_html_comments() is a user defined function.
First question is: do you have in that file included another file where clean_html_comments() is defined? have you searched to see where is defined?
function clean_html_comments() could cotain some code with strip_tags(), etc...
googleing showed this:
you have to add this line in application.top
require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

View Post


I did try to add the require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); to application top to no avail.

Here is my clean_html_comment file:

// 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;
}

?>

do you mean is clean_html in article_header_tags.php ?

#4 mrjkb

mrjkb
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationChicago

Posted 05 August 2005 - 03:38 PM

Here is the code in articles.php that calls for clean_html_comments

<tr>
<td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_all['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_all['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
</tr>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users