Community Support Forums — WordPress® ( Users Helping Users ) — 2011-04-13T23:54:23-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=3169 2011-04-13T23:54:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3169&p=9997#p9997 <![CDATA[Re: If statement against viewed profile s2member level]]>
I'm guessing you'll be using WordPress' WP_User function to find out what role ('s2member_level1') the owner of the gallery has.

https://core.trac.wordpress.org/browser ... s.php#L462
https://phpdoc.wordpress.org/trunk/Word ... _User.html

You can find help from WP developers over at http://jobs.wordpress.net and other freelance websites.

Statistics: Posted by Cristián Lávaque — April 13th, 2011, 11:54 pm


]]>
2011-04-13T23:07:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3169&p=9993#p9993 <![CDATA[Re: If statement against viewed profile s2member level]]>
I dug a little deeper on the forum here and found the fix. I've implemented the recommended fix and it seems to work. See here for the answer:

viewtopic.php?f=4&t=1141&view=unread

J

Statistics: Posted by y2gabs — April 13th, 2011, 11:07 pm


]]>
2011-04-13T22:08:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3169&p=9706#p9706 <![CDATA[If statement against viewed profile s2member level]]>
I use the "if (current_user_can("access_s2member_level1"))" quite a bit throughout to restrict various functionality for users not at level1 (above zero). One of my core functions is the ability for a user to create a photo gallery if user level is 1. My problem is that if their subscription expires, their gallery is still visible and that's something I don't want.

This may be more of a buddypress question but is there a template tag for buddypress or s2member that I can use in an if statement similar to that above that will check the status of the profile being viewed rather than that of the user viewing that profile? Example, user X browses to user y's profile page. User y used to be level1 s2membership but has since expired. During their membership, user y created a photo gallery. I'd like it so that user X can no longer see user y's photo gallery because user y's membership has expired.

Anyway, apologies for the lengthy question, I just wanted to make sure I explained it properly :)

Any thoughts?

Thanks!

Statistics: Posted by y2gabs — April 13th, 2011, 10:08 pm


]]>