0

I am developing a membership site that will allow members to access old issues of a magazine produced by a charity.

I have it working up until a point, I can restrict access to each download to the 'subscribers', but I need to restrict access from all downloads available to just those produced when they were a member of the charity?

i.e.

If there are 10 downloads available numbered 111 - 120, and a member joined when issue 116 was produced, and only for four issues, (116, 117, 118, 119), how do I restrict them from accessing 111-115 and 120?

I have thought about adding a Tag element to the user data and entering the issues they are able to download into this area.

Any advice would be good :)

@flomei Thanks for the quick response @Kaiser, thanks for the response

The group goes back 30 years and they produce a quarterly magazine, hence the 120 copies. I have dabbled with php coding in the past, but I have only just started using wordpress, so I am unsure how to integrate my knowledge into the wp format.

I can see how adding a published date to the download and then a date range of the user can be used to produce a result, but if a membership had lapsed and rejoined (as they have), I am not sure how this would be done.

Each download has a 'tag' of the issue number, and I thought that if I had a field in the user table which would be filled with a list of 'tags' for the magazines that they could download, I could then reproduce a table of front page images which would link them to a download page, etc.

  • Have you tried comparing the date when a post or attachment was published with the actual registration/activation date of a user? Take a look at the DB for the meta key names for both. – kaiser Feb 29 '16 at 16:35
0

You´ll need to save some metadata for the user, possibly in two fields, like member_from and member_until which will hold your issue numbers.

In your "issue view", check whether the current issues number is between the values of those fields. If that´s the case allow access, otherwise show some "meh, no access" or "buy access" notice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.