Results 1 to 3 of 3

Thread: Show only if user is Affiliate

  1. #1
    Join Date
    Sep 2010
    Posts
    13

    Default Show only if user is Affiliate

    Greetings,

    There are some menus and sections that I only want to display if the user is activated as an affiliate, but I cannot find how to do this. Any help is greatly appreciated!

  2. #2
    Join Date
    Mar 2010
    Posts
    34

    Default

    Well, try something like this:

    Code:
    {php}
    	// take the user's id
    	$userID = $_SESSION["uid"];
    	
    	// try to find that user amon affiliates	
    	$sql = "SELECT id FROM tblaffiliates WHERE clientid = ".$userID;
    	$result = mysql_query($sql);
    	$rows = mysql_num_rows($result);
    	
    	// if found
    	if ($rows > 0)
    	{
    		$this->assign('isAffiliate',"Y");
    	}
    	// if not
    	else
    	{
    		$this->assign('isAffiliate',"N");
    	}
    {/php}
    
    {if $isAffiliate eq "Y"}
    	show the menu
    {/if}
    Check for errors as this was done quickly

  3. #3
    Join Date
    Sep 2010
    Posts
    13

    Default

    Perfect! thank you very much.

Similar Threads

  1. Show decline reason to user
    By openmind in forum Feature Requests
    Replies: 23
    Last Post: 06-30-11, 06:29 PM
  2. Ticket system show non registered user email
    By cyberneticos in forum Feature Requests
    Replies: 0
    Last Post: 05-10-09, 10:41 AM
  3. show affiliate link only if already affiliate
    By Malware in forum Customisation & Integration Questions
    Replies: 3
    Last Post: 04-12-07, 11:15 PM