View Thread
Private Stock » Administrative and Housekeeping » Site Notes
 Print Thread
BBcode post restriction by group
With a little, okay, a lot, of help from a more experienced person on the phpfusionmods support site, I modded the members only bbcode add-on that I found on the mods site. I also combined some of the code from san admin only add-on that hides text from non-admins. I edited it to restrict posts/text to specific groups.

I did this by changing the code to:

if (!defined("IN_FUSION")) { die("Access Denied"); }
if (!checkgroup("1")) {
$text = preg_replace('#\[adult\](.*?)\[/adult\]#si', '<div class=\'admin-message\' style=\'width:70%; height:24px;\' align=\'left\'><img src=\''.INCLUDES.'bbcodes/images/adult.png\' align=\'left\'> '.$locale['bb_adult_message'].'</div>', $text);
} else {
$text = preg_replace('#\[adult\](.*?)\[/adult\]#si', '<div class=\'quote\'><strong>'.$locale['bb_adult'].'</strong><br /><span style=\'color:black;font-weight:bold\'>\1</span></div>', $text);


The !checkgroup checks the group number for the correct group to restrict to. So in my situation and for my purposes, I made one add-on for each group in which I want the capability to hide.

Samples of a few groups I made the add-on for.
Royce attached the following file:
You are not allowed to see attachments in this thread.

Edited by Royce on 05/13/2016 17:00
Share This Post:
Delicious Facebook Google Live Reddit StumbleUpon Yahoo

Share This Thread
Social Sharing: Delicious Facebook Google Live Reddit StumbleUpon Yahoo
Facebook Like:

Jump to Forum:
Top Top  1,853,225 unique visits  Top Top