Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
VSa - Auto Birthday Greeter Details »»
VSa - Auto Birthday Greeter
Version: 2.0.6, by Valter Valter is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 02-16-2010 Last Update: 09-22-2010 Installs: 631
DB Changes Uses Plugins
 
No support by the author.

Info:
This hack automatically creates a birthday thread in the forum you select. Only members that allow their date of birth to be displayed will be listed, and age will be shown only for those who has chosen that. Members are shown in colors defined in usergroup settings. You can choose to exclude inactive members. Several users can be set as greeters (used randomly when posting). Thread will be created first time when someone loads forumhome after midnight.


Notes:
-This executes 1 very simple query on forumhome/in target forum.
-mktime() error? Check out this post.


Installation:
-Import XML file (as product) through AdminCP: Plugin System > Manage Products > [Add/Import Product]


To set options:
Go to: vBulletin Options > VSa - Auto Birthday Greeter


Versions:
v1.0 - Aug 26. 2007.
-Initial release
v1.4 - May 03. 2008.
-Latest vb 3.x version
v2.0 - Feb 17 2010.
-Updated for vB 4
-Added option to disable smilies
v2.0.1 - Feb 28 2010.
-New: Proper Time is now automatically detected
-Fixed: Several compatibility issues
v2.0.2 - Feb 28 2010.
-Fixed: Bug with multiple threads created
v2.0.3 - Mar 02 2010.
-Fixed mktime errors
v2.0.4 - Sep 06 2010.
-Fixed: Another bug with multiple threads created
-Fixed: Minor bugs
v2.0.5 - Sep 16 2010.
-Fixed: Multiple threads
v2.0.6 - Sep 23 2010.
-Fixed: Wrong thread creation time

Download Now

File Type: zip VSa - Auto Birthday Greeter v2.0.6.zip (4.2 KB, 2245 views)

Screenshots

