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.

Yes/No Question: use non-integer values???

Home Forums Community Forum Yes/No Question: use non-integer values???

This topic contains 6 replies, has 2 voices. Last updated by  Porwak Andessen 3 years, 1 month ago.

Topic Author Topic
Posted: Thursday Nov 21st, 2013 at 1:52 pm #61274

Quick question:

Can you use a non integer value for this function (where YY us a non-integer value such as 2.7):

< ?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS

or

< ?php if(s2member_last_login_time()

Thanks!

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Friday Nov 22nd, 2013 at 3:02 pm #61297
webboy webboy
Username: webboy

S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS is in days ,

so you could not have 1/2 of day ,

or if you wanted compare this against the current time and date for the duration
use

S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME with the days

s2member_last_login_time is just a time stamp the person last logged in

Posted: Friday Nov 22nd, 2013 at 3:17 pm #61299

webboy webboy! Thank you very much! This is a really easy fix :-)

So I’m also having a difficulty with content delivery. Would you please give me your thoughts on this dilemma also?

So, imagine that you have 5 pages (A, B, C, D and E) that you’d like to control access to.

You want the member to see content on page A immediately after signing up, but page B 20 hours, say, after the first login, BUT page C to be only shown 20 hours, AFTER the Page B was first viewed and no sooner.

And then you want page D to be shown 20 hours AFTER the Page C was first viewed and no sooner.

If the user doesn’t view page B for several days only page C would be shown on their next loggin but not page D.

The same idea for Page E – only make it available to user 20 hours AFTER page D.
How do I do this? How do I make the availability of a page dependent on the viewing of a previous page?

Thanks a LOT!

Posted: Friday Nov 22nd, 2013 at 3:39 pm #61300
webboy webboy
Username: webboy

You could do this

Write a cookie to the persons browser and start the count down from that

eg i login on page A (set the cookie) time date stamp

return back to the site

check for the cookie
if yes.. check if its > 20hrs 40hrs)

Posted: Friday Nov 22nd, 2013 at 3:52 pm #61301

My concern is that there might be many devices used.
Is there a way to have this function executed using S2Member?
Thanks very much!!

Posted: Friday Nov 22nd, 2013 at 4:18 pm #61303
webboy webboy
Username: webboy

You would have to track this type of information in the db (database) and do the checking against it

eg add the data as user meta data and every time the user logs in check this information

Posted: Friday Nov 22nd, 2013 at 4:22 pm #61304

Okay I will do this. Are there any resources that you would recommend for learning how to do this? I’ve not done anything to do with databases befrore but I’m sure I can figure it out. Do you know of any good examples?

Webboy Webboy, you are awesome for helping me

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