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!
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!
Well, try something like this:
Check for errors as this was done quicklyCode:{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}
Perfect! thank you very much.