The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Hide code tags from certain usergroups ?
Hi guys ,
Can someone direct me ,how to hide something written in code tags Code:
Hide this I like to hide user-group 1,3 . Since i dont know how to do it ,i just removed these Forum Viewing Permissions for unregistered user-group. Quote:
My VB version 4.1.5 I have been reading vBulletin Template Conditionals and its not getting me anywhere. |
#2
|
|||
|
|||
$string = preg_replace(/\[code\].*\[\/code\]/i, "", $string);
I think that'll knock them out of $string. Are you good with plugins? EDIT: Wait a minute, let me work on that some more. EDIT2: Here we go (I think) $string = preg_replace(/\[code\][\s\S]*?\[\/code\]/i, "", $string); --------------- Added [DATE]1321771433[/DATE] at [TIME]1321771433[/TIME] --------------- All wrong about that. What I posted would match bb code. You will need to match html for a code box PHP Code:
|
#3
|
|||
|
|||
What are those things ? I have no idea where to use those ,other than adding some verification codes in header code of themes . I was used to marco hide plugin which isnt working anymore for last few months after VB 4.0.3 or something.
|
#4
|
|||
|
|||
Those things with all the slashes? Those are regular expressions. They describe patterns for matching strings of characters and you can use the preg_replace function to replace one string of characters with another (or with a blank).
You'll never get anywhere with template conditionals, this has to be done at the php level. I'd work on it but I can't get a reliable connection to my server right now so I can't view any files. Or do you mean plugins? Those are chunks of code inserted into files (well, sort of). Anyway you'll need one. |
Благодарность от: | ||
Liff |
#5
|
|||
|
|||
I would be very interested in this too, nerbert.
Thanks for taking the time to look at it. |
#6
|
|||
|
|||
In Style manager - Edit Templates - BB Code Layout Templates - bbcode_code
I changed default code Code:
<div class="bbcode_container"> <div class="bbcode_description">{vb:rawphrase code}:</div> <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>>{vb:raw code}</pre> </div> Code:
<vb:if condition="is_member_of($bbuserinfo, 2,7,5,6,9)"> <div class="bbcode_container"> <div class="bbcode_description">{vb:rawphrase code}:</div> <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>>{vb:raw code}</pre> </div> <vb:else /> <a href="http://site.com/register.php" target="_blank"> <img src="http://site.com/images/no_links_here.png"> </a> </vb:if> $bbuserinfo, 2,7,5,6,9 which are the ones whom i want to show the code contents like registred users,moderators etc. For others the code wont show as i have added <vb:else /> to that. I'm testing it and i'll be looking for users complaints if they cant view threads with code. |
#7
|
|||
|
|||
Hmmm ... that might work. I'm getting close but am having a glitch.
What about PHP and HTML tags? |
#8
|
|||
|
|||
No idea about other tags ,i've taken note for the bbcode conditionals from this site,so i made this even though i never did that. Hope it works without bugs.
Will report back if code is problematic. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|