[insert_php]
remove_filter(‘the_content’, ‘wpautop’); //Remove stupid fucking auto p addition:

//Determine the user memberships:
$userID = get_current_user_id();

//Get each membership package as we go:
$afl = wc_memberships_is_user_active_member($userID, ‘afl-betting-tips’);
$nrl = wc_memberships_is_user_active_member($userID, ‘nrl-best-bets’);
$greyhound = wc_memberships_is_user_active_member($userID, ‘greyhound-guru’);
$bestBets = wc_memberships_is_user_active_member($userID, ‘best-bets’);
$ratingsMelbourne = wc_memberships_is_user_active_member($userID, ‘ratings-melbourne’);
$ratingsNSW = wc_memberships_is_user_active_member($userID, ‘ratings-nsw’);
$trialSpy = wc_memberships_is_user_active_member($userID, ‘trial-spy’);
$snowysBets = wc_memberships_is_user_active_member($userID, ‘snowys-bets’);
$hilow = wc_memberships_is_user_active_member($userID, ‘hi-lo’);
$laysBetfair = wc_memberships_is_user_active_member($userID, ‘lays-betfair’);
$mattsSportsBets = wc_memberships_is_user_active_member($userID, ‘matts-sports-bets’);
$soccerAdvisor = wc_memberships_is_user_active_member($userID, ‘soccer-advisor’);

//Add package category ID to an array:
$allPackages = array(); //Holds all packages:

//Create a temporary array for holding the packages:
$tempArray = array (
“categoryId” => NULL,
“packageName” => NULL
);

if($afl) {
$tempArray[“categoryId”] = 26;
$tempArray[“packageName”] = “AFL – Tips”;
array_push($allPackages, $tempArray);
}
if($nrl) {
$tempArray[“categoryId”] = 25;
$tempArray[“packageName”] = “NRL – Best Bets”;
array_push($allPackages, $tempArray);
}
if($greyhound){
$tempArray[“categoryId”] = 36;
$tempArray[“packageName”] = “Greyhound Guru”;
array_push($allPackages, $tempArray);
}
if($bestBets){
$tempArray[“categoryId”] = 31;
$tempArray[“packageName”] = “Tips – Best Bets”;
array_push($allPackages, $tempArray);
}
if($ratingsMelbourne){
$tempArray[“categoryId”] = 33;
$tempArray[“packageName”] = “Ratings – Melbourne”;
array_push($allPackages, $tempArray);
}
if($ratingsNSW){
$tempArray[“categoryId”] = 32;
$tempArray[“packageName”] = “Ratings – NSW”;
array_push($allPackages, $tempArray);
}
if($trialSpy){
$tempArray[“categoryId”] = 30;
$tempArray[“packageName”] = “Trial Spy”;
array_push($allPackages, $tempArray);
}
if($snowysBets){
$tempArray[“categoryId”] = 29;
$tempArray[“packageName”] = “Snowy’s Bets”;
array_push($allPackages, $tempArray);
}
if($hilow){
$tempArray[“categoryId”] = 38;
$tempArray[“packageName”] = “High-Low”;
array_push($allPackages, $tempArray);
}
if($laysBetfair){
$tempArray[“categoryId”] = 28;
$tempArray[“packageName”] = “Lays – Betfair”;
array_push($allPackages, $tempArray);
}
if($mattsSportsBets){
$tempArray[“categoryId”] = 23;
$tempArray[“packageName”] = “Matt’s Sports Bets”;
array_push($allPackages, $tempArray);
}
if($soccerAdvisor){
$tempArray[“categoryId”] = 24;
$tempArray[“packageName”] = “Soccer Advisor”;
array_push($allPackages, $tempArray);
}

//Echo the header of the table:
echo ‘

Premium Package Tips & Bets

    • ‘;

//Cycle through all of the packages:
foreach($allPackages as $key => $thePackage) {

//If it’s the first spot, output the active tab li:
if($key == 0)
echo ‘

  • ‘;
    else //Else, just output the normal li element:
    echo ‘
  • ‘;//Run through the category and pull out the tabs:
    echo ‘

    ‘.$thePackage[“packageName”].’

    ‘;
    //Echo out the main title:
    echo ‘

    ‘.$thePackage[“packageName”] .’

    ‘;

    //Run through the category and pull out the latest posts from that section:
    $args = array( ‘posts_per_page’ => 20, ‘offset’=> 1, ‘category’ => $thePackage[“categoryId”] );
    $allPosts = get_posts( $args );

    /*foreach ($allPosts as $thePost) {

    //var_dump($thePost);

    $postID = $thePost->ID;
    $permaLink = get_permalink($postID);
    $postContent = ‘

    ‘. $thePost->post_content .’

    ‘;
    $postTitle = $thePost->post_title;
    $postLength = strlen($thePost->post_content);

    //If post is too long, cut it at 150 characters
    if($postLength > 150) {
    $postContent = substr($postContent,0,150);
    $postContent = $postContent . ‘Read More‘;
    }

    //Echo out the tip title and the content:
    echo ‘

    ‘.$postContent.’

    ‘;

    //var_dump($thePost);

    }*/

    //Reset the post data for looping around again:
    wp_reset_postdata();

    //Close the li:
    //echo ‘

  • ‘;
    }
    [/insert_php]