Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Adapting Hide BBCode (for Admins only view) to use for created user groups

Asked Modified Viewed 1,392 times
B
batbaru1
B
  • Member, joined since
  • Contributed 54 posts on the community forums.
  • Started 14 threads in the forums
  • Started this discussions
asked
Member

Can anyone share coding knowledge to help me figure out how to copy and then adapt the Hide bbcode, that comes with v8, to use to restrict text to specific user groups I create? I had guidance from someone on a PHP-F site (his own mods/dev efforts) a few years ago to use on my v7.02 site. My upgrade to v8 went south and I nuked and started from complete scratch, and made the mortal sin of not properly backing up my modded/added files, not thinking beyond core files.
hide_bbcode_include.php
if (!defined("IN_FUSION")) {
 die("Access Denied");
}
if (iADMIN) {
 $text = preg_replace('#\[hide\](.*?)\[/hide\]#si', '<div class=\'quote\'><strong>'.$locale['bb_hide'].'</strong><br /><span style=\'color:red;font-weight:bold\'>\1</span></div>', $text);
} else {
 $text = preg_replace('#\[hide\](.*?)\[/hide\]#si', '', $text);
}

I know the crux of adapting is in the if (iADMIN) statement to i(group name or group ID) along with changing the bbcode name 'hide' to a new name. I don't remember the syntax of the statement to make it work for a new user group ID 2 group name Private. I think I can get the _include_var.php and locale file changes/adaptions correct if I can figure this one out.

I would really appreciate any help!
0 replies

3 posts

S
songiuno
S
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
answered
Member

The old v7 bbcode for this didn't/doesn't work when infused in v9. I was hoping there would be a solution in this thread.
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

V9 already has this BBCode, v8 as well. No need to use old v7 codes.

Quote

restrict text to specific user groups I create?

Use checkgroup() function https://www.php-fusion.co.uk/infusion...page_id=69
0 replies
— 1 month later —
B
batbaru1
B
  • Member, joined since
  • Contributed 54 posts on the community forums.
  • Started 14 threads in the forums
  • Started this discussions
answered
Member

That worked, thank you!
0 replies

Category Forum

BB Codes - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet