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
Automatic Birthday Thread Details »»
Automatic Birthday Thread
Version: 1.00, by ChurchMedia ChurchMedia is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 03-17-2004 Last Update: Never Installs: 115
 
No support by the author.

This hack is inspired by the Birthday Hack for vB2 by Logician. It will automatically create a Happy Birthday thread in a specified forum, listing the people with birthdays for that day. Then other members can post their happy birthday wishes in the thread.

I had the original hack installed on my VB2 board and when I upgraded to VB3 my members missed it. Luckily, it's really easy to implement.

--------------------------------------
Files to modify: /includes/cron/birthday.php
--------------------------------------

Instructions are in the attached text file. The mod should take about 5 minutes.

Be sure to change the variables that say // CHANGE ME

You can customize the message in the $birthday_greeting_thread variable. You could also ad IMG tags with an image of some kind, like in my screenshot.

Note that you MUST turn on BB CODE in you birthday forum in order for this to work properly.
--------------------------------------
Enjoy (and thanks for the inspiration, Logician!)
--------------------------------------

New in Version 2.0:

Bug fixes:
> More accurate age calculation. Sometimes it was a year off.
> The correct thread shows up in the last thread post on the forum home page.
> HTML is not required to be turned on in the birthday forum.
> Most of the code is completely rewritten to vB3 standards.

New features:
> Improved look
> Birthday line now says: (User) was born on (date), (AGE: xx)
> If the year is not given, it says "Not telling! " for age.
> The admin is emailed a list of the birthdays with links to their profiles and a link to the happy birthday thread.
> If you use the uShop/uCash hack, you can give birthday points to the users

Upgrading:

Since the code has changed so drastically, I suggest starting with a fresh copy of birthday.php and following the instructions for a new install.

Show Your Support

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

Comments
  #12  
Old 03-18-2004, 03:32 PM
[email protected] vbmenu_register("postmenu_486546", true);
Guest
 
Posts: n/a
Default

I've done the following modifications and it works fine now. Enhanced the title a little too.

--------------------------------------
UNDER
PHP Code:
$emails .= $userinfo['username']; 

ADD
PHP Code:
$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n"
$bday_title .= $username.", "
--------------------------------------
UNDER
PHP Code:
log_cron_action('Birthday Email sent to: ' $emails$nextitem); 

ADD
PHP Code:
// Create Birthday Thread Hack 
$birthday_greeting_thread "Here are today's birthdays!<br><br>$bday_people"

$greeter=11064//Your User ID
$greeter_name="Happy Birthday"//Your User Name
$greetings_forum=6//enter the forum id that you want the thread to go into
$todays_date11date("F j, Y"mktime (date("H")+$timesetdate("i"), date("s"), date("m"), date("d"), date("Y")));
$title3"Happy Birthday to ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($title3))."','".time()."','$greetings_forum','1','0','".addslashes($greeter_name)."','$greeter','".addslashes($greeter_name)."','".time()."','0','1','0')");
$log_threadid=$DB_site->insert_id();
// Creating Post
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$log_threadid','".addslashes(htmlspecialchars($title3))."','".addslashes($greeter_name)."','$greeter','".time()."','".addslashes($birthday_greeting_thread)."','1','0','127.0.0.1','0','1')");
// End Create Birthday Thread Hack 
Reply With Quote
  #13  
Old 03-18-2004, 03:37 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not bad, although if you could get it to make individual threads it would be even better
Reply With Quote
  #14  
Old 03-18-2004, 03:43 PM
Vb-Hispano's Avatar
Vb-Hispano Vb-Hispano is offline
 
Join Date: Feb 2003
Location: Barcelona Spain
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MK@spug.net
I've done the following modifications and it works fine now. Enhanced the title a little too.

--------------------------------------
UNDER
PHP Code:
$emails .= $userinfo['username']; 

ADD
PHP Code:
$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n"
$bday_title .= $username.", "
--------------------------------------
UNDER
PHP Code:
log_cron_action('Birthday Email sent to: ' $emails$nextitem); 

ADD
PHP Code:
// Create Birthday Thread Hack 
$birthday_greeting_thread "Here are today's birthdays!<br><br>$bday_people"

