<?php /* This file is part of miniBB. miniBB is free discussion forums/message
board software, without any warranty. See COPYING file for more detail
s. Copyright (C) 2007 Paul Puzyrev, Sergei Larionov. www.minibb.net Latest File Update: 2007-Aug-23 */ function enCodeBBSig($msg,$admin) { $pattern=array(); $replacement=array(); $pattern[]="/\[url=((f|ht)tp[s]?:\/\/[^<> \n\r\[\]]+?)\](.*?)\[\/u
rl\]/i"; $replacement[]="<a href=\"\\1\" target=\"_blank\" rel=\"nofollow\"
>\\3</a>"; /* [IMGS] tag code - with fixed width and ALT */ $pattern[]="/\[img=(http:\/\/([^<> \n\r\[\]&]+?)\.?(gif|jpg|jpeg|p
ng)?)\](.*?)\[\/img\]/i"; $replacement[]='<img src="\\1" alt="\\4" title="\\4" />'; $pattern[]="/\[[bB]\](.+?)\[\/[bB]\]/s"; $replacement[]='<strong>\\1</strong>'; $pattern[]="/\[[iI]\](.+?)\[\/[iI]\]/s"; $replacement[]='<em>\\1</em>'; $pattern[]="/\[[uU]\](.+?)\[\/[uU]\]/s"; $replacement[]='<u>\\1</u>'; $pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is"; $replacement[]='<span style="color:\\1">\\2</span>'; if($admin==1 or $GLOBALS['isMod']==1){ $pattern[]="/\[urlc=((f|ht)tp[s]?:\/\/[^<> \n\r\[\]]+?)\](.*?)
\[\/url\]/i"; $replacement[]="<a href=\"\\1\" target=\"_blank\">\\3</a>"; } $msg=preg_replace($pattern, $replacement, $msg); $msg=str_replace(array("\r\n", "\n"), '<br />', $msg); if(substr_count($msg,'<img')>0) $msg=str_replace('align=""', '', $
msg); if(substr_count($msg,'"nofollow"></a>')>0) $msg=str_replace('"nofo
llow"></a>', '"nofollow">URL</a>', $msg); return $msg; } //---------------> function deCodeBBSig($msg) { $pattern=array(); $replacement=array(); /* [IMGS] tag code - with fixed width and alt */ $pattern[]="/<img src=\"([^<> \n\r\[\]]+?)\" alt=\"(.+?)\" (title=
\"(.+?)\" )?\/>/i"; $replacement[]="[img=\\1]\\4[/img]"; $pattern[]="/<a href=\"([^<> \n\r\[\]]+?)\" target=\"(_new|_blank)
\" rel=\"nofollow\">(.+?)<\/a>/i"; $replacement[]="[url=\\1]\\3[/url]"; if($GLOBALS['user_id']==1 or (isset($GLOBALS['isMod']) and $GLOBAL
S['isMod']==1)){ $pattern[]="/<a href=\"([^<> \n\r\[\]]+?)\" target=\"(_new|_bl
ank)\">(.+?)<\/a>/i"; $replacement[]="[urlc=\\1]\\3[/url]"; } else{ $pattern[]="/<a href=\"([^<> \n\r\[\]]+?)\" target=\"(_new|_bl
ank)\">(.+?)<\/a>/i"; $replacement[]="[url=\\1]\\3[/url]"; } $pattern[]="/<strong>(.+?)<\/strong>/is"; $replacement[]="\\1"; $pattern[]="/<em>(.+?)<\/em>/is"; $replacement[]="\\1"; $pattern[]="/<[uU]>(.+?)<\/[uU]>/s"; $replacement[]="\\1"; $pattern[]="/<span style=\"color#[A-F0-9]{6})\">(.+?)<\/span>/is"; $replacement[]='[font\\1]\\2[/font]'; $msg=preg_replace($pattern, $replacement, $msg); $msg=str_replace ('<br />', "\n", $msg); if(substr_count($msg, '[img\\2]')>0) $msg=str_replace('[img\\2]',
'[img]', $msg); return $msg; } ?>
fdsf
The King of Admins