Incremental Plugin - showing only current subscription weeks

Discussion in 'Integration' started by behaviourneeds, Mar 30, 2010.

  1. behaviourneeds

    behaviourneeds Member

    Joined:
    Jan 26, 2010
    Messages:
    47
    Hi,
    I found the snippit of code to show the current weeks subscribed and it works, However I want to be only show those weeks that it needs to.

    For instance if am signed into 'subscription 1' it only shows the weeks pertaining to 'subscription 1' and not subscription 1 2 and 3 as it currently does.

    PHP:
    <?php

    if ($_SESSION['_amember_links'])
    {
        echo 
    "<ul>";
        foreach (
    $_SESSION['_amember_links'] as $link_id => $link)
        {
            echo 
    "<li><a href=\"".$link['link_url']."\">".$link['link_title']."</a></li>";
        }
        echo 
    "</ul>";
    }
    ?>
    I hope that makes sense.....
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    You mean the user has multiple product orders with different subscription times? Or its showing links it shouldnt be? (try clearing your cache etc.)

    David
  3. behaviourneeds

    behaviourneeds Member

    Joined:
    Jan 26, 2010
    Messages:
    47
    Hi,
    Say if I have 2 subscriptons and the user is signed up for them both. If I put the posted code inside a page within either protected area it will list all the available links regardless of the currently protected area.
    What I want is a way of filtering that list based on the current area they are in. So that if the user is currently browsing subscription 1, then only the links for subscription 1 is showing likewise for subscription area 2.
    I have managed to fudge it with
    PHP:
    <?php

    if ($_SESSION['_amember_links'])
    {
        
        echo 
    "<ul>";
        
        
        foreach (
    $_SESSION['_amember_links'] as $link_id => $link)
            {
                if(
    $link['link_product_id']=='4')
                    {
                        echo 
    "<li><a href=\"".$link['link_url']."\">".$link['link_title']."</a></li>";
                    }
            
            }
        echo 
    "</ul>";
    }

    ?>
    but that requires me to edit it each time I use it in a different area (no big deal I agree)

    Cheers
    Chris
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    You can use incremental groups, and then display/not display based on the group.

    David

Share This Page