Noskiw Posted January 14, 2009 Share Posted January 14, 2009 <?php function topic($input) { $pattern[0] = ""; $pattern[1] = "/\&/i"; $pattern[2] = "/\</i"; $pattern[3] = "/\>/i"; $pattern[4] = "/\[b\](.*?)\[\/b\]/i"; $pattern[5] = "/\[u\](.*?)\[\/u\]/i"; $pattern[6] = "/\[i\](.*?)\[\/i\]/i"; $pattern[7] = "/\[code\](.*?)\[\/code\]/i"; $pattern[8] = "/\[url\](.*?)\[\/url\]/i"; $pattern[9] = "/\[img\](.*?)\[\/img\]/i"; $pattern[10] = "/\[url\=(.*)\](.*)\[\/url\]/i"; $replace[0] = "<img src='/images/smiley1.gif'/>"; $replace[1] = "&"; $replace[2] = "<"; $replace[3] = ">"; $replace[4] = "<b>$1</b>"; $replace[5] = "<u>$1</u>"; $replace[6] = "<i>$1</i>"; $replace[7] = "Code:<br><div id=\"code\"><tt>$1</tt></div>\n"; $replace[8] = "<a href=$1>$1</a>"; $replace[9] = "<img src = $1 />"; $replace[10] = "<a href=$1>$2</a>"; $bbcoded = preg_replace($pattern, $replace, $input); return nl2br($bbcoded && $some2); return nl2br(strip_tags(stripslashes(htmlspecialchars($input)))); } ?> the posts i have won;t show up. and i have no idea why. help maybe? Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/ Share on other sites More sharing options...
Prismatic Posted January 14, 2009 Share Posted January 14, 2009 <?php function topic($input) { $pattern[0] = ""; $pattern[1] = "/\&/i"; $pattern[2] = "/\</i"; $pattern[3] = "/\>/i"; $pattern[4] = "/\[b\](.*?)\[\/b\]/i"; $pattern[5] = "/\[u\](.*?)\[\/u\]/i"; $pattern[6] = "/\[i\](.*?)\[\/i\]/i"; $pattern[7] = "/\[code\](.*?)\[\/code\]/i"; $pattern[8] = "/\[url\](.*?)\[\/url\]/i"; $pattern[9] = "/\[img\](.*?)\[\/img\]/i"; $pattern[10] = "/\[url\=(.*)\](.*)\[\/url\]/i"; $replace[0] = "<img src='/images/smiley1.gif'/>"; $replace[1] = "&"; $replace[2] = "<"; $replace[3] = ">"; $replace[4] = "<b>$1</b>"; $replace[5] = "<u>$1</u>"; $replace[6] = "<i>$1</i>"; $replace[7] = "Code:<br><div id=\"code\"><tt>$1</tt></div>\n"; $replace[8] = "<a href=$1>$1</a>"; $replace[9] = "<img src = $1 />"; $replace[10] = "<a href=$1>$2</a>"; $bbcoded = preg_replace($pattern, $replace, $input); //return nl2br($bbcoded && $some2); return nl2br(strip_tags(stripslashes(htmlspecialchars($bbcoded)))); } ?> Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/#findComment-737114 Share on other sites More sharing options...
Noskiw Posted January 14, 2009 Author Share Posted January 14, 2009 o yea, tried that before, didn't work( i got ride of $some2). Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/#findComment-737124 Share on other sites More sharing options...
Noskiw Posted January 14, 2009 Author Share Posted January 14, 2009 any help? Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/#findComment-737248 Share on other sites More sharing options...
Noskiw Posted January 15, 2009 Author Share Posted January 15, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/#findComment-737709 Share on other sites More sharing options...
Noskiw Posted January 15, 2009 Author Share Posted January 15, 2009 seriously i could use some help. Link to comment https://forums.phpfreaks.com/topic/140830-smiley-problem/#findComment-737786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.