$greeter=11064//Your User ID
$greeter_name="Happy Birthday"//Your User Name
$greetings_forum=6//enter the forum id that you want the thread to go into
$todays_date11date("F j, Y"mktime (date("H")+$timesetdate("i"), date("s"), date("m"), date("d"), date("Y")));
$title3"Happy Birthday to ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($title3))."','".time()."','$greetings_forum','1','0','".addslashes($greeter_name)."','$greeter','".addslashes($greeter_name)."','".time()."','0','1','0')");
$log_threadid=$DB_site->insert_id();
// Creating Post
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$log_threadid','".addslashes(htmlspecialchars($title3))."','".addslashes($greeter_name)."','$greeter','".time()."','".addslashes($birthday_greeting_thread)."','1','0','127.0.0.1','0','1')");
// End Create Birthday Thread Hack 

Not Working

There seems to have been a slight problem with the Foros xxxxxxxxx database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.


:disappointed:
Reply With Quote
  #15  
Old 03-18-2004, 05:21 PM
Memnoch-NMX- Memnoch-NMX- is offline
 
Join Date: Dec 2001
Location: San Antonio, TX
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rushty
Is it possible to specify only specific users groups that it selects birthdays from, and if not any possibility of the option in a future version?
I'd like to see this option as well. I have a news script that generats news on the main page of my site based on a specific forum id. We only post birthday news for Admins and Super Mods of the forum. All other birthday announcements go in my Gen Chat forum.
Reply With Quote
  #16  
Old 03-18-2004, 05:22 PM
M.C. M.C. is offline
 
Join Date: Jan 2002
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i`d love to see instructions file attached to first post
Reply With Quote
  #17  
Old 03-19-2004, 01:38 AM
ChurchMedia's Avatar
ChurchMedia ChurchMedia is offline
 
Join Date: Dec 2002
Location: Las Cruces, NM
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For those of you having errors, there were some spaces added to the queries when I pasted the code (??). I've attached instructions in a text format. Copy from there and it should work.

MK@spug.net: Nice addition

sabret00the: To create individual threads for each birthday, just move the step 3 code up underneath the $bday_people = .... line. It should work, but I haven't tried it.

As far as usergroups, I'm still getting the hang of VB3.

Enjoy,
Reply With Quote
  #18  
Old 03-19-2004, 01:50 AM
M.C. M.C. is offline
 
Join Date: Jan 2002
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanx a lot man!
Reply With Quote
  #19  
Old 03-19-2004, 04:41 AM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ChurchMedia
This hack is based on the Birthday Hack by Logician and includes some of the original code. It will automatically create a Happy Birthday thread in a specified forum, listing the people with birthdays for that day. Then other members can post their happy birthday wishes in the thread.

I had the original hack installed on my VB2 board and when I upgraded to VB3 my members missed it. Luckily, it's really easy to implement.

--------------------------------------
Files to modify: /includes/cron/birthday.php
--------------------------------------

Instructions are in the attached text file. The mod should take about 5 minutes.

Change the variables for the userid, username and forumid.

You can customize the message in between the <<< EOF and EOF; tags. You could also ad IMG tags with an image of some kind, like in my screenshot.
--------------------------------------
Let me know if anyone has any ideas on how to improve this. I'd like to see:
1) The age calculated and shown
2) The birthday shown in this format: March 17, 1970
3) A link to the thread in their birthday email

Enjoy (and thanks for the inspiration and some code, Logician!)
Members pick up quite quickly that the thread is automated, and on a busy board you also end up with a forum full of the same topics.

I rather have a cron file that run once per month to insert a new thread for the birthdays of that month. This way members can congratulate and others have time to participate.
Reply With Quote
  #20  
Old 03-19-2004, 04:48 AM
ChurchMedia's Avatar
ChurchMedia ChurchMedia is offline
 
Join Date: Dec 2002
Location: Las Cruces, NM
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, the topics change every day... e.g. "Happy Birthday to our members on DATE", etc. And with MK@spug.net's version it changes even more: "Happy Birthday to user, user, user on date". I set aside a sub-forum just for birthdays so it stacks up there.

Quote:
Originally Posted by floris
Members pick up quite quickly that the thread is automated, and on a busy board you also end up with a forum full of the same topics.

I rather have a cron file that run once per month to insert a new thread for the birthdays of that month. This way members can congratulate and others have time to participate.
Reply With Quote
  #21  
Old 03-20-2004, 12:25 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just curious, how are you testing this? I see some people saying they are getting errors? Wouldn;t it run behind the scenes via cron?
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 03:44 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.05750 seconds
  • Memory Usage 2,356KB
  • Queries Executed 25 (?)
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
  • (8)bbcode_php
  • (4)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
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)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_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