The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
bbcode with html on user title of all groups
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: 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 [color] $text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2[/color]',$text); // [bl] for [blink] $text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1[/blink]',$text); // [mq] for [marquee] $text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1[/marquee]',$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; } 1- Hook Location: "fetch_userinfo" 2- Title: Userinfo 3- Plugin code: 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 [color] $text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2[/color]',$text); // [bl] for [blink] $text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1[/blink]',$text); // [mq] for [marquee] $text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1[/marquee]',$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; } 1- Hook Location: "forumdisplay_announcement" 2- Title: Announcement 3- Plugin code: 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 [color] $text = preg_replace('#\[c(.*?)\](.*?)\[\/c\]#','[color\1]\2[/color]',$text); // [bl] for [blink] $text = preg_replace('#\[bl\](.*?)\[\/bl\]#','[blink]\1[/blink]',$text); // [mq] for [marquee] $text = preg_replace('#\[mq\](.*?)\[\/mq\]#','[marquee]\1[/marquee]',$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; } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|