Just to confirm my banner for nearly expired paid subscriptions modification detailed
here still works with this version. As the location of where to put the template changes have changed I'll re-copy the original post here and update it.
If like me, you want a banner to be displayed to people who have a paid subscription which is about to expire, you can achieve it with the following.
Firstly create a global phrase named "welcome_soontoexpire" containing the message you want displayed. I chose the following...
Code:
<center><strong>Your Club Membership will expire in {1} days.</strong><br /><br />We hope you will choose to stay with us!</center>
...which will tell them their paid subscription is about to run out, plus it will tell them the number of days they have left.
Next edit the "welcome_headers" template and add...
PHP Code:
<if condition="$headerexpiremembership != 0">
<!-- / membership nearly expired -->
<br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" style="background-color:#FF0000;">
<phrase 1="$headerexpiremembership">$vbphrase[welcome_soontoexpire]</phrase>
</td>
</tr>
</table>
<!-- / membership nearly expired -->
<else />
...before this line of code.
PHP Code:
<if condition="$wlhtime > $bbuserinfo[lastpost] AND $vboptions[wlhpostmoreoften] AND !is_member_of($bbuserinfo,6,5)">
Also add the following to the end of the template, just before the "<!-- google_ad_section_end -->" line...
Finally create a plugin for the "Welcome Headers" product with a hook location of "global_start". Set the title to "Soon to expire memberships", and add the following as the PHP plugin code.
PHP Code:
$subscriptions_reminders = $vbulletin->db->query_read("
SELECT subscriptionid, expirydate
FROM " . TABLE_PREFIX . "subscriptionlog AS subscriptionlog
WHERE expirydate <= " . (TIMENOW + (86400 * 14)) . "
AND status = 1
AND userid = " . $vbulletin->userinfo['userid'] . "
");
while ($subscriptions_reminder = $vbulletin->db->fetch_array($subscriptions_reminders))
{
$headerexpiremembership = round((($subscriptions_reminder['expirydate'] - TIMENOW) / 86400),1);
}
That's it! It is hard coded to display the banner when the paid subscription has 14 days or less remaining. You can change the 14 on the following line to be however many days notice you want.
PHP Code:
WHERE expirydate <= " . (TIMENOW + (86400 * 14)) . "