Wordpress roles

Discussion in 'Integration' started by barisko, Dec 14, 2008.

  1. barisko

    barisko New Member

    Joined:
    Dec 13, 2008
    Messages:
    9
    Hi,

    I have the following setup.

    Product | Wordpress role
    =====================
    Class 1 | Subscriber
    Class 2 | Contributor
    Class 3 | Editor

    Note that being Class 2 implies that that person is also a Class 1. Someone being a Class 3 implies that that person is also a Class 2 and a Class 1. (In my organization structure this can not be done different!)

    The problem is that aMember prefers a low Wordpress role. So when somebody is a Class 1 and 2 that person is still only a subscriber in Wordpress.

    But when I delete a the Class 1 than that person becomes a Contributor Wordpress. But again: one has to be a Class 1 to become a Class 2.

    I hope that my problem is clear.
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    So your problem is you cant have 1 user be 2 classes at the same time?

    The method I use is a hack to the hidepost plugin that allows me to use the incremental plugin for amember variables to control access to the wordpress content. This way the level no longer even matters.

    David
  3. fadi

    fadi New Member

    Joined:
    Nov 22, 2008
    Messages:
    30
    I went different route completely... I have created special categories that do not show up when listing categories.

    The way I have implemented it (just finished coding it) is that I modified single.php page in WordPress and added few lines of code to do the following:

    for each user role
    if the role name = "administrator" then the user has full access
    else for each post category, if the category name = role name then user has access

    Now I can create as many roles as I want, name them Silver, Gold, Platinum
    Create 4 categories Silver, Gold, Platinum, Public

    So if a category associated with the post matches the user role, the user has access, else display custom signup page containing my sales letter.

    I can assign a post to one, two, or three roles. I can also create new roles on the fly in the system.
  4. barisko

    barisko New Member

    Joined:
    Dec 13, 2008
    Messages:
    9
    No, this is not going to solve my problem.
    I do not know how to explain it better, but I will try.

    If someone has a Class 1 subscription that person is a Subscriber in Wordpress. This is correct.
    If someone has a Class 1 and a Class 2 subscription that person should be a Contributor in Wordpress. But... in this case aMember uses the lower Wordpress role, that of Subscriber, instead of Contributor which is associated with Class 2.

    Just to be clear: I'm not trying to get a Wordpress user to have two roles (this is impossible), but: the higher the subscription level in aMember, the higher the role in Wordpress should be...
  5. fadi

    fadi New Member

    Joined:
    Nov 22, 2008
    Messages:
    30
    Let me see if I understand it correctly, I might be off...

    So a new customer comes to your site, they see multiple subscription levels: Class 1, Class 2, Class 3.

    They sign up for class 1. They get Subscriber fine.
    They update to class 2. Now they still show up as subscribers?

    I guess I am not understanding how are they getting two items in amember to begin with. What steps would a user take to produce the scenario you are describing.
  6. barisko

    barisko New Member

    Joined:
    Dec 13, 2008
    Messages:
    9
    Fadi, that is indeed correct.

    They sign up for class 1. They get Subscriber in Wordpress.
    They update to class 2. And they STILL show up as a subscriber in Wordpress. While the should get contributor.

    When I remove the class 1 subscription (and leaving class 2) then they suddenly become a contributor in Wordpress. This is a strange behavior, if you ask me.
  7. fadi

    fadi New Member

    Joined:
    Nov 22, 2008
    Messages:
    30
    Yeah I can see where this could become an issue. I wonder if they are still being billed for the subscriber subscription along with the contributor.

    Someone more experienced withamember may need to chime in, the correct behavior should be a cancelation of previous subscription and creation of the new one. I was under the impression that amember did not cancel one when another is subscribed to and may need a plugin for that.

    This would be required for upgrade and downgrade subscriptions.

Share This Page