SOLVED Hiding Link By Group


Subject: Hiding Link By Group
Hi

I found and modified a piece of code so I can hide links from users.. but members in a group will be able to see them..

this is the code...

in includes/page_header.php

Code: [Download] [Hide] [Select]
$sql = 'SELECT * FROM ' . USER_GROUP_TABLE . '
WHERE group_id=USER GROUP ID HERE
AND user_id=' . $userdata['user_id'] . '
AND user_pending=0
LIMIT 1';

$is_vip = 0;

if (($result = $db->sql_query($sql)) != FALSE)
{
$is_vip = $db->sql_numrows($result);
$db->sql_freeresult($result);
}

if ($is_vip == 0)
{
$template->assign_block_vars('non_vips_only', array());
}


and in the tpl file you need it

Code: [Download] [Hide] [Select]

<!-- BEGIN non_vips_only -->
CODE HERE
<!-- END non_vips_only -->


This works great for one group but I have tried and failed so it allows 2 groups...

in the code you have USER GROUP ID HERE where you can place one group id.. I thought if you added a comma and then the second group id it would work but it does not....

I am at a bit of a loss as how to do this, and I would appreciate any help anyone could offer..

Thanks

Subject: Re: Hiding Link By Group
solved

Subject: Re: SOLVED - Hiding Link By Group
How did you get it working?

Subject: Re: SOLVED - Hiding Link By Group
it was for a specific mod that is not included in vanilla icy... and someone on the mods site had posted a solution...

Sadly the code above will only work for one group.. but is still usable if you want to only show links to a certain group

:mrgreen: :mrgreen:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.176s (PHP: 9% SQL: 91%)
SQL queries: 10 - Debug Off - GZIP Enabled