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.

Content Dripping PHP issue

Home Forums Community Forum Content Dripping PHP issue

This topic contains 3 replies, has 2 voices. Last updated by  Eduan 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 18th, 2012 at 5:31 pm #28907

HI! I want to use the following code to control access to content based on how long a user has been a member:

< ?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 7){ ?>
Paste in text here.
< ?php } ?>

But it is displaying the code as you can see in this screenshot of the page:
(direct link to image: screenshot)

I have PHP Execution plugin installed. I thought a plugin conflict may be the cause so I disabled all plugins except S2Member, Maintenance Mode and PHP Execution and changed from my Genesis theme to an untouched TwentyEleven. It still displayed the php code as shown in the screenshot. If I use a shortcode like:

[s2If is_user_logged_in()]
    Content for anyone that is logged in, regardless of their Membership Level.
[/s2If]

it works, but I don’t think I can do the content dripping I want using a shortcode.

So, my questions are:
– why isn’t php being executed when there is no plugin conflict?
– can I use a shortcode to achieve what I want?

Thank you!!!

  • This topic was modified 4 years, 2 months ago by  Michelle M.
  • This topic was modified 4 years, 2 months ago by  Michelle M.

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Thursday Oct 18th, 2012 at 6:10 pm #28924
Eduan
Username: Eduan
Moderator

Hello Michelle,

No you can’t achieve this with shortcodes I’m afraid. I believe this is because the PHP opening tags are not correct, they are like this: < ?php[/hilite] when they should be like this: [hilite code]

Posted: Thursday Oct 18th, 2012 at 6:26 pm #28932

Thanks Eduan. I removed the space in the opening tags and deactivated the plugin I thought most likely to cause a conflict (Ultimate TinyMCE) but it still isn’t working.

I’ll have to wait until tonight to put the site in maintenance mode, deactivate everything and test it all again. I’ll post back tomorrow!

Posted: Thursday Oct 18th, 2012 at 8:27 pm #28947
Eduan
Username: Eduan
Moderator

OK, tell me how it goes.

If deactivating everything doesn’t work, then I would suggest you try using the following plugin:
http://wordpress.org/extend/plugins/raw-html/

See if putting the PHP between that plugin’s quotes works better for you. :)

– Eduan

Viewing 3 replies - 1 through 3 (of 3 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.