I have javascript that does all the inserting for the vb code into the text box, but I am having trouble with one perticular part ... I was hoping that someone could help me here.
This is what I am using for the bold, italic, and underline, which work and are fairly easy to understand and use:
Code: Select all
<?
$message = str_replace("їb]", "<b>", $message);
$message = str_replace("ї/b]", "</b>", $message);
$message = str_replace("їi]", "<i>", $message);
$message = str_replace("ї/i]", "</i>", $message);
$message = str_replace("їu]", "<u>", $message);
$message = str_replace("ї/u]", "</u>", $message);
return $message;
?>this is what a friend sent me ... but it does not work, and below the example, is how it displays:
Code: Select all
<?
$patterns = array();
$replacements = array();
$patternsї] = "#\їurl\](їa-z]+?://){1}(.*?)\ї/url\]#si";
$replacementsї] = '<a href="\1\2" target="_blank">\1\2</a>';
$patternsї] = "#\їurl\](.*?)\ї/url\]#si";
$replacementsї] = '<a href="http://\1" target="_blank">\1</a>';
$message = preg_replace($patterns, $replacements, $message);
$message = preg_replace("'\їimg\](їa-z]+?://){1}(.+?)\ї/img\]'i", "<img src="$1$2" border="0" />", $message);
$message = preg_replace("'\їimg=(ї0-9]{1,3})x(ї0-9]{1,3})\](їa-z]+?://){1}(.+?)\ї/img\]'i", "<img src="$3$4" border="0" width="$1" height="$2" />", $message);
return $message;
?>Code: Select all
<a href="http://www.1234.com/<img src="http://www.1234.com/image.gif" border="0" />" target="_blank">http://www.1234.com/<img src="http://www.1234.com/" border="0" /></a>If you can help me, I would like to thank you ahead of time.
thanks
Cypher.