https://www.icyphoenix.com/viewtopic.php?f=35&t=4811
-----------------------------------
DWho
Tue 30 Sep, 2008 12:46

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 linenumbers=false]  $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()); 
	}[/code]

and in the tpl file you need it

[code linenumbers=false]	
<!-- BEGIN non_vips_only --> 
CODE HERE
<!-- END non_vips_only -->[/code]

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

in the code you have [color=darkred]USER GROUP ID HERE[/color] 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

Re: Hiding Link By Group
-----------------------------------
solved


-----------------------------------
Chaotic
Fri 17 Oct, 2008 20:31

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


-----------------------------------
DWho
Sat 18 Oct, 2008 00:08

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:


