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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 289
  • Total: 289

Hide block from grouped users

Started by msbiofuels, August 05, 2010, 06:51:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

msbiofuels

We use a couple of blocks that are only displayed to regular ungrouped members.  One prompts them to make a membership payment and the other is a Google adsense ad.  When they pay dues, the membership payment block and adsense ad are supposed to disappear.

Unfortunately, since I updated to V 1 Beta 5.2, anything the ungrouped members see, everyone sees.  I can restrict the blocks so that only guests see them, but if I tick the "ungrouped member" box, everyone can see that block.  I've tried selecting all, saving my changes, and deselecting all but "ungrouped members" but it made no difference.

Our paid members got angry they were being pestered with ads after having already made their contributions, so I was forced to hide the ads for now, so we are going to generate less ad revenue from our un-paid users.

I attempted to roll back, by deleting TP and reinstalling, but I got errors when attempting to uninstall:

1.     Execute Modification     ./index.php     Test failed
2.    Execute Modification    ./Sources/Load.php    Test failed
3.    Execute Modification    ./Themes/default/index.template.php    Test failed
4.    Execute Modification    ./Themes/babylon/index.template.php    File not found
5.    Execute Modification    ./Sources/Subs.php    Test failed

I appreciate any help you can offer.  Thanks.

IchBin

Well if you want to put in a temp fix until we can figure this out, here's what you can do. Create the block and make it a php type block. Then you do something like this in the code:


global $user_info;

// Change the number four to your group ID
$groupID = 4;
if (!in_array($groupID, $user_info['groups'])) {
    echo 'all the ad code goes between these single quotes';
}


This basically says that if your group ID is not 4, then echo your ad code. In the mean while I'll try to test this problem out when I get a moment.

This website is proudly hosted on Crocweb Cloud Website Hosting.