Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Subscription Expiry Notification on Forumhome Details »»
Subscription Expiry Notification on Forumhome
Version: 2.0, by kall kall is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-18-2005 Last Update: 05-05-2005 Installs: 10
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-19-2005, 12:29 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-19-2005, 01:10 PM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this kall! I'll throw in a few conditionals and it will run perfectly!!
Reply With Quote
  #4  
Old 04-19-2005, 04:46 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 04-19-2005, 07:23 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is what i described in my first reply Brian.
Reply With Quote
  #6  
Old 04-19-2005, 07:40 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Kall,

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

No harm done.

Laters M8
Reply With Quote
  #7  
Old 04-19-2005, 08:08 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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*
Reply With Quote
  #8  
Old 04-19-2005, 08:27 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would be a way. Multiple subscriptions would still not show.
Reply With Quote
  #9  
Old 04-19-2005, 08:27 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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*
Reply With Quote
  #10  
Old 04-19-2005, 09:04 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04551 seconds
  • Memory Usage 2,293KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete