latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Hide PHP code from members.

Home Forums Community Forum Hide PHP code from members.

Tagged: 

This topic contains 7 replies, has 4 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 18th, 2012 at 3:20 pm #28895
Deyson Ortiz
Username: deyson

Hello.

How can I hide this code in my PHP from members that are logged in:

Download all publish; ?> templates for only $50! That is less than $1.99 a template!

Once a member is in there is no need for them to see this.

I tried using the php codes that are in the help menus but I had no luck.

Thank you :)

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Thursday Oct 18th, 2012 at 6:58 pm #28944
Raam Dev
Username: Raam
Staff Member

This should work:

<?php if (is_user_logged_in()) {  ?>
	Templates for only $50! That is less than $1.99 a template!
<?php } ?>
Posted: Thursday Oct 18th, 2012 at 7:07 pm #28945
Deyson Ortiz
Username: deyson

This will hide it from members that are logged in?

Posted: Thursday Oct 18th, 2012 at 9:24 pm #28953
Eduan
Username: Eduan
Moderator

Hello Deyson,

It has the opposite result. :)

Posted: Friday Oct 19th, 2012 at 7:16 am #28977
Deyson Ortiz
Username: deyson

Would the proper way be:

<?php if (is_user_logged_out()) {  ?>
	Templates for only $50! That is less than $1.99 a template!
<?php } ?>

Thank you :)

  • This reply was modified 4 years, 2 months ago by  Deyson Ortiz.
Posted: Friday Oct 19th, 2012 at 9:28 am #29001

No, for not logged in you’d use [hilite code]!is_user_logged_in()[/hilite] or [hilite code]is_user_not_logged_in()[/hilite]. ;)

Posted: Friday Oct 19th, 2012 at 10:52 am #29029
Deyson Ortiz
Username: deyson

Awesome! Thank you! :)

Posted: Saturday Oct 20th, 2012 at 8:11 am #29122

You’re welcome. :)

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.