i found an way..
but need to make this as a plugin.. anybody can help me to create a plugin for this?
open: wp-includes/author-template.php
Replace
function the_author_description() {
echo get_the_author_description();
}
with
function the_author_description() {
echo bbcode(get_the_author_description());
}
save send back to server
open: ur themefolder/author.php
replace: <?php echo $curauth->user_description; ?>
with: <?php echo bbcode($curauth->user_description); ?>
open: wp-includes/functions.php
add in the last line before the ?>
function bbcode($sText)
{
$sTagArray['B)'] = array('tag'=>'XX');
$sTagArray['o}o'] = array('tag'=>'XX');
$sTagArray['br'] = array('tag'=>'<br />');
$sTagArray['hr'] = array('tag'=>'<hr>');
$atagArray['img'] = array('open'=>'<img src="','close'=>'">');
$atagArray['IMG'] = array('open'=>'<img src="','close'=>'">');
$atagArray['b'] = array('open'=>'<b>', 'close'=>'</b>');
$atagArray['B'] = array('open'=>'<b>', 'close'=>'</b>');
$atagArray['i'] = array('open'=>'<i>', 'close'=>'</i>');
$atagArray['u'] = array('open'=>'<u>', 'close'=>'</u>');
$atagArray['url'] = array('open'=>'<a href="', 'close'=>'" target="_blank">\\1</a>');
$atagArray['URL'] = array('open'=>'<a href="', 'close'=>'" target="_blank">\\1</a>');
$atagArray['email'] = array('open'=>'<a href="mailto:', 'close'=>'">\\1</a>');
$atagArray['url=(.*)'] = array('open'=>'<a href="', 'close'=>'" target="_blank">\\2</a>');
$atagArray['URL=(.*)'] = array('open'=>'<a href="', 'close'=>'" target="_blank">\\2</a>');
$atagArray['email=(.*)'] = array('open'=>'<a href="mailto:', 'close'=>'">\\2</a>');
$atagArray['color=(.*)'] = array('open'=>'<font color="', 'close'=>'">\\2</font>');
$atagArray['size=(.*)'] = array('open'=>'<font size="', 'close'=>'">\\2</font>');
$atagArray['font=(.*)'] = array('open'=>'<font face="', 'close'=>'">\\2</font>');
foreach ($atagArray as $stagName => $replace)
{
$tagEnd = preg_replace("/\W/sUi", "", $stagName);
$sText = preg_replace(
"|\[$stagName\](.*)\[/$tagEnd\]|sUi",
"$replace[open]\\1$replace[close]",
$sText
);
}
foreach ($sTagArray as $stagName => $replace)
{
if (eregi("[)(#$]", $stagName))
{
$stagNameNew = preg_replace("#([\)\(\$\#])#", "\\ \\1", $stagName);
$stagNameNew = preg_replace("#( +)#", "", $stagNameNew);
$sTagArray[ $stagNameNew ] = array('tag' => $replace['tag']);
unset($sTagArray[ $stagName ]);
}
}
foreach ($sTagArray as $stagName => $replace)
{
$sText= preg_replace("|\[$stagName\]|sUi", "$replace[tag]", $sText);
}
return $sText;
}
done ??
now, need to improve this as a plugin..