AdminIEH Posted February 15, 2011 Share Posted February 15, 2011 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! 0 Quote Link to comment Share on other sites More sharing options...
omnigenus Posted February 16, 2011 Share Posted February 16, 2011 Well, try something like this: {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 0 Quote Link to comment Share on other sites More sharing options...
AdminIEH Posted February 19, 2011 Author Share Posted February 19, 2011 Perfect! thank you very much. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.