Forum Replies Created
-
AuthorPosts
-
August 2, 2020 at 5:45 pm in reply to: Show shortcode of another plugin if member has the required membership level #20648
ishop
ParticipantHello again!
The thing is if want to show content if a user has an active membership.
I found out that querying the status or the account state as php if class would work (found it in another post!) and then give an output or a script in my case if the status is active, not changing something if user does not have access.
This is the codethat works for me,maybe it helps others:?php //Lets see if user is logged in if(SwpmMemberUtils::is_member_logged_in() == true){ // Yes. A user is logged in. // Get the user's member id. We will use this later.* $mId = SwpmMemberUtils::get_logged_in_members_id(); // Get the user's current membership account state. $auth = SwpmAuth::get_instance(); $account_state = $auth->get('account_state'); if ($account_state == 'active'){ // execute script, show subscription contents echo '<script type="text/javascript">', 'myFunction();', '</script>'; ?> <?php } ?> <?php } ?>Thank you for your help!
December 13, 2019 at 5:09 pm in reply to: Show specific content to a particular member via shortcode in frontend #19464ishop
ParticipantHi!
No it doesnt. There is no option for members who are logged in, but dont have a plan. My site doesnt have a free plan. And i want everybody to have acces who is logged in. Even if they have a plan going on. So i managed it with that plugin: https://wordpress.org/plugins/user-access-shortcodes/
It works like this[UAS_specific hint="" ids="1" admin="1"] This content can only be seen by some selected users. [2nd shortcode] [/UAS_specific]
Actually, the member numbers of WordPress and Simple membership are different, better would be to have it in one place, so if you make a new shortcode it would also be nice!
Thank you
ishopishop
ParticipantThank you very much!
ishop
Participanton the logged in page it says:
Eingeloggt als
Member
Kontostatus
Abgelaufen
Mitgliedschaft
1 Jahr
Kontoablauf
31. March 2020ishop
ParticipantWith simple membership? yes, the protect older posts and many others. but i didnt think it would have something to do with it.
ishop
ParticipantFor example it says “march” instead of “März”…
ishop
ParticipantHello again!
I made a mistake, i didnt see the loggedin.php in themes folder, deleting worked. Now the statustranslation shows as it should be. But the expiration date isnt shown in german, what can I do to reach that goal?
Thank you! -
AuthorPosts