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
  #2  
Old 03-17-2004, 11:27 PM
Vile's Avatar
Vile Vile is offline
 
Join Date: Apr 2002
Location: Arizona, USA
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool idea
Reply With Quote
  #3  
Old 03-17-2004, 11:43 PM
coldpride coldpride is offline
 
Join Date: Apr 2003
Location: USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes almost like the old vb2 hack Very very good
Reply With Quote
  #4  
Old 03-18-2004, 12:01 AM
Vb-Hispano's Avatar
Vb-Hispano Vb-Hispano is offline
 
Join Date: Feb 2003
Location: Barcelona Spain
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no working

Happy Birthday Email


Parse error: parse error in /home/httpd/vhosts/dominio.com/httpdocs/foros/includes/cron/birthday.php on line 59

All Done


in line 59 is this $birthday_greeting_thread = <<< EOF

total php birthday

Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.0 Release Candidate 4 - Licence Number 81xxxxxx
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

error_reporting(E_ALL & ~E_NOTICE);

if ($DB_site == NULL)
{
	exit;
}

$today = date('m-d', TIMENOW);

$ids = '0';
foreach($usergroupcache AS $usergroupid => $usergroup)
{
	if ($usergroup['genericoptions'] & SHOWBIRTHDAY)
	{
		$ids .= ",$usergroupid";
	}
}

$birthdays = $DB_site->query(" 
    SELECT username, email, languageid, birthday, userid 
    FROM " . TABLE_PREFIX . "user 
    WHERE birthday LIKE '$today-%' AND 
    (options & $_USEROPTIONS[adminemail]) AND 
    usergroupid IN ($ids) 
"); 

vbmail_start();

while ($userinfo = $DB_site->fetch_array($birthdays))
{
	$username = unhtmlspecialchars($userinfo['username']);
	eval(fetch_email_phrases('birthday', $userinfo['languageid']));
	vbmail($userinfo['email'], $subject, $message);
	$emails .= iif($emails, ', ');
	$emails .= $userinfo['username'];
	$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";
}

vbmail_end();

if ($emails)
{
	log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);

	// Create Birthday Thread Hack 

$birthday_greeting_thread = <<< EOF 
Felicidades amigos, 

que tengais un gran dia de cumplea?os, que os regalen muchas cosas y 
	que sea el dia mas feliz de vuestra vida! 

	

Que os lo paseis bien y recordar que este foro esta con vosotros...

$bday_people 
EOF; 

$greeter=11290; //Your User ID 
$greeter_name="Administrador"; //Your User Name 
$greetings_forum=148; //enter the forum id that you want the thread to go into 
$todays_date11= date("F j, Y", mktime (date("H")+$timeset, date("i"), date("s"), date("m"), date("d"), date("Y"))); 
$title3= "Feliz Cumplea?os a Todos los miembros que cumplen a?os el "; 
$title3.=$todays_date11; 
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastpos  ter,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,showsignatu  re,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 


	}

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 05:43, Sun Feb 8th 2004
|| # CVS: $RCSfile: birthday.php,v $ - $Revision: 1.24 $
|| ####################################################################
\*======================================================================*/
?>
Reply With Quote
  #5  
Old 03-18-2004, 12:06 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

niiiiiiiiiiice hack.. i will def. install this sometime this week and for Vb-Hispano, this hack is for v3, your profile says you use v2
Reply With Quote
  #6  
Old 03-18-2004, 12:08 AM
Vb-Hispano's Avatar
Vb-Hispano Vb-Hispano is offline
 
Join Date: Feb 2003
Location: Barcelona Spain
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use v 3.0
Reply With Quote
  #7  
Old 03-18-2004, 06:58 AM
Rushty Rushty is offline
 
Join Date: May 2003
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 03-18-2004, 10:05 AM
DaveLogic DaveLogic is offline
 
Join Date: Jun 2003
Location: London
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Vb-Hispano
no working

Happy Birthday Email


Parse error: parse error in /home/httpd/vhosts/dominio.com/httpdocs/foros/includes/cron/birthday.php on line 59

All Done


in line 59 is this $birthday_greeting_thread = <<< EOF

total php birthday

Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.0 Release Candidate 4 - Licence Number 81xxxxxx
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

error_reporting(E_ALL & ~E_NOTICE);

if ($DB_site == NULL)
{
	exit;
}

$today = date('m-d', TIMENOW);

$ids = '0';
foreach($usergroupcache AS $usergroupid => $usergroup)
{
	if ($usergroup['genericoptions'] & SHOWBIRTHDAY)
	{
		$ids .= ",$usergroupid";
	}
}

$birthdays = $DB_site->query(" 
    SELECT username, email, languageid, birthday, userid 
    FROM " . TABLE_PREFIX . "user 
    WHERE birthday LIKE '$today-%' AND 
    (options & $_USEROPTIONS[adminemail]) AND 
    usergroupid IN ($ids) 
"); 

vbmail_start();

while ($userinfo = $DB_site->fetch_array($birthdays))
{
	$username = unhtmlspecialchars($userinfo['username']);
	eval(fetch_email_phrases('birthday', $userinfo['languageid']));
	vbmail($userinfo['email'], $subject, $message);
	$emails .= iif($emails, ', ');
	$emails .= $userinfo['username'];
	$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";
}

vbmail_end();

if ($emails)
{
	log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);

	// Create Birthday Thread Hack 

$birthday_greeting_thread = <<< EOF 
Felicidades amigos, 

que tengais un gran dia de cumplea?os, que os regalen muchas cosas y 
	que sea el dia mas feliz de vuestra vida! 

	

Que os lo paseis bien y recordar que este foro esta con vosotros...

$bday_people 
EOF; 

$greeter=11290; //Your User ID 
$greeter_name="Administrador"; //Your User Name 
$greetings_forum=148; //enter the forum id that you want the thread to go into 
$todays_date11= date("F j, Y", mktime (date("H")+$timeset, date("i"), date("s"), date("m"), date("d"), date("Y"))); 
$title3= "Feliz Cumplea?os a Todos los miembros que cumplen a?os el "; 
$title3.=$todays_date11; 
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastpos  ter,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,showsignatu  re,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 


	}

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 05:43, Sun Feb 8th 2004
|| # CVS: $RCSfile: birthday.php,v $ - $Revision: 1.24 $
|| ####################################################################
\*======================================================================*/
?>











I get the same error as well...Forced to uninstall...
Reply With Quote
  #9  
Old 03-18-2004, 11:36 AM
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack, thx for the vb3 update
Reply With Quote
  #10  
Old 03-18-2004, 01:43 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is cool. Could you add a .txt file as well?
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 02: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.04432 seconds
  • Memory Usage 2,319KB
  • 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
  • (2)bbcode_code
  • (1)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
  • (1)pagenav_pagelinkrel
  • (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