![]() |
Subscription Expiry Notification on Forumhome
Hack Name: Subscription Expiry Notification on Forumhome
Hack Version: 2.1 Hack Author: Kall Release: 20 April 2005 Description: Shows date of Subscription Expiry (and days remaining) on Forumhome to members with Active Subscriptions. Requested by: Mike Warner. Thanks to: MarcoH64 (big thanks to Marco), Mike Warner and The_Realist for help on day one ironing out the bugs. Files modified: 1 (root/index.php) Templates Modified: 1 (FORUMHOME) New templates: 1 (forumhome_nzb_exprydatebit) By default, this will show to people with under 30 days remaining on their Subscription and the next 5 subscriptions to expire. To change the days, change the 30 at the start of the last PHP edit to the number of days you want to show in advance. To change the number, change the 5 at the end of the sql query. This is my first hack that includes either a joining of tables or a new template or a template that can be called more than once, so I apologise in advance if a string of runaway queries turns your server into swiss cheese. :) New features in v2.1: Optimised query to only be run for non-guests and tidied up a lot. (thanks to Marco). To upgrade, simply replace the final index.php edit with the one inside the new .txt file. Updates - Fixed query thanks to MarcoH64. Extended message thanks to The_Realist. Tidied message up, XHTML-wise and gave it a nice little box. v2.0 Released. Thanks to MarcoH64 for shaming me into making it a bit more functional with his first post. |
Sorry but if i look at your code, i think you are missing some things:
- If someone have no subscription, it will show a negative days remaining and an end date of 1-1-1970 - If someone have more then 1 subscription, it will only show info for 1 (and this don't need to be the oldest) - It also runs for guests. |
Thanks for this kall! I'll throw in a few conditionals and it will run perfectly!! :D
|
There needs a few changes to make this code work better, as it is it gives minus info to none subscribed members.
As an example: Your Subscription Expires on 01-01-1970. You have -12892.74 days Remaining. Click here to renew. Laters |
That is what i described in my first reply Brian.
|
Hi Kall,
Yeh I know but Im hoping the echo would reach the developer faster :) No harm done. Laters M8 |
Quote:
OK, this should work better: HTML Code:
<if condition="$remaining < 20 AND $expirydate != '1-Jan-1970' AND $bbuserinfo[userid] != '0'"><div align="center">Your Subscription Expires on $expirydate. You have $remaining days Remaining.<br />Click <a href="$vboptions[bburl]/subscriptions.php" title="Renew Subscription">here</a> to renew.</div></if> |
Tested but it still says for none subscribed members:
Your Subscription Expires on 01-01-1970. You have -12892.89 days Remaining. Click here to renew. Quote:
|
That would be a way. Multiple subscriptions would still not show.
|
Oh bugger. It's because of the way we are displaying our dates.
Err... HTML Code:
<if condition="$remaining > 0 AND $remaining < 20 AND $bbuserinfo[userid] != '0'"> |
Yep works perfect :)
Quote:
|
Works great M8 and does what it says on the bottle :)
Edited mine a bit to: Code:
<if condition="$remaining > 0 AND $remaining < 90 AND $bbuserinfo[userid] != '0'"> |
Sweet!
Nice message....I'll stick that in the install. :) |
Well thank you. :)
|
Quote:
|
can this be done in user's profile as well? thank you
|
Probably.
It could probably be done on every page, by using the query in php_include_start.. Optimised version will be out later today, thanks to the help of MarcoH64. :) |
Good job with the update.
I want to show this just below the bit that says "You last visited: Today at xx:xx". I can handle the template changes no problem, but the hack is designed to only show on the forumhome (index.php). How would I make it so that it showed on all pages? Do I need to change global.php - if so, how? Many thanks. |
2.1 Update out today.
(Sorry, I don't know about putting it in global.php ... it might work...) |
Works like an absolute charm for me. Thanks very much.
|
Will this work with people who were added to Subscription, meaning didn't pay?
edit: It only works with PAID subscriptions, not added ones. INSTALLED and thanks |
Works great. Thanks for the hack.
|
thanks for your reply
|
*BUMP* Any news on this working for VB 3.5?
|
Just tested this, and got no errors, but nothing happened either?!
|
A 3.5 port would be great!
|
Or a PM notification would be good too!
|
Can this be ported for Version 3.6.8? The current version does not work with Version 3.6.8.
|
Any updates on this?
|
All times are GMT. The time now is 04:50 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|