Jump to content

carsten888

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by carsten888

  1. sorry guys, I guess I did not explain enough of what I mean. This is for the Joomla framework. To override core functionality you can load a copy of a core-class (in another file then the core file). The Joomla core will then not load that same class again. So far so good. Problems come when other Joomla plugins try to directly require_once the core-file with the original class which has already been loaded. Obviously, that produces an error. So what I need is a way to tell PHP that that file has already been loaded, to prevent other plugins trying to require_once the file with the class which is already loaded. I hope that makes more sense now.
  2. Is it possible to set the require_once, so that later in the script PHP does not require_once the file? $file = $root.'filename.php'; set_require_once($file);//this would be nice require_once($file);//so this does not load
  3. I can get this to work: $string = " “Test” "; $search = array(chr(145), chr(146), chr(147), chr(148)); $replace = array("'", "'", '"', '"'); $string = str_replace($search, $replace, $string); but it does not work with the string I submit! really weird. Never seen this before. string: works in the above script, but not when I use it in my class. function bbcode_to_html($bb2html){ //find and replace b, url and img $bb2html = preg_replace_callback("/\[b\](.+?)\[\/b\]/i", array(get_class($this), 'get_b'), $bb2html); $bb2html = preg_replace_callback("/\[url\](.+?)\[\/url\]/i", array(get_class($this), 'get_link'), $bb2html); $bb2html = preg_replace_callback("/\[img\]http://(.+?)\[\/img\]/i", array(get_class($this), 'get_image'), $bb2html); //clean up all unclosed tags $bb2html = str_replace('[b]','',$bb2html); $bb2html = str_replace('[b]','',$bb2html); $bb2html = str_replace('[/b]','',$bb2html); $bb2html = str_replace('[/b]','',$bb2html); $bb2html = str_replace('[url=http://','',$bb2html); $bb2html = str_replace('[url]','',$bb2html); $bb2html = str_replace(']','',$bb2html); $bb2html = str_replace('[url]','',$bb2html); $bb2html = str_replace('[/url]','',$bb2html); $bb2html = str_replace('[/url]','',$bb2html); $bb2html = str_replace('[img]','',$bb2html); $bb2html = str_replace('[img]','',$bb2html); $bb2html = str_replace('[/img]','',$bb2html); $bb2html = str_replace('[/img]','',$bb2html); $bb2html = str_replace('[/','',$bb2html); $bb2html = str_replace('[','',$bb2html); $bb2html = str_replace(']','',$bb2html); //echo $bb2html; //echo '<br /><br />'; $search = array(chr(145), chr(146), chr(147), chr(148)); $replace = array("'", "'", '"', '"'); $bb2html = str_replace($search, $replace, $bb2html); //echo $bb2html; //exit; return $bb2html; } as you see I outputted it twice to see what going on and it simply outputs: What is there to overlook here? is this some bizar chartype issue? [sight]
  4. I want to replace those leaning doublequotes to normal double quotes. for a normal double quote this works fine: $bb2html = str_replace('"','doublequote',$bb2html); but this does not work with “ and ”. how to str_replace “ doublequote? (I just deleted my sample codes because I saw in the preview those funny doublequotes got replaced)
  5. I'm looking for a class that deals with making html into bbcode and vise versa. And is able to close open tags and preferably configurable to choose which html-tags to ignore/delete. Googled for hours. anyone?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.