PHP Code:
<?php
/*
Copyright (C) 2009 Murad <Murawd>
Josh L. <Josho192837>
BBCode Parser Modified By silv3rbullet
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$c = preg_replace('|\[b\](.+?)\[\/b\]|i', '<b>$1</b>', $c);
$c = preg_replace('|\[i\](.+?)\[\/i\]|i', '<i>$1</i>', $c);
$c = preg_replace('|\[u\](.+?)\[\/u\]|i', '<u>$1</u>', $c);
$c = preg_replace('|\[*\](.+?)\[\/*\]|i', '<li>$1</li>', $c);
$c = preg_replace('|\[url="(.+?)"\](.+?)\[\/url\]|i', '<a href="$1" target="_blank">$2</a>', $c);
$c = preg_replace('|\[center\](.+?)\[\/center\]|i', '<center>$1</center>', $c);
/*
$c = str_replace(array("[right]", "[/right]"), array("<span align=\"right\">", "</span>"), $c);
$c = str_replace(array("[left]", "[/left]"), array("<span align=\"left\">", "</span>"), $c);
*/
$c = preg_replace('|\[img\](.+?)\[\/img\]|i', '<img src="$1" border="0" alt="">', $c);
$c = preg_replace('|\[font="(.+?)"](.+?)\[\/font\]|i', '<font face="$1">$2</font>', $c);
$c = str_replace(":)", "<img src=\"sources/parser/smileys/smile.gif\"/>" , $c);
$c = str_replace("=)", "<img src=\"sources/parser/smileys/smile.gif\"/>" , $c);
$c = str_replace("=P", "<img src=\"sources/parser/smileys/tounge.gif\"/>" , $c);
$c = str_replace(":P", "<img src=\"sources/parser/smileys/tounge.gif\"/>" , $c);
$c = str_replace(":lol:", "<img src=\"sources/parser/smileys/lol.gif\"/>", $c);
$c = str_replace(":haha:", "<img src=\"sources/parser/smileys/lol.gif\"/>", $c);
$c = str_replace(":laugh:", "<img src=\"sources/parser/smileys/lol.gif\"/>", $c);
$c = str_replace(">=(", "<img src=\"sources/parser/smileys/mad.gif\"/>", $c);
$c = str_replace(":mad:", "<img src=\"sources/parser/smileys/mad.gif\"/>", $c);
$c = str_replace(">:(", "<img src=\"sources/parser/smileys/mad.gif\"/>", $c);
$c = str_replace(":O", "<img src=\"sources/parser/smileys/ohmy.gif\"/>", $c);
$c = str_replace("=O", "<img src=\"sources/parser/smileys/ohmy.gif\"/>", $c);
$c = str_replace(":(", "<img src=\"sources/parser/smileys/sad.gif\"/>", $c);
$c = str_replace("=(", "<img src=\"sources/parser/smileys/sad.gif\"/>", $c);
$c = str_replace(";)", "<img src=\"sources/parser/smileys/wink.gif\"/>", $c);
$c = str_replace(";D", "<img src=\"sources/parser/smileys/wink.gif\"/>", $c);
$c = str_replace(";P", "<img src=\"sources/parser/smileys/wink.gif\"/>", $c);
$c = str_replace("=/", "<img src=\"sources/parser/smileys/bored.gif\"/>", $c);
$c = str_replace(":bored:", "<img src=\"sources/parser/smileys/bored.gif\"/>", $c);
$c = str_replace(":D", "<img src=\"sources/parser/smileys/happy.gif\"/>", $c);
$c = str_replace("=D", "<img src=\"sources/parser/smileys/happy.gif\"/>", $c);
$script = "SELECT * FROM `cype_bbcode`";
$query = mysql_query($script) or die(mysql_error());
while($fetch = mysql_fetch_array($query))
{
$c = preg_replace(''.$fetch['pattern'].'|i', $fetch['replacement'], $c);
}
?>
BBCode Pack 1: