Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function BBCode($string){
- $patterns = array(
- '`\*\*(.+?)\*\*`is',
- '`\*(.+?)\*`is',
- '`%%(.+?)%%`is',
- '`\[b\](.+?)\[/b\]`is',
- '`\[i\](.+?)\[/i\]`is',
- '`\[u\](.+?)\[/u\]`is',
- '`\[s\](.+?)\[/s\]`is',
- '`\[spoiler\](.+?)\[/spoiler\]`is',
- '`\[lination\](.+?)\[/lination\]`is',
- );
- $replaces = array(
- '<b>\\1</b>',
- '<i>\\1</i>',
- '<span class="spoiler">\\1</span>',
- '<b>\\1</b>',
- '<i>\\1</i>',
- '<span style="border-bottom: 1px solid">\\1</span>',
- '<strike>\\1</strike>',
- '<span class="spoiler">\\1</span>',
- '<span style="color: #D14836; border-bottom: 1px dashed #D14836;">\\1</span>',
- );
- $string = preg_replace($patterns, $replaces , $string);
- $string = preg_replace_callback('`\[code\](.+?)\[/code\]`is', array(&$this, 'code_callback'), $string);
- return $string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement