The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I have created custom bbcode that uses a [MP3] [/MP3] tag for this mod https://vborg.vbsupport.ru/showthread.php?t=72162 , what I want to do is secure it so only registered users can view it and unregistered users see a "Must Register" notice. I am having trouble with the preg_replace function. Here is my idea of what to add to functions_bbcodeparse.php
Code:
// Media hack begin <if condition="$post[usergroupid] == 1"> $string= "[MP3]song[/MP3]"; $pattern= "#\[mp3\](.*)\[/mp3\]#esiU"; $replace= "<b>You must be registered to view this</b>"; echo preg_replace($pattern, $replace, $string); </if> // Media hack end |
#2
|
|||
|
|||
![]() Quote:
|
#3
|
||||
|
||||
![]() Quote:
Code:
// Media hack begin if (is_member_of($bbuserinfo, 6)) $string= "\[MP3\]song\[/MP3\]"; $pattern= "#\[mp3\](.*)\[/mp3\]#siU"; $replace= "<b>$1</b>"; echo preg_replace("/\[mp3\](.*)\[\/mp3\]/siU", $replace, $string); // Media hack end I also wonder if I shouldn't be applying this to showthread.php instead of functions_bbcodeparse.php? So you guys know exactly what I am after here I created a new bbcode [MP3]www.site.com/song.mp3[/MP3] and I don't want that bbcode to show up for a specific (unregistered) group. Thanks again for any help ![]() |
#4
|
||||
|
||||
![]()
I thought I would bump this, I have spent hours trying to come up with a solution with no luck.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|