This is obvious, but new users might not know: If you want to include some text or an image on your member.php page that only affiliates should see, then just edit members.html in the <templates> directory and add: PHP: {if $smarty.session._amember_user.is_affiliate} above the text and then below add PHP: {/if} For example it might like look this: PHP: {if $smarty.session._amember_user.is_affiliate} Hello affiliates - keep earning more money! {/if} Hope that helps someone out there
looks great! What about adding a piece of html code if the member has a specific membership? My membership program has different levels of membership and I would like to display different html to each member based on the level of membership they have. Any ideas?
{if in_array(1, $_SESSION[_amember_product_ids])} code for product #1 {elseif in_array(2, $_SESSION[_amember_product_ids])} code for product #2 {elseif in_array(3, $_SESSION[_amember_product_ids])} code for product #3 {/if}
OK, I tried it but got an error. Here is my code: PHP: {if in_array(10, $_SESSION[_amember_product_ids])} <img src="/img/members/bronze.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(20, $_SESSION[_amember_product_ids])} <img src="/img/members/bronze.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(6, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(9, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(18, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(17, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(15, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(11, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(19, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(4, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(12, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(8, $_SESSION[_amember_product_ids])} <img src="/img/members/gold.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(3, $_SESSION[_amember_product_ids])} <img src="/img/members/platinum.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(13, $_SESSION[_amember_product_ids])} <img src="/img/members/platinum.jpg" width="250" height="190" hspace="0" vspace="0" /> {elseif in_array(14, $_SESSION[_amember_product_ids])} <img src="/img/members/platinum.jpg" width="250" height="190" hspace="0" vspace="0" /> {/if} And here is the error it gave back: I used the code to state the product ID for each product I have in Amember, as I use many products for tracking purposes. It looked right to me, what am I missing?
Hi, Where you have this code(what template)? Try to use: $_SESSION[_amember_product_ids] $smarty.session._amember_product_ids
Trying to add this to member.html so that a specific image s hows up based on the subscription the person has currently active. I am also wondering how to choose which image will be shown if the person has 2 subscriptions active (free AND paid for example). Any ideas?
Thanks for the tip! Where can we get a listing of all the Smarty variables that are available on the various pages? It's not "obvious" unless we have a list of available variables. Smarty seems to be a VERY powerful tool, but if we don't know what variable we have to work with, that power is made useless. Thanks, Dan Kelly MiniSiteSecretsRevealed.com