Hiding Link By Group »  Show posts from    to     

Icy Phoenix


Old Support Topics - Hiding Link By Group



DWho [ Tue 30 Sep, 2008 12:46 ]
Post 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: [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: [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


DWho [ Fri 17 Oct, 2008 15:22 ]
Post subject: Re: Hiding Link By Group
solved


Chaotic [ Fri 17 Oct, 2008 20:31 ]
Post subject: Re: SOLVED - Hiding Link By Group
How did you get it working?


DWho [ Sat 18 Oct, 2008 00:08 ]
Post 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:




Powered by Icy Phoenix