WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
How to restrict downloads to certain roles (6 posts)

  1. carblanco
    Member
    Posted 2 years ago #

    Hi all,

    I'm running a website with some free downloads and some others for members only.
    I have some levels of membership: level0 (suscribers), level1, etc.

    How can I restrict downloads only for level0 members but keeping all the free downloads open?
    I mean:
    - visitors can access only to free downloads
    - level0 (subscriber so it's a member) can access only to free downloads
    - level1+ can access all downloads

    Thanks.

    Regards.

    http://wordpress.org/extend/plugins/download-monitor/

  2. onala
    Member
    Posted 2 years ago #

    Hi
    I have this problem tooo
    I find some plugin for this but i could not work with them.
    You can search membership on wordpress.org
    If you find some thing that work pleas share with all people.
    Thanks

  3. derekshirk
    Member
    Posted 2 years ago #

    @carbianco @onala

    I had a similar issue. I'm not sure if this will work for your scenario but I will try to explain what I ended up doing.

    I needed one page (/downloads-page) to display available downloads based on user type. I created 5 additional user types. There are several plugins out there that will allow you to do this. Or in your case you can just use the default level_0 or Level_1 capabilities to target users....

    Anyway, I created a page template for my /downloads-page and used some conditional logic to determine the users capabilities and then serve them customized content by using the default Download Monitor shortcodes.

    For example:

    [27 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Or in your case you don't want to use the $user_roles to target users but instead their capabilities you could use:

    [Ditto]

    Hope that helps.

  4. edblackwood
    Member
    Posted 2 years ago #

    @derekshirk Could you repost your reply using pastebin as it was moderated above. I would like to see your solution.

    Thanks

  5. derekshirk
    Member
    Posted 2 years ago #

    Yea, I will re-post my solution as soon as possible.

    (Sorry, I forgot about the forum rules.)

  6. derekshirk
    Member
    Posted 2 years ago #

    @carbianco @onala

    I am reposting my message since I forgot to use pastebin in my earlier post and therefore the code was moderated.

    I had a similar issue. I'm not sure if this will work for your scenario but I will try to explain what I ended up doing.

    I needed one page (/downloads-page) to display available downloads based on user type. I created 5 additional user types. There are several plugins out there that will allow you to do this. Or in your case you can just use the default level_0 or Level_1 capabilities to target users....

    Anyway, I created a page template for my /downloads-page and used some conditional logic to determine the users capabilities and then serve them customized content by using the default Download Monitor shortcodes.

    For example:

    http://pastebin.com/d5ZRsSg2

    Or in your case you don't want to use the $user_roles to target users but instead their capabilities you could use:

    http://pastebin.com/jgfLXV24

    Hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic