Hide Code From Private Groups

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
halil16
Registered User
Posts: 1266
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil
Contact:

Hide Code From Private Groups

Post by halil16 »

Hi,
The code below is used to show on various pages.
<!-- IF SCRIPT_NAME eq 'index' or 'viewforum' or 'viewtopic' -->

Is it possible to hide content from various groups with the same logic?
For example from Managers, Moderators or VIP members.

The official Advertisement extension can do this, for example. But I don't know with what codes.

or
3Di wrote: Sun Apr 18, 2021 2:31 am Example, this should show your stuff only to guests. (Not tested).

Code: Select all

{% if SCRIPT_NAME in ['index', 'viewforum', 'viewtopic'] and not S_USER_LOGGED_IN %}
    do your stuff here
{% endif %}
But, for example, I want it to be hidden from the VIP group I created.
* Hire me at fiverr for your phpBB board.
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
I'm learning English...
Contributions: #Hashtag, Elegance, Latte
User avatar
Mannix_
Registered User
Posts: 1838
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt
Contact:

Re: Hide Code From Private Groups

Post by Mannix_ »

Should be possible but it would require this extension https://www.phpbb.com/customise/db/exte ... _variables as there is no variable for groups in vanilla phpbb iirc.
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
User avatar
halil16
Registered User
Posts: 1266
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil
Contact:

Re: Hide Code From Private Groups

Post by halil16 »

So how does extension Advertisement Management do this?
* Hire me at fiverr for your phpBB board.
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
I'm learning English...
Contributions: #Hashtag, Elegance, Latte
User avatar
Mannix_
Registered User
Posts: 1838
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt
Contact:

Re: Hide Code From Private Groups

Post by Mannix_ »

halil16 wrote: Tue Apr 20, 2021 5:40 pm So how does extension Advertisement Management do this?
Ask the author of the extension. He knows the code best
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
benj22
Registered User
Posts: 1
Joined: Mon Apr 26, 2021 5:56 pm
Contact:

Re: Hide Code From Private Groups

Post by benj22 »

So how does extension Advertisement Management do this?
Ask the author of the extension. He knows the code best
sorry my stupid question
but the author is listed as "dev team robot" meaning it’s not the real person
who do I contact then?
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72339
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Hide Code From Private Groups

Post by KevC »

benj22 wrote: Thu Apr 29, 2021 4:36 pm
So how does extension Advertisement Management do this?
Ask the author of the extension. He knows the code best
sorry my stupid question
but the author is listed as "dev team robot" meaning it’s not the real person
who do I contact then?
Click the support tab
Attachments
Screenshot 2021-04-29 at 19.39.35.png
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Post Reply

Return to “phpBB Custom Coding”