Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to fix this small bug of displaying smileys in chat, and replacing swears with asterisks in chat?
- $return .= "<div style="font-size: 14px; padding-bottom: 3px; color: #444444;">". $time . $icon . $username . str_replace('"', "'", parse_bbcode(smiley(str_replace("n", '', $chat['text'])))) ."</div>";
- str_replace('"', "'", parse_bbcode(smiley(str_replace("n", '', $chat['text']))))
- parse_bbcode(smiley, curses
- parse_bbcode(smiley . curses
- function parse_bbcode($text, $xhtml = true) {
- $tags = array(
- '#[b](.*?)[/b]#si' => ($xhtml ? '<strong>\1</strong>' : '<b>\1</b>'),
- '#[i](.*?)[/i]#si' => ($xhtml ? '<em>\1</em>' : '<i>\1</i>'),
- '#[u](.*?)[/u]#si' => ($xhtml ? '<span style="text-decoration: underline;">\1</span>' : '<u>\1</u>'),
- '#[s](.*?)[/s]#si' => ($xhtml ? '<strike>\1</strike>' : '<s>\1</s>'),
- '#[color=(.*?)](.*?)[/color]#si' => ($xhtml ? '<span style="color: \1;">\2</span>' : '<font color="\1">\2</font>'),
- '#[img](.*?)[/img]#si' => ($xhtml ? '<img src="\1" border="0" alt="" style="max-width: 400px; max-height: 200px;" />' : '<img src="\1" border="0" alt="">'),
- '#[url=(.*?)](.*?)[/url]#si' => '<a href="\1" target="_blank" style="color: #000000; font-size: 12px;" title="\2">\2</a>',
- '#[email](.*?)[/email]#si' => '<a href="mailto:\1" title="Email \1">\1</a>',
- '#[code](.*?)[/code]#si' => '<code>\1</code>',
- '#[align=(.*?)](.*?)[/align]#si' => ($xhtml ? '<div style="text-align: \1;">\2</div>' : '<div align="\1">\2</div>'),
- '#[br]#si' => ($xhtml ? '<br style="clear: both;" />' : '<br>'),
- );
- foreach ($tags AS $search => $replace) {
- $text = preg_replace($search, $replace, $text);
- }
- return $text;
- }
- ... parse_bbcode(curses(smiley(...
Add Comment
Please, Sign In to add comment