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
I know this is off, especially the $replace but hopefully this will give you an idea of what I am after, any help would be appreciated.