I'm having a problem with a custom built function and keep getting this error:
Warning: Missing argument 1 for BB_Code::BB_Code(), called in /home/cra10002/public_html/mooglebook/input.php on line 21 and defined in /home/cra10002/public_html/mooglebook/function.php on line 4
Fatal error: Call to undefined method BB_Code::parse() in /home/cra10002/public_html/mooglebook/input.php on line 22
the fuction code is this:
Code: <?php
function BB_Code($text) {
$text = " " . $text;
if (! (strpos($text, "[") && strpos($text, "]")) ) {
return $text;
}
else {
$text = preg_replace("/\[b\](.+?)[/b]/is",'<b>1</b>', $text);
$text = preg_replace("/\[i\](.+?)[/i]/is",'<i>1</i>', $text);
$text = preg_replace("/\[u\](.+?)[/u]/is",'<u>1</u>', $text);
$text = preg_replace("/[s](.+?)[/s]/is",'<s>1</s>', $text);
$text = preg_replace("/\[sub\](.+?)[/sub]/is",'<sub>1</sub>', $text);
$text = preg_replace("/\[sup\](.+?)[/sup]/is",'<sup>1</sup>', $text);
$text = preg_replace("/\[tt\](.+?)[/tt]/is",'<tt>1</tt>', $text);
$text = eregi_replace("\[img]([^\[]*)\[/img\]","<img src="\1">",$text);
$text = eregi_replace("\[size([^\[]*)\]([^\[]*)\[/size\]","<font size="\1px">\2</font>",$text);
$text = eregi_replace("\[font([^\[]*)\]([^\[]*)\[/font\]","<font face="\1">\2</font>",$text);
$text = eregi_replace("\[color=([^\[]*)\]([^\[]*)\[/color\]","<font color="\1">\2</font>",$text);
$text = eregi_replace("\[align=([^\[]*)\]([^\[]*)\[/align\]","<div align="\1">\2</div>",$text);
$text = eregi_replace("\[email=([^\[]*)\]([^\[]*)\[/email\]","<a href="mailto:="\1">\2</a>",$text);
$text = eregi_replace("\[email=([^\[]*)\]([^\[]*)\[/email\]","<a href="\1">\2</a>",$text);
return $text;
}
}
?>
and this is the part of the other code thats causing the problem, this script works fine before this line was posted and an attmpt to make bb code to html tag.
Code: $parse_text = BB_Code($comment);
If anyone can help me around this problem I would be greatful
Thank you
Feed Maker
Hi all.First of all I must say I am not a php developer so I am afraid I don't know much about it.I am using the bloging software on my site called Super Simple Blog. This software includes a file
Parse String
I need to parse the string below into three variables. How would I do that?john + 10/20/2008 - 10/30/2008+ and - are separators
standard ALV application toolbar, into custom report....
HI,
Checking if a process is running (problems including psapi.dll i think...)
Ok, so all I'm trying to do is check if a program is running...
RadioButtonList data selection
view plaincopy to clipboardprint?<asp:RadioButtonList ID="type" runat="server" TextAlign="left" CssClass="contactTypeRadio"> <asp:ListItem Value="Inquiry" Selected="True" />
Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what the page does is get all the items out of a database then with cURL download some HTML parse through
Doubles are giving me problems
Ok so, first of all i made a double = 0.05, but when running the debugger it shows up as 0.04999. I know this has something to do with how doubles store but its causing problems for me. Anyway, in the
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo friendly links.The code that ive used many times before.....Code: $_SESSION['lang'] = $lang =
is_dir() problem
Hello,I'm buidling a php scripts that dynamically get's subfolders from a specific folder.my code:Code: <?php if(isset($button)){ $opendirdepot =
PHP & Images [Resize, Crop, Save]
Hey! Well I have a little dilema, hoping I could find some guidance.I have a CMS and on the actual website I am building I have a nice little slideshow script that runs through all the images in a