The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#2
|
|||
|
|||
![]()
Conditionals just don't work inside bb codes; they don't execute at all. Maybe what you could do is have something like this
<div style="display:none" name="restricted">{param}</div> Then up in the <head> have a script that changes the display to "block" for admins and supers for window.onload. The trouble is this will be visible in the source code to anyone who looks. Actually I don't think there's any direct way to do it with the bbcode system, you would have to do it with php in a plugin in showthread.php and have regular expression matching chop the text out for registered members --------------- Added [DATE]1373001216[/DATE] at [TIME]1373001216[/TIME] --------------- I'm going to work on this. Check back in an hour or so. --------------- Added [DATE]1373005186[/DATE] at [TIME]1373005186[/TIME] --------------- Make a plugin for showhread_complete and an identical one for showpost-complete with this code: Code:
$test = preg_match_all('#\[restricted\]([\s\S]*?)\[/restricted\]#i', $postbits, $matches); $style = " background:#ffffcc; border:1px solid black; padding:6px; color:red; "; $open_tag ='<div style="' . $style . '">'; $close_tag = '</div>'; if($test) { for($i = 0; $i < count($matches[0]); $i++) { if(is_member_of($vbulletin->userinfo, array(6,7))) { $postbits = preg_replace('#' . preg_quote($matches[0][$i], '#') . '#', $open_tag . $matches[1][$i] . $close_tag, $postbits); } else { $postbits = preg_replace('#' . preg_quote($matches[0][$i], '#') . '#', '', $postbits); } } } |
Благодарность от: | ||
tbworld |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|