News:

Wondering if this will always be free?  See why free is better.

Main Menu

Subscription status block

Started by SteveW, September 28, 2015, 05:02:06 PM

Previous topic - Next topic

SteveW

Hi - I'm using SimplePortal (yes I have posted on their forums without any reply 6 months ago) and I'm looking at putting up a block showing the current status of a subscription, and the expiry date, very much like on the profile subscription page as attached.

The following code gives a start to it:

global $user_info, $scripturl;

//For subscription that gives group ID 12
if (in_array(12, $user_info['groups']))
{
echo '<b>Partnership: <font color="green">Active</font></b><br />';
}
else
{
echo '<b>Partnership: <font color="red">Inactive</font></b><br /><a href="' . $scripturl . '?action=profile;area=subscriptions">Join Partnership</a>';
}

//For subscription that gives group ID 13
if (in_array(13, $user_info['groups']))
{
echo '<b>Partnership: <font color="green">Active</font></b><br />';
}
else
{
echo '<b>Partnership: <font color="red">Inactive</font></b><br /><a href="' . $scripturl . '?action=profile;area=subscriptions">Join Partnership</a>';
}


And outputs like this:

Quote12 Month Membership: Active

However, is it possible to put the start & end date underneath easy?

Quote12 Month Membership: Active
QuoteStart : February 05, 2012, 20:41:00 PM
QuoteApril 03, 2016, 21:17:26 PM

I'm no good at coding, I've tried to see how it can be done but I'm struggling! :)

Watch the skies!!

Advertisement: