Andr? Noberto
03-17-2011, 11:55 PM
hello guys, I have a very complicated question....
would enable the user vbulletin title for everyone, and it's obviously possible. but wanted everyone to use html in the user title, but this is only possible to administrators....
some time ago I saw a discussion on the topic in a forum not tied to vbulletin, and a user would have posted a part of the solution can not remember which was more the site will post more information obtained on that topic if it will help someone look at the topic.
is necessary to create three plugins.
First Plugin
1- Hook Location: "postbit_display_comple"
2- Title: Postbit
3- Plugin code:
global $vbulletin;
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($post['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $post['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$banned_tags = explode(",", $vbulletin->options['usertitlebbcode_banned_tags']);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#","<br \/>",$text,1);
$post['usertitle'] = $text;
}
Second Plugin:
1- Hook Location: "fetch_userinfo"
2- Title: Userinfo
3- Plugin code:
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($user['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $user['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$banned_tags = explode(",", $vbulletin->options['usertitlebbcode_banned_tags']);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#","<br />",$text,1);
$user['usertitle'] = $text;
}
Third Plugin
1- Hook Location: "forumdisplay_announcement"
2- Title: Announcement
3- Plugin code:
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($announcement['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $announcement['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$tags1 = $vbulletin->options['usertitlebbcode_banned_tags'];
$tags1 .= ",color";
$tags1 .= ",c";
$tags1 .= ",blink";
$tags1 .= ",bl";
$tags1 .= ",mq";
$tags1 .= ",b";
$tags1 .= ",marquee";
$banned_tags = explode(",", $tags1);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#"," / ",$text,1);
$announcement['usertitle'] = $text;
}
these are the only good information developed at the time, most also seem to be a functional part, if any can help me finish this work would be grateful.
would enable the user vbulletin title for everyone, and it's obviously possible. but wanted everyone to use html in the user title, but this is only possible to administrators....
some time ago I saw a discussion on the topic in a forum not tied to vbulletin, and a user would have posted a part of the solution can not remember which was more the site will post more information obtained on that topic if it will help someone look at the topic.
is necessary to create three plugins.
First Plugin
1- Hook Location: "postbit_display_comple"
2- Title: Postbit
3- Plugin code:
global $vbulletin;
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($post['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $post['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$banned_tags = explode(",", $vbulletin->options['usertitlebbcode_banned_tags']);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#","<br \/>",$text,1);
$post['usertitle'] = $text;
}
Second Plugin:
1- Hook Location: "fetch_userinfo"
2- Title: Userinfo
3- Plugin code:
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($user['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $user['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$banned_tags = explode(",", $vbulletin->options['usertitlebbcode_banned_tags']);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#","<br />",$text,1);
$user['usertitle'] = $text;
}
Third Plugin
1- Hook Location: "forumdisplay_announcement"
2- Title: Announcement
3- Plugin code:
if($vbulletin->options['usertitlebbcode_enabled'] AND !empty($announcement['usertitle']))
{
require_once(DIR . '/includes/class_bbcode.php');
$text = $announcement['usertitle'];
if($vbulletin->options['usertitlebbcode_banned_tags'])
{
$tags1 = $vbulletin->options['usertitlebbcode_banned_tags'];
$tags1 .= ",color";
$tags1 .= ",c";
$tags1 .= ",blink";
$tags1 .= ",bl";
$tags1 .= ",mq";
$tags1 .= ",b";
$tags1 .= ",marquee";
$banned_tags = explode(",", $tags1);
$bannedtags = array();
foreach($banned_tags as $banned_tag)
{
$bannedtags[] = "#\[".$banned_tag.".*?\]#i";
$bannedtags[] = "#\[/".$banned_tag."\]#i";
}
$text = !empty($bannedtags) ? preg_replace($bannedtags,'',$text) : $text;
}
// [c] for
$text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2',$text);
// [bl] for
$text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1',$text);
// [mq] for
$text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1',$text);
$bbcode_parserx = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $bbcode_parserx->do_parse($text, true, false, true , false, false, false);
$text = preg_replace("#\[n\]#"," / ",$text,1);
$announcement['usertitle'] = $text;
}
these are the only good information developed at the time, most also seem to be a functional part, if any can help me finish this work would be grateful.