Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hektorjg

    (@hektorjg)

    Thanks! I found out how to do it really simple.
    I changed two things:
    1.- In the message row, display:inherit. Like you said, the message is taken but not shown. In this way I force it to display it.

    2.- Get rid of message icons. Replacing the highlighted code in the link before with the following code:

    $value = '';
    $value .= '<div class="rtb-message-data">' . $booking->message . '</div>';

    This will show the message without the link icon.

    As you mentioned, this will show the message in the column, but It won’t in a new row like now, because It’s more complicated.
    This is a quick fix for it.
    Thank you for your fast reply!

    Thread Starter hektorjg

    (@hektorjg)

    Thanks for the help.
    The level_id were correct. From 1 to 3. In addition, the last code you gave me did nothing, the users keep in level_id 1 and they dont become level 3.
    I finally found the solution: you are forced to work with both levels at the same time, as you mentioned before:

    Just to add too, with all of this, you can actually see that at its core, Membership is capable of multiple simultaneous access levels and subscriptions.

    I was blocking the access to the pro features if you are free, and that was my big problem if you want pro and free levels live together in the same user, so I had to “re-formulate” the restrictions so you can access the pro features meanwhile you are free user at the same time.

    So I used one of the previous code, but deleting the “drop_level”

    function addusertolevel( $user_id, $level_id_add ) {
    	if ( class_exists( 'M_Membership' ) ) {
    		$member = new M_Membership($user_id);
    		$member->add_level( $level_id_add );
    	}
    }
    
    $user_id = get_current_user_id();
    addusertolevel( $user_id , 3 );

    Thank you very much for the help.
    Cheers!

    Thread Starter hektorjg

    (@hektorjg)

    Thanks for all the help, Its helping me a lot, but It’s not working.
    When I use the “new” code, they still belong in the first level.
    I mean:
    Membership level
    Before the code (Free user)
    After the code (Free user, Paid user)
    I cant delete the Free user level with the drop_level. But you mean you can still work with it, I would like to ask for more help :S

    My main problem for this is:
    Two different URL groups

    • for non-suscribers they wont be able to look any of the links
    • if they are Free users they will be able to see URL group 1
    • if they are Paid user they can see URL group 1 and URL group 2

    After the code with my actual configuration, “officially” they belong Free user and Paid member, so they could access Urlgrp 1 from free user and Urlgrp 1&2 from paid user level, but actually they only can access Urlgrp 1.
    How do you think I have to change, whether the code or the restrictions, to make this configuration happen?

    Thread Starter hektorjg

    (@hektorjg)

    Ok, I changed the code a bit, because i want the current user who access this page to be upgraded, so when i call the function i ask to get current user instead of upgradin the user_id you put in the function.

    function myaddusertolevel( $user_id, $level_id ) {
    if ( class_exists( ‘M_Membership’ ) ) {
    $member = new M_Membership($user_id);
    $member->add_level( $level_id );
    }
    }

    $user_id = get_current_user_id();
    myaddusertolevel( $user_id , 3 );
    (I add them to level_id=3)

    The problem now is: The user is in both level_id 1 and 3, and the content restriction for only level_id 3 is not working because (i think) they still belong to level 1.

    So I would like to know how to improve the code so deletes current subscription and upgrades to the one i put.

    Thanks a lot for the help

Viewing 4 replies - 1 through 4 (of 4 total)