File Type: jpg bdthread.jpg (84.1 KB, 0 views)
File Type: jpg acp.jpg (165.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
iiioroh, kiba snowpaw

Comments
  #172  
Old 10-08-2010, 01:35 AM
oly51's Avatar
oly51 oly51 is offline
 
Join Date: Mar 2002
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yesterday it greeted a member who lives in Norway at ~2:00pm EST (10 hours early). Today it greeted a member who lives in IL in the US ( GMT-6) at ~10:00pm (2 hours early).
Could the program be triggering on the members time zone instead of the servers?
Reply With Quote
  #173  
Old 10-14-2010, 04:35 PM
GeorgeB85 GeorgeB85 is offline
 
Join Date: Nov 2008
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is working incorrectly. on 4.0.7. It is posting the birthday messages roughly 25 hours late. I just had a posting for a members birthday that was yesterday, and it didn't post till almost 1am last night.
Reply With Quote
  #174  
Old 10-16-2010, 09:57 AM
Julie's Avatar
Julie Julie is offline
 
Join Date: Mar 2005
Location: Oslo, Norway
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've had this installed for a while now, even on 4.0, and it's been working OK, it just posted the thread too early (about an hour before midnight or so), so I just had to manually edit the date inside the thread. Which wasn't a problem, because not a lot of birthday threads were posted.

But today I had to disable it. I had two members who had a birthday, and during the night, this script posted over 100 threads :S

Hopefully there'll be an update soon, because I really like this script!
Reply With Quote
  #175  
Old 10-17-2010, 08:31 AM
kras kras is offline
 
Join Date: Mar 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Even though i have created translations of the phrases; It's still uses the default English phrases in the gratulations.
Reply With Quote
  #176  
Old 10-17-2010, 03:46 PM
woffie's Avatar
woffie woffie is offline
 
Join Date: Jan 2009
Location: Michigan
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not posting any threads. Giving up on this one.
Reply With Quote
  #177  
Old 10-27-2010, 07:07 AM
persianpros persianpros is offline
 
Join Date: May 2009
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Persian Translation

By Persian Prince
Reply With Quote
  #178  
Old 11-02-2010, 02:57 AM
kras kras is offline
 
Join Date: Mar 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The original code used the vbdate()-function in a way that created bogus times, which actually is a design flaw in the function itself. However, since the Unix timestamp is independent from the default timezone settings i see no point in the original logic anyway, unless you alter the code to take advantage of vbdate's built in hourdiff mechanism, but since that mechanism uses the current users timezone you could get pretty unpredictable times.

I have altered the code so that a current UTC time is first created and then modified with the forums' timezone setttings to create a local forum time. In short, the product works fine now with the following changes.


Replace:

PHP Code:
$vsaabgreeter_servertime mktime('0'.date('H'TIMENOW),    '0'.date('i'TIMENOW), '0'.date('s'TIMENOW), '0'.date('m'TIMENOW),    '0'.date('d'TIMENOW), '0'.date('Y'TIMENOW), -1);
 
$vsaabgreeter_forumtime mktime('0'.vbdate('H'TIMENOW),    '0'.vbdate('i'TIMENOW), '0'.vbdate('s'TIMENOW), '0'.vbdate('m',    TIMENOW), '0'.vbdate('d'TIMENOW), '0'.vbdate('Y'TIMENOW), -1);
 
 
$vsaabgreeter_propertime TIMENOW;
 if (
$vsaabgreeter_servertime $vsaabgreeter_forumtime)
 {
         
$vsaabgreeter_timeoffset $vsaabgreeter_servertime $vsaabgreeter_forumtime;
         
$vsaabgreeter_propertime TIMENOW $vsaabgreeter_timeoffset 10;
 }
 else
 {
         
$vsaabgreeter_timeoffset $vsaabgreeter_forumtime $vsaabgreeter_servertime;
         
$vsaabgreeter_propertime TIMENOW $vsaabgreeter_timeoffset 10;
 }
 
 
$vsaabgreeter_execdate date('m-d'$vsaabgreeter_propertime);
 
 
$vsaabgreeter_done false;
 
$vsaabgreeter_posted $vbulletin->db->query_read(" SELECT daydone    FROM " TABLE_PREFIX "vsa_birthdaythread WHERE daydone =    '".$vbulletin->db->escape_string($vsaabgreeter_execdate)."' ");
 
 if (
$vbulletin->db->num_rows($vsaabgreeter_posted) > 0)
 {
         
$vsaabgreeter_done true;
 }
 
 
$vsaabgreeter_exechour date('H'$vsaabgreeter_propertime); 
[hr]-[/hr]

With:

PHP Code:
 $vsaabgreeter_Time = new DateTime("now", new DateTimeZone('UTC'));
 
$vsaabgreeter_offset $vbulletin->options[timeoffset];
 
$vsaabgreeter_Time->modify(($vsaabgreeter_offset >= '+' $vsaabgreeter_offset $vsaabgreeter_offset) . 'hour');
 
 
$vsaabgreeter_execdate $vsaabgreeter_Time->format('m-d');
 
 
$vsaabgreeter_done false;
 
$vsaabgreeter_posted $vbulletin->db->query_read(" SELECT daydone  FROM " TABLE_PREFIX "vsa_birthdaythread WHERE daydone =  '".$vbulletin->db->escape_string($vsaabgreeter_execdate)."' ");
 
 if (
$vbulletin->db->num_rows($vsaabgreeter_posted) > 0)
 {
         
$vsaabgreeter_done true;
 }
 
 
$vsaabgreeter_exechour $vsaabgreeter_Time->format('H'); 
[hr]-[/hr]


Note that the exclude times are still there, which by default means that no threads will be created after 20:00. These times can be altered in the array shown below


PHP Code:
 $vsaabgreeter_exchrs = array(20,21,22,23); 
[hr]-[/hr]

or removed completely by replacing:

PHP Code:
 $vsaabgreeter_exechour $vsaabgreeter_Time->format('H');
 
$vsaabgreeter_exchrs = array(20,21,22,23);
 
 if (!
$vsaabgreeter_done AND !in_array($vsaabgreeter_exechour$vsaabgreeter_exchrs)) 
[hr]-[/hr]

with

PHP Code:
 if (!$vsaabgreeter_done
[hr]-[/hr]

Attached is a file with all changes.
Attached Files
File Type: zip VSa_ABG.zip (3.2 KB, 109 views)
Reply With Quote
  #179  
Old 11-02-2010, 10:56 AM
voglermc's Avatar
voglermc voglermc is offline
 
Join Date: Oct 2006
Location: Piedmont Triad, NC, USA
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Kras!
Reply With Quote
  #180  
Old 11-02-2010, 12:00 PM
voglermc's Avatar
voglermc voglermc is offline
 
Join Date: Oct 2006
Location: Piedmont Triad, NC, USA
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kras, I'm getting this error since installing your version

Warning: DateTime::modify() [datetime.modify]: Failed to parse time string (hour) at position 0 (h): The timezone could not be found in the database in [path]/includes/class_bootstrap.php(517) : eval()'d code on line 91
Reply With Quote
  #181  
Old 11-02-2010, 12:19 PM
-=Leb=-'s Avatar
-=Leb=- -=Leb=- is offline
 
Join Date: Jan 2008
Location: Sweden
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't install it without valter's permission!
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 06:58 AM.


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.05229 seconds
  • Memory Usage 2,379KB
  • Queries Executed 28 (?)
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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete