Hi, I was wondering how this is possible... I currently have 3 levels of membership (Bronze, Silver, Gold...). I have links to all three protected areas in the members area, visible to all no matter what level you are. So if a Bronze member clicks on the Silver link, he is naturally directed to the login page alerting him that he does not have access to this page. Same thing for the Silver who clicks on the Gold link. Is it possible to customize the error page or message to be specific to the link. For example, when the Bronze clicks on Silver, I want to list all the reasons to upgrade to Silver, etc. What file can I begin to modify to achieve this? Thanks a lot. Josh
Josh you need to customize /amember/plugins/protect/php_include/check.inc.php and possible show different template depending on products user have.
OK, so how about this solution... Since I can already call the member's name by using PHP: <?php echo ($_SESSION[_amember_user][name_f]); ?> Is there a similar php function what will achieve the following: PHP: if ( amember user does not have product_id 6 ) { echo "<a href=\"this.html\">"; } else { echo "a href=\"that.html\">"; } Thanks. -Josh
It's in the documentation: Code: session_start(); $need_one_from = array(3,4); if (array_intersect($need_one_from, $_SESSION['_amember_product_ids'])){ print "User is subscribed to product #3 or product #4"; } else { print "User is not subscribed nor to product #3, nor to product #4"; }
Additional Question regarding this code and specifically the "session_start();" part... Is it mandatory for the session_start(); part to be at the very top of the php page, or is it ok to simply place it within the code on the page when I need it? I ask because it's going to go in a uniform menu bar and is not practical for me to go in and add the session_start(); code to the top of ALL php pages. Is there something I need to consider if I place it in the menu code? Thanks.
You did not indicate which platform you are using to deliver the premium content. If you are using WordPress, this plug-in, under development by aMember, will do this. You make a post and define it as an aMember error message with a custom field. Then you can assign the custom written error message to any of the protection levels. Good Luck!
Hey Grant, Thanks for that link... I am not, however, using Wordpress. This code will go on my php file on my website. Thanks.
yes it should be at the top of the page. If there will be any html or php output before session_start() warning will be generated by php