Tips and Tricks HQ Forum

Support Forum for Tips and Tricks HQ Products

Register or log in - lost password?

Search the Forum

Tips and Tricks HQ Forum » WP eMember » WP eMember General Questions

Navigation and Drip Feed Content

(5 posts) (2 voices)
  • Started 1 year ago by IMGIGClub
  • Latest reply from IMGIGClub
  • Related Topics:
    1. Drip content - con job set up
    2. Auto upgrade/Drip content not working properly
    3. A couple of clarifications regarding to Auto Upgrade feature
    4. Add main site links to affiliate platform
    5. "Breadcrumbs" question

Tags:

  • Drip content
  • emember_protected
  • navigation
  • page links
  1. IMGIGClub
    Member

    I hope there is something obvious that I'm just not thinking of.

    I have 6 lessons on a drip-feed ecourse. When a person is on lesson 4, they have access to lessons 1 to 4.

    So if a member logs in and views lesson 4, I'd like to have links there to lesson 1, 2 and 3. Easy enough.

    Now, if that members clicks to view Lesson 2 - Help! How do I set up Lesson 2 so it has links to Lessons 1-4 when a member at Level 4 views it? When a member at level 2 views Page 2, it should only show links to lessons 1 and 2. (I don't want to "leak" the title of lessons 3 to 6 to this level 2 member.)

    [ Related to this - is there a way to access the member level of the current logged-in member on my pages? If so, I think I can code up my menus the way I want them. ]

    Posted 1 year ago #
  2. amin007
    Key Master

    You can use section protection for a particular membership level (see the "Section Protection for Specific Membership Level Example" section):

    http://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88

    Here is an example code that lets you find out if a member is logged in and what his membership level is:

    global $auth;
    $user_id = $auth->getUserInfo('member_id');
    if (!empty($user_id))
    {
        //User is logged in so add your conditional code here
        $membership_level = $auth->getUserInfo('membership_level');
        if($membership_level == 1)
        {
            //Add stuff for this level
        }
    }
    Posted 1 year ago #
  3. IMGIGClub
    Member

    Amin,

    Thank you. I believe I can figure this one out from here.

    I appreciate the nice, complete answer. And that was quick, too.

    Very nice!

    Regards,
    Tim

    Posted 1 year ago #
  4. IMGIGClub
    Member

    Ah, and now I need to ask for more help!

    When I use the [emember_protected for=3-4-5] [/emember_protected] code blocks things are great when the use is authorized to access the content.

    But when the member is not authorized, what I'd like is for basically nothing to happen. What does happen is that a message is printed explaining that there is content on the page that the person cannot access.

    What I want this to look like for my Level 3 member:
    Step 1 | Step 2 | Step 3 <== These would be links - allowed pages.
    Step 4 | Step 5 | Step 6 <== No links - member is not allowed to view.

    What does display now:

    Step 1 | Hidden content is forbidden for this membership level.
    Please Renew your account.Step 2 | Step 3
    Step 4 | Step 5 | Step 6

    Is there another way to use this function so it does its checks, but does NOT print any error messages?

    What I want to have is my 6 page links on every page. The pages a member can access will be enabled with a link; pages they cannot access will simply be text - no link.

    Thanks,
    Tim

    Posted 1 year ago #
  5. IMGIGClub
    Member

    Ok, using plugin exec-php and the PHP code provided, this works great!

    <div style="float: right; margin-right: 30px;">
    <?php
    global $auth;
    $user_id = $auth->getUserInfo('member_id');
    if (!empty($user_id))
    {
    //User is logged in so add your conditional code here
    $membership_level = $auth->getUserInfo('membership_level');

    if($membership_level >= 3)
    {
    //Add stuff for this level
    echo('Step 1');
    }
    if($membership_level >= 4)
    {
    //Add stuff for this level
    echo(' | Step 2');
    }
    if($membership_level >= 5)
    {
    //Add stuff for this level
    echo(' | Step 3
    ');
    }
    if($membership_level >= 7)
    {
    //Add stuff for this level
    echo(' Step 4');
    }
    if($membership_level >= 8)
    {
    //Add stuff for this level
    echo(' | Step 5');
    }
    if($membership_level >= 9)
    {
    //Add stuff for this level
    echo(' | Step 6');
    }

    }
    ?>

    </div>

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Tips and Tricks HQ Forum is proudly powered by bbPress

Tips and Tricks HQ  | WP Shopping Cart  | WP Affiliate Software  | WordPress Membership Plugin