vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Subscription Expiry Notification on Forumhome (https://vborg.vbsupport.ru/showthread.php?t=80171)

kall 04-18-2005 10:00 PM

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.

Marco van Herwaarden 04-19-2005 12:29 PM

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.

MikeWarner 04-19-2005 01:10 PM

Thanks for this kall! I'll throw in a few conditionals and it will run perfectly!! :D

The Realist 04-19-2005 04:46 PM

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

Marco van Herwaarden 04-19-2005 07:23 PM

That is what i described in my first reply Brian.

The Realist 04-19-2005 07:40 PM

Hi Kall,

Yeh I know but Im hoping the echo would reach the developer faster :)

No harm done.

Laters M8

kall 04-19-2005 08:08 PM

Quote:

Originally Posted by MarcoH64
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.

d'oh!

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>
*uploads new install file*

The Realist 04-19-2005 08:27 PM

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:

Originally Posted by kall
d'oh!

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>
*uploads new install file*


Marco van Herwaarden 04-19-2005 08:27 PM

That would be a way. Multiple subscriptions would still not show.

kall 04-19-2005 09:04 PM

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'">
How's that?


All times are GMT. The time now is 12:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01144 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete