TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 79
  • Total: 79

Advertising Block Permissions Problems

Started by Roknrol, August 19, 2007, 01:01:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Roknrol

At http://www.paganforum.com we've been having some minor issues with Block Permissions - I did a few searches but didn't find anything that fit my problem, so I apologize if this has been asked and I missed the solution.

We have *many* Membergroups at PF, most of which are supposed to view our Advertising blocks.  We have two groups that should *not* see the Advertising blocks.  When we have a member that is a member of both sets of groups, they can see the blocks - is there a way to prevent them from seeing the blocks regardless of what *other* groups they're in?  See below for a bit better explanation :)

Group1 - should see the ads
Group2 - should see the ads
Group3 - should not see the ads
Group4 - should see the ads

If a member is part of Group1 and Group3, they can see the blocks.  Is there a way to *prevent* seeing the blocks if they're a member of Group3 without having to remove them from the other groups?

IchBin

Currently there is no feature built into TP that can do this. You can however do it with some PHP code.


global $user_info;

if ($user_info['groups'] == 1 || $user_info == 2 || $user_info == 4)
echo 'ad code in between these single quotes';


You would exchange the 1,2,4 with the actually group ID of your member groups.

Roknrol

#2
Quote from: IchBin™ on August 19, 2007, 03:23:30 AM
Currently there is no feature built into TP that can do this. You can however do it with some PHP code.


global $user_info;

if ($user_info['groups'] == 1 || $user_info['groups'] == 2 || $user_info['groups'] == 4)
echo 'ad code in between these single quotes';


You would exchange the 1,2,4 with the actually group ID of your member groups.
TYVM!  That's *perfect*!!!

Horme Gaming

ichbin this would be installed in the block yes?

IchBin

Yes, or an article. As long as its a php one.

I fixed the code above, I had an error in it.

This website is proudly hosted on Crocweb Cloud Website Hosting.