Jump to content

text editor (bbcode) problem


kevinritt

Recommended Posts

Hi,

On this page http://www.lynnarts.org/about_us/calendar2.php?action=editcalendar_content&edit=edit&calendarId=1 I am trying to have the abilty to edit text but when I try to underline or make the text bold - it doesn't work. Any ideas?

I want to be able to use this text editor for different pages - is this possible?

I have these 2 functions written:

function ValidateOutput($value) {
	$BBCode = array(
	"
[center]" => "<center>", "[/center]
" => "</center>", 
	"[b]" => "<b>", "[/b]" => "</b>", 
	"[u]" => "<u>", "[/u]" => "</u>",
	"[i]" => "<i>", "[/i]" => "</i>",
	"[*]" => "<li>", "" => "</li>",
	); 
	$value = str_replace(array_keys($BBCode), array_values($BBCode), $value); 
	$value = stripslashes(nl2br($value));
	return $value; 
}

function buttons() {
	$buttons = '<input type="button" value="Bold" onclick="bbcode(\'[b]\', \'[/b]\')" /> 
	<input type="button" value="Italic" onclick="bbcode(\'[i]\', \'[/i]\')" /> 
	<input type="button" value="Underline" onclick="bbcode(\'[u]\', \'[/u]\')" />
	<input type="button" value="List Item" onclick="bbcode(\'[*]\', \'\')" />';
	return($buttons);
}

which are used in the php page:

  <tr>
    <td align="center">'.buttons().'<br /><textarea name="calendar_content" cols="85" rows="35">'.$calendar_content.'</textarea></td>
    </tr>

 

 

Also - how do I add more features to the text editor (font color, size, etc)?

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/142922-text-editor-bbcode-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.