PDA

View Full Version : Automatic Birthday Thread


ChurchMedia
03-17-2004, 10:00 PM
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.

Vile
03-17-2004, 11:27 PM
Very cool idea :)

coldpride
03-17-2004, 11:43 PM
Yes almost like the old vb2 hack :) Very very good :)

Vb-Hispano
03-18-2004, 12:01 AM
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

<?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!

https://vborg.vbsupport.ru/external/2004/03/1.gif

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,p ostusername,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,pa getext,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 $
|| ################################################## ##################
\*================================================ ======================*/
?>

Osterling
03-18-2004, 12:06 AM
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

Vb-Hispano
03-18-2004, 12:08 AM
I use v 3.0

Rushty
03-18-2004, 06:58 AM
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?

DaveLogic
03-18-2004, 10:05 AM
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

<?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!

http://www.dominio.com/foros/images/cumpleanos.gif

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,p ostusername,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,pa getext,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...

alkatraz
03-18-2004, 11:36 AM
Cool hack, thx for the vb3 update

gmarik
03-18-2004, 01:43 PM
This is cool. Could you add a .txt file as well?

[email protected] vbmenu_register("postmenu_486546", true);
03-18-2004, 03:32 PM
I've done the following modifications and it works fine now. Enhanced the title a little too.

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


ADD
$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";
$bday_title .= $username.", ";

--------------------------------------
UNDER
log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);


ADD
// 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_date11= date("F j, Y", mktime (date("H")+$timeset, date("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,p ostusername,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,pa getext,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

sabret00the
03-18-2004, 03:37 PM
not bad, although if you could get it to make individual threads it would be even better

Vb-Hispano
03-18-2004, 03:43 PM
I've done the following modifications and it works fine now. Enhanced the title a little too.

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


ADD
$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";
$bday_title .= $username.", ";

--------------------------------------
UNDER
log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);


ADD
// 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_date11= date("F j, Y", mktime (date("H")+$timeset, date("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,p ostusername,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,pa getext,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:

Memnoch-NMX-
03-18-2004, 05:21 PM
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.

M.C.
03-18-2004, 05:22 PM
i`d love to see instructions file attached to first post ;)

ChurchMedia
03-19-2004, 01:38 AM
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,

M.C.
03-19-2004, 01:50 AM
thanx a lot man! ;)

Floris
03-19-2004, 04:41 AM
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.

ChurchMedia
03-19-2004, 04:48 AM
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. :)

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.

ryancooper
03-20-2004, 12:25 PM
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?

ChurchMedia
03-20-2004, 05:24 PM
In your admin cp under scheduled tasks, you can choose to "run now" for any cron job. It's really useful for testing.

FASherman
03-20-2004, 06:46 PM
For those of you having parse 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,

The parsing errors have nothing to do with queries, but with this line:

$birthday_greeting_thread = <<< EOF

It is bad syntax. Its also bad coding form.

ChurchMedia
03-21-2004, 01:40 AM
hmmm.... I see that method used all the time. It doesn't cause errors even if it's considered bad syntax. What would you suggest (aside from calling a vb template)? :ermm:

ChurchMedia
03-21-2004, 02:23 AM
I did go ahead and change the $birthday_greeting_thread into a single line variable instead of using <<< EOF EOF; tags, but that format is used quite frequently. I'm not sure why it would cause an error. PhotoPost makes liberal use of this type of format and it's taught in PHP books.... ??? :ermm:

nhochochack
03-21-2004, 08:04 AM
use it for vbb Gold ,, don't work ,

Ted S
03-21-2004, 09:21 AM
Great hack! I've got too many birthdays to print all the names in the title but I'm using the rest of MK@spug.net's changes. Very easy install on vb3 gold (if you're having errors check to see if your mysql insert has extra spaces).

Vb-Hispano
03-21-2004, 03:17 PM
yes, working in gold

thanks :D

Platinumgamer
03-21-2004, 03:26 PM
Hmm...this hack works fine on Gold, however the thread doesn't show up on the forumhome, just inside the forum. Also, the thread count doesn't rise when new threads are made. (I just installed this hack, so it only has one thread posted...yet the forum for the BDay threads still has '0' as the thread count...even though the reply count is there.

Is this supposed to happen, and can it be fixed?

Thanks!

ChurchMedia
03-21-2004, 06:57 PM
Good point. I left out a couple of line of code from Logician's original hack. Add these lines right above // End Create Birthday Thread Hack

// Updating Forum
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($greeter_name)."' WHERE forumid = $greetings_forum");
// Updating User's Post
$DB_site->query("UPDATE user SET posts=posts+1 WHERE userid=$greeter");


I just tested it and it works. Credit goes to Logician :). I updated the original txt file.

Hmm...this hack works fine on Gold, however the thread doesn't show up on the forumhome, just inside the forum. Also, the thread count doesn't rise when new threads are made. (I just installed this hack, so it only has one thread posted...yet the forum for the BDay threads still has '0' as the thread count...even though the reply count is there.

Is this supposed to happen, and can it be fixed?

Thanks!

Platinumgamer
03-21-2004, 08:07 PM
Thanks ChurchMedia and Logician!

That worked perfectly. :)

jluerken
03-22-2004, 07:01 AM
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,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,pa getext,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


BE careful with these line if you're using table prefixes

then you have to change this:
INSERT INTO thread to INSERT INTO yourprefix_thread
and this
INSERT INTO post to INSERT INTO yourprefix_post

Maybe the author of this hack can change these lines to reflect installations which are using table prefixes :D

ChurchMedia
03-22-2004, 07:13 AM
Maybe the author of this hack can change these lines to reflect installations which are using table prefixes :D
Great idea! I added " . TABLE_PREFIX . " in the appropriate places. Thanks for the heads up.

:)

ryancooper
03-22-2004, 12:35 PM
Strange, i ran the Happy Birthday email and got no errors but I had a birthday and gor a email :

Database error in vBulletin 3.0.0 Release Candidate 4:

Invalid SQL: INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastpos ter,dateline,iconid,visible,attach) VALUES (NULL,'Happy Birthday to on March 21, 2004','1079867961','6','1','0','Happy Birthday','11064','Happy Birthday','1079867961','0','1','0')
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ter,dateline,iconid,visible,attach) VALUES (NULL,'Happy Birthda

mysql error number: 1064

Any ideas what is wrong??

Thanks!

ChurchMedia
03-22-2004, 02:34 PM
Be sure to change the user id,user name and forum id variables. If they don't exist you will get an error. Looks like you might have used example variables (from MK@spug.net). Let me know if you still have problems after changing these:

$greeter=1; //Your User ID
$greeter_name="Your User Name"; //Your User Name
$greetings_forum=1; //enter the forum id that you want the thread to go into

ryancooper
03-22-2004, 06:13 PM
Be sure to change the user id,user name and forum id variables. If they don't exist you will get an error. Looks like you might have used example variables (from MK@spug.net). Let me know if you still have problems after changing these:

$greeter=1; //Your User ID
$greeter_name="Your User Name"; //Your User Name
$greetings_forum=1; //enter the forum id that you want the thread to go into


AAHHh YEs I didn;t read that closely enough. . . :nervous: Thanks for the reply!

ryan\

egyptsons
03-23-2004, 07:51 PM
Very cool idea :)
;) nice work man

EvilLS1
04-25-2004, 10:25 PM
To show the age (in years)...

In includes/cron/birthday.php find:

$emails .= iif($emails, ', ');
$emails .= $userinfo['username'];

Below it add:

// Generate Age

if (!$year)
{
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
}
if (empty($gotage["$userinfo[userid]"]))
{
$date = explode('-', $userinfo['birthday']);
if ($year > $date[2] AND $date[2] != '0000')
{
$age = $year - $date[2];
if ($month < $date[0] OR ($month == $date[0] AND $day < $date[1]))
{
$age--;
}
if ($age < 101)
{
$gotage["$userinfo[userid]"] = $age;
}
else
{
unset($age);
}
}
}
else
{
$age = $gotage["$age[userid]"];
}

// end age


Find:

$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, born ".$userinfo['birthday']."\n";


Replace it with:

$bday_people .= "<a href=\"member.php?u=".$userinfo['userid']."\">".$username."</a>, Age: ".$age."\n";

ChurchMedia
04-25-2004, 11:06 PM
Very cool! Thanks for that addition. Here's an addition to email the greeter when the thread is created (it will email the birthday greeting).


Find:
$greeter=1; //His User ID
The number (1) may be different.

Below that add:
$greetermail="youremail@yourdomain.com";
Change the email address to your own.

Find:
$DB_site->query("UPDATE user SET posts=posts+1 WHERE userid=$greeter");

Below that add:
// email the admin
$birthday_greeting_thread=strip_tags($birthday_gre eting_thread);
vbmail_start();
vbmail($greetermail, $title3, $birthday_greeting_thread);
vbmail_end();

ChurchMedia
04-25-2004, 11:18 PM
Here's an addition to give users store points for their birthday:

Find:
$bday_title .= $username.", ";

Below that add:
$DB_site->query("UPDATE user SET storep=storep+50 where userid='$userinfo[userid]'");

Be sure to change "storep" to the correct field for the store hack you are using. For the new uShop hack, look in your AdminCP to find out what to use there.

You can change the "50" to however many points you want to give for a birthday present. Be sure to mention the present in your birthday greeting. :)

lasto
04-25-2004, 11:40 PM
church media one request if possible - can this be set to ignore zero posters ?

EvilLS1
04-25-2004, 11:58 PM
church media one request if possible - can this be set to ignore zero posters ?
Yep. I added that and a few other options to mine.

In birthday.php find:

$birthdays = $DB_site->query("
SELECT username, email, languageid, birthday, userid


Replace it with:

$birthdays = $DB_site->query("
SELECT username, email, languageid, posts, userid, birthday


Find:

$emails .= iif($emails, ', ');
$emails .= $userinfo['username'];


Below it add:

$posts = $userinfo[posts];


Find:

// Create Birthday Thread Hack

Below it add:

if ($posts>='1')
{

You can change the "1" in the code above to whatever you want the minium posts for birthday threads to be


Find:

// End Create Birthday Thread Hack


Above it add:

}


If you also want to limit the birthday threads & emails to users who have visited the site within the time set in your admin panel for showing birthdays on forum home do this:

In birthday.php find:

$birthdays = $DB_site->query("


Above it add:

if ($vboptions['birthdaydatecut'])
{
$datecut = TIMENOW - (intval($vboptions['birthdaydatecut']) * 86400);
$activitycut = "AND lastactivity >= $datecut";
}
else
{
$activitycut = '';
}


Find:

(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids)
");


Replace it with:

(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids) $activitycut
");

ChurchMedia
04-26-2004, 01:57 AM
church media one request if possible - can this be set to ignore zero posters ?

Another way to do that (but not as much control) is to change:

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

to

$birthdays = $DB_site->query("
SELECT username, email, languageid, birthday, userid
FROM " . TABLE_PREFIX . "user
WHERE birthday LIKE '$today-%' AND
usergroupid IN ($ids) AND lastpost !=0
");

That would only select users that have posted. I haven't tested it, but it should work.

EvilLS1's version gives you a lot more options.

jp2
05-07-2004, 03:55 PM
How do you turn it off??? :-S

ChurchMedia
05-07-2004, 04:53 PM
Turn off what? The automatic email or the automatic thread?

jp2
05-09-2004, 04:40 PM
The automatic thread.

ChurchMedia
05-09-2004, 10:12 PM
Sure -- just put a \\ in front of all of the lines that relate to thread creation -- or delete everything that you hacked in.

jp2
05-10-2004, 03:15 PM
Thanks! :)

jons5150
05-10-2004, 09:21 PM
Parse error: parse error in /home/virtual/site1/fst/var/www/html/forums/includes/cron/birthday.php on line 86

<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 3.0.1 - Licence Number XXXXXXXXXX
|| # ---------------------------------------------------------------- # ||
|| # 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 (!is_object($DB_site))
{
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";
$bday_title .= $username.", ";


vbmail_end();

if ($emails)
{
log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);
// Create Birthday Thread Hack
$birthday_greeting_thread = "Here are today's birthdays!<br><br>$bday_people";

$greeter=3; //Your User ID
$greeter_name="Jon"; //Your User Name
$greetings_forum=56; //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= "Happy Birthday to ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,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,pa getext,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')");
// Updating Forum
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($greeter_name)."' WHERE forumid = $greetings_forum");
// Updating User's Post
$DB_site->query("UPDATE user SET posts=posts+1 WHERE userid=$greeter");
// End Create Birthday Thread Hack



/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 22:57, Sun May 2nd 2004
|| # CVS: $RCSfile: birthday.php,v $ - $Revision: 1.25 $
|| ################################################## ##################
\*================================================ ======================*/
?>

Onkel_Tom
06-03-2004, 08:39 PM
@ Jons5150

You missed a } between the two lines

$bday_title .= $username.", ";


vbmail_end();

should be:

$bday_title .= $username.", ";
}

vbmail_end();

Onkel_Tom
06-03-2004, 09:57 PM
What about Usergroups to exclude from Birthday thread ?
any idea how to do this ?

Rick
06-12-2004, 03:53 AM
Nice hack.

I have it installed and working, but I am seeing all of the HTML code surrounding the birthday people. Does HTML have to be enabled in the forum for this to work properly?

Also, what do I need to do to change the subject of the thread. I have LOTS of members and having all of the user names in the subject line is way too much clutter.

Thank you.

Rick

ChurchMedia
06-16-2004, 07:04 AM
Nice hack.

I have it installed and working, but I am seeing all of the HTML code surrounding the birthday people. Does HTML have to be enabled in the forum for this to work properly?


I guess so. The other option is to take out the HTML and forgo the links to their profiles. I think you could use /n for line breaks (???).


Also, what do I need to do to change the subject of the thread. I have LOTS of members and having all of the user names in the subject line is way too much clutter.

Thank you.

Rick

The easiest thing to do is replace:

$title3.= $bday_title;

with:

$title3.= "our members";

That would make the subject "Happy Birthday to our members on whateverdate".

Enjoy!

Rick
06-17-2004, 11:04 PM
Thank you. That did it :D

stamos2003
06-21-2004, 07:47 AM
works very fine here, thx. mate !

Onkel_Tom
06-21-2004, 10:26 PM
Originally Posted by lasto
church media one request if possible - can this be set to ignore zero posters ?

Yep. I added that and a few other options to mine.

In birthday.php find:

$birthdays = $DB_site->query("
SELECT username, email, languageid, birthday, userid


Replace it with:

$birthdays = $DB_site->query("
SELECT username, email, languageid, posts, userid, birthday


Find:

$emails .= iif($emails, ', ');
$emails .= $userinfo['username'];


Below it add:

$posts = $userinfo[posts];


Find:

// Create Birthday Thread Hack

Below it add:

if ($posts>='1')
{

You can change the "1" in the code above to whatever you want the minium posts for birthday threads to be


Find:

// End Create Birthday Thread Hack


Above it add:

}


If you also want to limit the birthday threads & emails to users who have visited the site within the time set in your admin panel for showing birthdays on forum home do this:

In birthday.php find:

$birthdays = $DB_site->query("


Above it add:

if ($vboptions['birthdaydatecut'])
{
$datecut = TIMENOW - (intval($vboptions['birthdaydatecut']) * 86400);
$activitycut = "AND lastactivity >= $datecut";
}
else
{
$activitycut = '';
}


Find:

(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids)
");


Replace it with:

(options & $_USEROPTIONS[adminemail]) AND
usergroupid IN ($ids) $activitycut
");


This doesn't work for me.
If only users with zero posts has birthday on a day this addition works, but if other users with more than zero post has also birthday a greating thread is generated and also the zero posters are greated !

any idea?

Onkel_Tom
06-21-2004, 10:46 PM
I fixed the problem with the following database query:

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

Blackbeard
06-28-2004, 05:44 PM
iam having problems i have done the hack as in the download and today this was made as a post not as the screenie shows.
Also a side effect has happened, in my admin panel in forums and moderator the options in the controls ie edit, delete have disappeared but when i delete the post the options have reappeared.

this is how the post was displayed.

Dear Forum,<br><br>Here are today's birthdays!<br><br><a href="member.php?u=124">RUGGY</a>, born 06-28-1938
<a href="member.php?u=54">RONNIEBI</a>, born 06-28-1941

Any ideas

ChurchMedia
06-28-2004, 06:08 PM
Looks like you need to turn on HTML for your birthday forum. Then the HTML code will disappear.

That second problem is a new one to me. Are you listing yourself as the poster?

Blackbeard
06-29-2004, 02:12 PM
Sorted the first second one seems to have gone away strange

jluerken
07-19-2004, 06:21 PM
Hi there,

the post is done very well in my 3.0.3er Version but the Thread does not get a title on the forumhome.

Take a look at my screen and you will see!

ChurchMedia
07-20-2004, 05:19 AM
Hi there,

the post is done very well in my 3.0.3er Version but the Thread does not get a title on the forumhome.

Take a look at my screen and you will see!


Hmmmm.... I'm running vB 3.0.0 and not having that problem. Double-check the code. See my screenshot from today.


(Edit)
Oh -- you said you're running 3.0.3 (you might want to update your profile). I'm not sure -- maybe that's the problem. I won't know until I upgrade to 3.0.3, which won't be for a couple of months....

jluerken
07-20-2004, 05:48 AM
I checked the code (its not so much :D) and this is looking like yours!

ChurchMedia
07-20-2004, 05:52 AM
I checked the code (its not so much :D) and this is looking like yours!


Hmmmm..... I'm just not sure what the problem is, unless 3.0.3 handles something differently. Maybe someone familiar with 3.0.3 could help by looking at my code. Sorry!

Boofo
07-20-2004, 08:37 AM
Hmmmm..... I'm just not sure what the problem is, unless 3.0.3 handles something differently. Maybe someone familiar with 3.0.3 could help by looking at my code. Sorry!
It's not updating the thread title or the link to the birthday thread with the last post icon. It is updating the last poster name fine, but not the other 2. It is pulling the infor from the last post made before the birthday cron job ran. Any idea what might be causing this?

ChurchMedia
07-20-2004, 02:31 PM
It's not updating the thread title or the link to the birthday thread with the last post icon. It is updating the last poster name fine, but not the other 2. It is pulling the infor from the last post made before the birthday cron job ran. Any idea what might be causing this?

That's strange. I never noticed it before, but you're right. For instance, last night it created a new birthday thread, but the title and link that shows up on the forum-home is for yesterday's birthday thread. Weird. Let me look into it and try to figure it out.

It seems to have the right title and link for new posts.... ???

Boofo
07-20-2004, 06:55 PM
That's strange. I never noticed it before, but you're right. For instance, last night it created a new birthday thread, but the title and link that shows up on the forum-home is for yesterday's birthday thread. Weird. Let me look into it and try to figure it out.

It seems to have the right title and link for new posts.... ???
Yessir. Otherwise, it is normal. Just when it makes a birthday thread. Maybe the post query should be run before the thread query? ;)

Pitman
07-20-2004, 07:35 PM
Yessir. Otherwise, it is normal. Just when it makes a birthday thread. Maybe the post query should be run before the thread query? ;)
Yeah I noticed that when I first installed it, but it didn't really bother me because it usually doesn't stay the last post for long. But it changes the last poster's username but not the title ;x

Would be cool to get a fix to that though, thanks :)

ChurchMedia
07-20-2004, 10:47 PM
Well, I tried switching the post and thread creation and it just creates an empty thread. I think the problem is with this line:

$log_threadid=$DB_site->insert_id();

I think the insert_id() function is no longer valid in vB3, so it enters a thread id that is NULL. So, it doesn't show up until the next day. Make sense?

Anyone know what the function insert_id() was replaced with?

jluerken
08-01-2004, 10:53 AM
Well, I tried switching the post and thread creation and it just creates an empty thread. I think the problem is with this line:

$log_threadid=$DB_site->insert_id();

I think the insert_id() function is no longer valid in vB3, so it enters a thread id that is NULL. So, it doesn't show up until the next day. Make sense?

Anyone know what the function insert_id() was replaced with?
Any solutions so far?

ChurchMedia
08-01-2004, 06:00 PM
Well, I've looked some code in newthread.php and I think I could re-write this hack to work correctly and streamline it a bit. I won't have time for a while, though (I've having surgery on Tuesday and will be out for a few weeks). I'll look back into it as soon as I can. :)

Thanks,

Boofo
08-07-2004, 06:22 AM
Well, I've looked some code in newthread.php and I think I could re-write this hack to work correctly and streamline it a bit. I won't have time for a while, though (I've having surgery on Tuesday and will be out for a few weeks). I'll look back into it as soon as I can. :)

Thanks,
I think they are using verify_id now, like the following:

$forumid = verify_id('forum', $_REQUEST['forumid']);

Bison
08-12-2004, 12:28 AM
Can someone please make it so we don't have to turn on HTML in our forums?

ambrosious
08-21-2004, 01:17 PM
Installed yesterday, this morning I got this,

Dear Adult Barnyard,<br><br>Here are today's birthdays!<br><br><a href="member.php?u=954">Callisto</a>, born 08-21-0000

Any ideas?

ChurchMedia
08-21-2004, 06:41 PM
You have to turn on HTML for your birthday forum. That will fix it...

ambrosious
08-21-2004, 07:29 PM
I can't find out where that is in CP, can you hint me?

ambrosious
08-21-2004, 07:38 PM
I got it and it works beautifully!

ChurchMedia
08-21-2004, 07:48 PM
In the forum manager -- then enable/disable features. See the screenshot.

ambrosious
08-21-2004, 07:57 PM
Thanks! You rock!

duncan99
08-23-2004, 04:04 PM
I use phrase in the birthday.php, when I test it by running cron, it works normally all the phrases show up properly, but when the cron runs in automatic mode, all phrases never show? whats the problem?

jugo
08-27-2004, 12:28 PM
Can someone please make it so we don't have to turn on HTML in our forums?


OK...

I didn't want to enable HTML on my forums (for obvious reasons) so I used BBCode Instead to create the thread's post text.

***EDIT*** The BR Code works even if you do not have HTML enabled.

And it works just fine. :squareeyed: :nervous:

This is what my code looks like:

$bday_people .= "-->."] ".$username." (member.php?u=".$userinfo['userid'), Age: ".$age."<br>";

ChurchMedia
08-27-2004, 05:07 PM
Great idea. You can also use \n for line breaks. I'm going to post a new version of the b-day hack today and I'll change the HTML to BB code. Thanks!

ChurchMedia
08-27-2004, 08:38 PM
Version 2.0 has just been released. Bug fixes, new features and update instructions are in the first post.

Enjoy,

NuclioN
08-27-2004, 11:29 PM
Works great so far Churchmedia :) Tnx

SnowBot
08-27-2004, 11:46 PM
Going to install NOW!!! :)

jluerken
08-28-2004, 07:06 AM
Thanks man for version 2. I installed it two minutes ago and get a DB error when running it.

Database error in vBulletin 3.0.3:

Invalid SQL:
INSERT INTO vb3_thread(title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline,iconid, visible)
VALUES
('Happy Birthday to billyjobob, m4|Ranger, XeDa101, on August 28, 2004', 1093680294, 15,
1, 0, 'CFN|BirthdayBot', ,
'CFN|BirthdayBot', 1093680294, 0, 1)
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '
'CFN|BirthdayBot', 1093680294, 0, 1)' at line 4

mysql error number: 1064

Can you help?

ChurchMedia
08-28-2004, 07:22 AM
Check your variables. The $greeter variable should be a number -- the user ID for CFN|BirthdayBot. Check that and if you still have problems, post the lines with \\change me in them.

EDIT: Actually, it looks like there is no user ID there. Again, make sure the $greeter variable has the correct user ID for the greeter name.

jluerken
08-28-2004, 07:31 AM
I wrote greeter1 instead of greeter=1 but now I have a new error which is really one :D

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE user SET posts=posts+1 WHERE userid=4
mysql error: Table 'usr_web1_3.user' doesn't exist

mysql error number: 1146

Means you've once forgotten to check for table prefixes in this line
UPDATE user SET posts=posts+1 WHERE userid=4
Can you update this and tell me what to change?

jluerken
08-28-2004, 07:48 AM
Ok I've done it already.

Pls. change this part of your hack

// Updating User's Post
$DB_site->query("UPDATE user SET posts=posts+1 WHERE userid=$greeter");


with this

// Updating User's Post
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET posts=posts+1 WHERE userid=$greeter");

HiDeo
08-28-2004, 10:14 AM
Nice hack

Thanks

ChurchMedia
08-28-2004, 11:44 AM
Fixed it! Sorry about that!

jugo
08-30-2004, 01:15 PM
Mine has an issue...I run the Cron...but it just sits there and nothing happens.

Here is the CHANGEME Lines:


if ($emails)
{
log_cron_action('Birthday Email sent to: ' . $emails, $nextitem);
$birthday_greeting_thread = "Waddup My Peeps,\n\nHere are today's Birthdays!\n\n";
$birthday_greeting_thread = $birthday_greeting_thread.$bday_people;
$birthday_greeting_thread = $birthday_greeting_thread."\n\nw00t w00t! I hope you like getting OLD!!!";

$greetermail="birthdayfairy@s3squad.com"; //CHANGE ME: Birthday greeter email
$greeter=2; // CHANGE ME: Birthday greeter user ID
$greeter_name="jugo????"; //CHANGE ME: Birthday greeter user name
$greetings_forum=2; // CHANGE ME: Birthday forum ID
$todays_date11= date("F j, Y", mktime (date("H")+$timeset, date("i"), date("s"), date("m"), date("d"), date("Y")));
$title3= "Happy Birthday to ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;

// Creating Thread

ChurchMedia
09-02-2004, 01:53 AM
It's working. Mine does that too. I'm not sure why it's not giving us a "done" message. It shows up in the cron logs, though. If anyone figures out what the problem is, let me know. Fortunately it isn't a big problem.

bspiller82
09-03-2004, 06:50 AM
It seems after I upgraded from the old Birthday script to the new it stopped working. There is no errors that I see just that it's not posting the thread.

venomx
09-03-2004, 12:25 PM
I am going to install this after the cron thing works right :P

trackpads
09-03-2004, 01:47 PM
Is there a way to make it use Pets money instead of UCash?

Thanks again!!!

-Jason

ChurchMedia
09-03-2004, 05:19 PM
I am going to install this after the cron thing works right :P

The cron message has never finished. It's really not a big deal and doesn't hurt anything. You never even see the message unless you run it manually.


So, I wouldn't worry about it and go ahead and install the hack :)

ChurchMedia
09-03-2004, 05:23 PM
It seems after I upgraded from the old Birthday script to the new it stopped working. There is no errors that I see just that it's not posting the thread.

I suggest you start over with a fresh copy of birthday.php (without any hacks at all) and give it another shot. :)

ChurchMedia
09-03-2004, 05:26 PM
Is there a way to make it use Pets money instead of UCash?

Thanks again!!!

-Jason

Sure you can. I don't know what the code would be, though. Take a look at the code for the Pets hack and find the lines that give Pets money. Just insert those lines in place of the UCash lines. They should look very similar the to the Ucash code. Make sure the User ID variable looks the same as the Ucash hack and you should be okay.

bspiller82
09-06-2004, 06:55 AM
I suggest you start over with a fresh copy of birthday.php (without any hacks at all) and give it another shot. :)

I did that and it diddn't work. I'll retry it with a fresh copy again and see what happens.

jugo
09-07-2004, 08:40 PM
OK... it works. Awesome.

When i run it manually it just sits there but as a cron job it works just fine...I in cluded the /you hack and it does soem pretty cool things.

OK...Is there a way to make it only post the birthdays for those who have recent activity in the last xx days AND with at least xx posts?

bspiller82
09-16-2004, 07:10 AM
Works good now. Is there a way to force it to tell the age so it doesn't say
(Age: Not telling! )?

ChurchMedia
09-16-2004, 02:49 PM
Works good now. Is there a way to force it to tell the age so it doesn't say
(Age: Not telling! )?

Not if they didn't give their birth year -- there's no way to calculate it. You can change the "not telling" message to something else if you want. Just search the script for "Not telling!" and change it to "Year not given" or whatever.

Enjoy,

Lionel
09-24-2004, 08:25 PM
I have a small problem. The email, the thread states the correct date but in the posts it shows as

Here are today's birthdays:

was born on November 30 (Age: Not telling! :))

missing the username, the age. Sometimes the age states 30 when it should have been 40

Lionel
09-24-2004, 11:00 PM
I am using 3.01 and all I am getting for username is a blank and date is way off. Age does not display, even though the year is specified.

Lionel
09-24-2004, 11:55 PM
ok, works for me now. I was placing code before {

also the instructions are missing
$bday_title .= $username.", ";
that I found in one of the post

Great hack, thanks.

MysticMoon
09-25-2004, 01:18 AM
Great hack & had no problems with it.

I was wondering though, is it possible to change the post icon?
Right now it's using the standard icon1.gif & I'd like it to use a cupcake
one I have instead.

Thanks

KW802
09-29-2004, 06:05 PM
ok, works for me now. I was placing code before {

also the instructions are missing
$bday_title .= $username.", ";
that I found in one of the post

Great hack, thanks.
ChurchMedia,

Thanks for the hack! You may want to fix the first post to have the above correction though. It threw me off also.

Kevin

KW802
10-07-2004, 01:33 PM
Great hack & had no problems with it.

I was wondering though, is it possible to change the post icon?
Right now it's using the standard icon1.gif & I'd like it to use a cupcake
one I have instead.

ThanksMysticMoon,

In the /includes/cron/birthday.php file find..... // Creating Thread
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline,iconid, visible)
VALUES
('" . addslashes(htmlspecialchars($title3)) . "', " . TIMENOW . ", $greetings_forum,
1, 0, '". addslashes($greeter_name) ."', $greeter,
'". addslashes($greeter_name) ."', " . TIMENOW . ", 0, 1)");
$threadinfo['threadid'] = $DB_site->insert_id();

// Creating Post
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible)
VALUES
($threadinfo[threadid], 0, '" . addslashes(htmlspecialchars($title3)) . "',
'" . addslashes($greeter_name) . "', $greeter, " . TIMENOW . ",
'" . addslashes($birthday_greeting_thread) . "', 1, 1, 0, 0, 1)");
$post['postid'] = $DB_site->insert_id();.... and change the two zeros that are highlighted to instead be the iconid of the new icon you want to use.

ChurchMedia
10-07-2004, 03:11 PM
also the instructions are missing
$bday_title .= $username.", ";
that I found in one of the post


I fixed it in the instructions. Sorry about that! :)

Megareus Rex
10-07-2004, 05:44 PM
I see the creator of the hack has 3.0 Gold. Any plans to modify the hack to work on 3.0.3? (The code for birthday.php has changed some, so I'm not sure how to do it now.)

venomx
10-07-2004, 05:49 PM
I use 3.0.3 and installed it fine... Not sure it works yet because I only have 7 members.... soooo hard to get members for a forum about everything. :(

KW802
10-07-2004, 06:05 PM
I see the creator of the hack has 3.0 Gold. Any plans to modify the hack to work on 3.0.3? (The code for birthday.php has changed some, so I'm not sure how to do it now.)Worked fine for me with 3.0.3.

Megareus Rex
10-08-2004, 06:34 AM
O.o really...

I'm reluctant to try and make the code work, merely because the birthday.php code isnt exactly what it asks you to search for, and testing the bot takes so long, and I'm not the paitent type...

Guess i might as well try though. Nothing to lose except someone doesnt get their precious b-day email, lol.

House_of_Crazed
10-08-2004, 06:49 AM
Okay, I have a bug :(

Apparently, when more than 1 person has a birthday, it will not post the other people. Just one person. :(

I've gone through the code thousands of times and can't see anything.

richier
10-09-2004, 09:12 PM
Okay, I have a bug :(

Apparently, when more than 1 person has a birthday, it will not post the other people. Just one person. :(

I've gone through the code thousands of times and can't see anything.


I am having the same problem it only shows one birthday not everyones on that day

Help please :nervous:

ChurchMedia
10-09-2004, 09:41 PM
Two questions for both of you, then we'll try to figure it out.

1) Did you install the hack as described in the original instructions, or did you do any of the modifications suggested by other people in this post?

2) Have you run the cron job manually to see if you get any errors? You have to do this from the admin cp. You can \\ the vbmail lines to make sure that your members don't get emails while you are testing.

See if you can get an error message and we'll go from there.

Boofo
10-09-2004, 09:50 PM
Two questions for both of you, then we'll try to figure it out.

1) Did you install the hack as described in the original instructions, or did you do any of the modifications suggested by other people in this post?

2) Have you run the cron job manually to see if you get any errors? You have to do this from the admin cp. You can \\ the vbmail lines to make sure that your members don't get emails while you are testing.

See if you can get an error message and we'll go from there.
I get the same thing. It only pulls the first birthday.

Lionel
10-09-2004, 10:21 PM
Works for me. Witnessed that 5 days ago with 2 birthdays

richier
10-09-2004, 10:39 PM
Two questions for both of you, then we'll try to figure it out.

1) Did you install the hack as described in the original instructions, or did you do any of the modifications suggested by other people in this post?

2) Have you run the cron job manually to see if you get any errors? You have to do this from the admin cp. You can \\ the vbmail lines to make sure that your members don't get emails while you are testing.

See if you can get an error message and we'll go from there.


Yes and Yes I get 1 birthday in the thread when I run the cron and thats all.

And no extra hacks

House_of_Crazed
10-09-2004, 11:51 PM
1. Yes
2. Yes - I even put the original file back and redid it. Same thing.

No extra hacks has been installed for the birthday.php in the cron folder inside the includes folder.

MysticMoon
10-10-2004, 10:59 PM
MysticMoon,

In the /includes/cron/birthday.php file find..... .... and change the two zeros that are highlighted to instead be the iconid of the new icon you want to use.

Thank you so much, it worked perfect :)

xug
10-10-2004, 11:16 PM
Installed, works great, get daily an email with at least 30 birthdays.

PS:

ChurchMedia, I did send you a PM, if you have some time, please take a look at it, thank you.

GamerJunk.net
10-10-2004, 11:22 PM
Great Hack! I installed it and it works perfectly on my Member News Forum.

One suggesstion, for the next release why not add some coding in the birthday greet to pull random quotes or images off of a database so every birthday thread isn't the same?

Sal Collaziano
10-12-2004, 08:47 PM
I love it! Installed!

ambrosious
10-14-2004, 10:00 AM
Does anyone know how to edit it so that people with <250 posts are not included?

TwinsForMe
12-08-2004, 12:20 AM
* TwinForMe clicks install :)

TwinsForMe
12-11-2004, 05:32 PM
It doesn't seem to be working. :(

When I installed, I ran it manually and it worked. It's been a few days and no birthday threads or emails have been sent and I know there have been birthdays. I tried to run it manually and nothing happens.

venomx
12-12-2004, 09:23 AM
I have had this installed for a while now. Finally got a memebr who had a birthday yesterday yet the thread wasnt made and there was no post made. :( Any ideas? :(

streetfighter
12-28-2004, 01:38 AM
Cool Hack!

I installed it and works fine!
But a annoying problem i noticed is, whenever the thread is created.... it lists the birthday of yesterday and not today!
My board time is set to gmt +530
my userid has +530...
So on an 28th December, 2004.... the thread comes up with title Happy Birthday ..... to all on 27th December, 2004!

I dont understand this behaviour!
Can anyone help?

I tested this by running from cron job, using run now... the logs wud shows the current date and time i.e. 28th december, 2004 and time when it was ran! But the thread lists 1 day older birthdays!

Anyideas?
I am using VB 3.0.1

Help!

ozmazdaclub
01-09-2005, 03:55 AM
TwinsForMe: Did you change the forum id and other parts that needed changing?

bishop93
01-09-2005, 06:48 AM
It doesn't seem to be working. :(

When I installed, I ran it manually and it worked. It's been a few days and no birthday threads or emails have been sent and I know there have been birthdays. I tried to run it manually and nothing happens.

I'm seeing the same behavior now. Was there ever an explanation or fix for this?

bishop93
01-11-2005, 07:52 PM
Not sure how I fixed it, but works like a charm for us now.

Rhoads
01-23-2005, 12:41 AM
I get an empty field when the thread is posted.
I only see the title "Happy Birthday to on January 22, 2005"

I think it is not working on 3.0.6 :devious:

ChurchMedia
01-23-2005, 01:00 AM
It's working on 3.0.5...

Rhoads
01-25-2005, 07:17 AM
I get everyday on 07.30 a birthday thread, but there are no birthday's :ermm:
How can I stop this, the titel is the same as : https://vborg.vbsupport.ru/showpost.php?p=600288&postcount=133

Rhoads
01-26-2005, 07:05 AM
I get everyday on 07.30 a birthday thread, but there are no birthday's :ermm:
How can I stop this, the titel is the same as : https://vborg.vbsupport.ru/showpost.php?p=600288&postcount=133
Is there still support :disappointed:

Onkel_Tom
01-26-2005, 07:47 AM
This hack works fine also for vb3.0.6 !
you have to check the installation instruction and redo all. there must be a wrong insert in the php files from you ;)

Rhoads
01-26-2005, 08:23 AM
This hack works fine also for vb3.0.6 !
you have to check the installation instruction and redo all. there must be a wrong insert in the php files from you ;)
It's a clean install on vb3.0.6, I think my cronjob is wrong.

Onkel_Tom
01-26-2005, 11:52 AM
Looks like mine cronjob ;)
You have a problem with you code when you get empty threads.
did you use table prefixes?

Rhoads
01-26-2005, 12:42 PM
Looks like mine cronjob ;)
You have a problem with you code when you get empty threads.
did you use table prefixes?
No, I have no table prefix, but I get each day a empty thread when there is no birthday, When there is a birthday, than de message is oke.

Onkel_Tom
01-26-2005, 12:50 PM
Okay, than you have to check your code twice...

Rhoads
01-26-2005, 12:54 PM
Okay, than you have to check your code twice...

Oke, then I check it for the fourth time :ermm:

dave kaye
01-29-2005, 12:14 PM
great mod, clicks install

Rhoads
01-30-2005, 09:15 PM
Oke, at last it works :)

But I have a question.
How I can ensure that the thread for 00.01 are made instead of 07.00.
Also I want adapt the post, I have this way changed him, but I get only the image now in the post, what is wrong ???


// Create Birthday Thread Hack
$birthday_greeting_thread = "Dear Community,\n\nHere are today's birthdays!\n";
$birthday_greeting_thread = $birthday_greeting_thread.$bday_people;
$birthday_greeting_thread = "\nCongratulated of the organisation.!";
$birthday_greeting_thread = "\nhttp://www.mydomein.nl/forum/data/congratulated.gif";
// Add an extra message tag below the birthdays if you want to. Use \n for line breaks. BB code is allowed. Be sure to uncomment the line if you use it.
//$birthday_greeting_thread = $birthday_greeting_thread."\n\nHave a great birthday!";

$greetermail="organisation@mydomein.nl"; //CHANGE ME: Birthday greeter email
$greeter=102; // CHANGE ME: Birthday greeter user ID
$greeter_name="Organisation"; //CHANGE ME: Birthday greeter user name
$greetings_forum=37; // CHANGE ME: Birthday forum ID
$todays_date11= date("F j, Y", mktime (date("H")+$timeset, date("i"), date("s"), date("m"), date("d"), date("Y")));
$title3= "congratulated ";
$title3.= $bday_title;
$title3.= "on ";
$title3.=$todays_date11;


As extra I have put that in the rood, for now i changed the [IMG] to [IMC] differently the code a cross shows.
Please support !!!

peterska2
01-30-2005, 11:15 PM
I like this. I installed it about 3 days ago and the first birthday on the site has occurred.

I got 2 posts (one on each site), 2 standard vB birthday emails (one from each site), and 2 admin emails telling me that a user has a birthday today (again one from each site).

All this happened between 0001 and 0005 GMT today (Monday).

Kinda makes my birthday. :D

deb0
02-22-2005, 10:31 AM
Anyone got this working in 306?

jluerken
02-22-2005, 10:41 AM
Anyone got this working in 306?

Its working for me and I am running 3.0.7

BigCheeze
02-24-2005, 08:03 PM
Anyone got this working in 306?

I'm running a patched version of 3.06 and it works just fine

paulomt1
02-27-2005, 12:29 PM
I don't want create a thread birthday for users them:
No visit board more than 30 days
User with posts below 10

Is possible do this?

Thanks

Michael2
02-28-2005, 10:45 AM
Thanks for the hack. Mine is not starting threads for everyone. It sometimes does but like today there are 5 people with birthdays and only four listed in the thread. Is there a reason it would exclude certain users? I'm running 3.0.3 and installed it per the instructions in the first post. Thanks in advance for any help. :)

michael5472
03-01-2005, 05:25 PM
Cheers mate a wicked mod :D

Michael2
03-05-2005, 09:56 AM
Thanks for the hack. Mine is not starting threads for everyone. It sometimes does but like today there are 5 people with birthdays and only four listed in the thread. Is there a reason it would exclude certain users? I'm running 3.0.3 and installed it per the instructions in the first post. Thanks in advance for any help. :)

Someone pointed out it's not including active members (people who have posted in the last several months). Any reason why?

Lionel
03-05-2005, 10:01 AM
Sometimes I have 8-12 birthdays and it is posting and emailing info for 2 or 3 only.

Today, I've got 8 and it did not send or create. My board is busy, it has been 7 hours now. I even tried running the cron manually. Could it be because one of those members have a space in the name? that is the only thing I could see here.

Lionel
03-07-2005, 03:19 AM
No matter what, even if there are 19 birthdays for 19 active users, that email and that thread gets created only for 4 people evry day.

ChurchMedia
03-07-2005, 03:27 AM
Someone pointed out it's not including active members (people who have posted in the last several months). Any reason why?

No, it's not about active users.....

It will only send out the email (and create the thread, name of person, etc.) for people who have agreed to accept emails from the admin. So unless you take that part of the code out, you'll never know how many people you'll get -- if any. It depends on each user's settings. Make sense?

Lionel
03-07-2005, 03:38 AM
that makes sense, but that was so odd, never more than four.... always the magic four

ChurchMedia
03-07-2005, 03:41 AM
Yeah, that's weird. You can take the part of the code out at the top about admin emails and see if that changes things.... Mine works fine... ???

Lionel
03-07-2005, 03:56 AM
Hummm. I removed the code and ran the cron manually, I got a databse error. I put it back and did it again, this time I got 6 people out of 9. Did it a third time without changing anything, got 4 people again. Check users, they are all set to receive admin emails. I am using 3.07

Lionel
03-07-2005, 04:07 AM
Fixed! Some usergroup id were excluded in the array....

atrljoe
03-11-2005, 01:22 AM
Warning: main(./global.php): failed to open stream: No such file or directory in /home2/MYACCOUNT/public_html/forums/includes/cron/birthday.php on line 15

Fatal error: main(): Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/MYACCOUNT/public_html/forums/includes/cron/birthday.php on line 15

Any Ideas?

Gary King
03-16-2005, 07:44 PM
Nice hack. Smilies should be disabled in the post though, because things like 8) become an emoticon (like (age: 18))

At least on my forums because I set it to that :)

xtreme-mobile
03-18-2005, 07:26 PM
ive just edited the file like it says, now what do i do?

how do i tell it what forum to create the post into ?

Michael2
03-21-2005, 03:03 PM
ive just edited the file like it says, now what do i do?

how do i tell it what forum to create the post into ?

$greetings_forum=xx; // CHANGE ME: Birthday forum ID

Michael2
03-21-2005, 03:10 PM
No, it's not about active users.....

It will only send out the email (and create the thread, name of person, etc.) for people who have agreed to accept emails from the admin. So unless you take that part of the code out, you'll never know how many people you'll get -- if any. It depends on each user's settings. Make sense?

That took care of it, thanks! :)

xtreme-mobile
03-21-2005, 06:23 PM
cheers mate

twinsmom
04-25-2005, 05:30 PM
I don't necessarily want anything more than Happy Birthday to Username--no ages, no dates or birth etc.

How would I do that?

cdoyle
05-12-2005, 09:42 PM
I have a small problem. The email, the thread states the correct date but in the posts it shows as

Here are today's birthdays:

was born on November 30 (Age: Not telling! :))

missing the username, the age. Sometimes the age states 30 when it should have been 40

I'm getting this too, what did you have to do to make it work? I tried modifying the birthday file, 3 time and each time I get the same thing?

I'm pretty sure I followed the directions and did everything it said to do.

Thanks
Chris.

cdoyle
05-13-2005, 12:58 AM
Something else I noticed is, that it says that each person was born on November 30th?

Happy Birthday to , on May 10, 2005
was born on November 30 (Age: Not telling! )

Anyone have any ideas?

cdoyle
05-13-2005, 08:45 PM
Anyone have an idea what I need to fix?

lionslair
05-15-2005, 09:19 AM
I installed it tested it and it worked. I would really like to see the usergroup option employed in this though.

CallieJo
05-15-2005, 03:32 PM
Fixed! Some usergroup id were excluded in the array....

The array in birthday.php right?
Like this?
if ($usergroup['genericoptions'] & SHOWBIRTHDAY AND !in_array($usergroup['usergroupid'], array(2, 3, 7, 9)))

I added mine there but I'm still missing peopes in the birthday threads being posted. I have 4 b-days today and only 2 are posted :surprised:

Any ideas?
I added the groups to the array and went into the task manager and ran birthday task again and nada!

Thanks...

cdoyle
05-15-2005, 06:03 PM
anyone have any idea, why the users names aren't showing up, and it always says November 30th?

I keep looking over the directions, and I think I did everything the way I was suppose too.

CallieJo
05-17-2005, 12:08 PM
ok, works for me now. I was placing code before {

You mean like this?
$emails .= $userinfo['username'];
NEW CODE HERE
}

That is how I have it. It works all except the fact that it only post 1-3 birthdays out of 1-10 birthdays for that day :disappointed:

Should I have it below the }

Thanks ;)

Morgalis
05-26-2005, 11:24 AM
Warning: main(./global.php): failed to open stream: No such file or directory in /home2/MYACCOUNT/public_html/forums/includes/cron/birthday.php on line 15

Fatal error: main(): Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/MYACCOUNT/public_html/forums/includes/cron/birthday.php on line 15

Any Ideas?

I have this issue as well.

Anyone know how to fix it?

Marco van Herwaarden
05-26-2005, 11:49 AM
Try removing the require_once line for global.php.

I really don't see why that line should be in a cronjob.

Morgalis
05-26-2005, 01:36 PM
Try removing the require_once line for global.php.

I really don't see why that line should be in a cronjob.


When I commented it out, it ran into trouble finding
./includes/functions_misc.php
./includes/functions_newpost.php

Marco van Herwaarden
05-26-2005, 06:37 PM
If i have time and don't forget, i will try to have a look at this hack tomorrow.

Morgalis
05-27-2005, 04:53 AM
If i have time and don't forget, i will try to have a look at this hack tomorrow.

much obliged sir

Paul M
05-27-2005, 05:19 AM
That is how I have it. It works all except the fact that it only post 1-3 birthdays out of 1-10 birthdays for that day :disappointed: You do realise that the way it's been written means that only people who allow e-mails from administrators will be included. So maybe a lot of your users have this option set to no.

cpz
05-27-2005, 09:09 PM
Does this hack always say i'm not telling for age even when members have full date of birth registered with site the boards birthday list says user id and age but when this hack posts on my board all i get is (i'm bot telling :) )

Marco van Herwaarden
06-21-2005, 09:07 AM
much obliged sirI did a test install of this hack today on a vB 3.0.7 board, and it runs perfect without any modifications. Please double check your edits.

What version of vB are you using?

PS I suggest the instructions of step 5 tp be changed from "Add below" to "Add Above". With the origianl instructions the mail will only be send if the cronjob is set to be logged. This don't make much sense to me.

Marco van Herwaarden
06-21-2005, 09:14 AM
Actually i released that all of those 3 require_once lines are really unneeded. The hack will function the same if they are removed.

Leaving them in place where they are now could even be a (minor) security risk. If they would stay in this hack, i suggest you move them below the following line:
if (!is_object($DB_site))
{
exit;
}

ozmazdaclub
08-10-2005, 01:17 AM
Does this work in 3.0.8

I did a clean install and have checked all the edits and this is still not working

Help Required...

ozmazdaclub
08-10-2005, 09:48 PM
Never Mind.... Got it working after commenting out a few lines.. my bad...

ozmazdaclub
08-14-2005, 09:51 PM
Will this be ported to 3.5?

csidlernet
08-19-2005, 10:00 AM
nicework thanks!

utw-Mephisto
08-20-2005, 07:03 AM
Will this be ported to 3.5?

* utw-Mephisto want to know as well

MB Dreamz
08-31-2005, 04:11 AM
I've had this hack installed and running fine for the past few days without any issues, until today. It just so happens that no one has a birthday today, but I still received an email like this:

Here are today's birthdays:



Birthday Thread:
http://www.cafetrends.com/forums/showthread.php?t=1898

And it started a new thread just like it did before but without any names. Any help is greatly appreciated.

cpz
09-17-2005, 04:50 PM
How can I add a small animated birthday banner below "user birthday(i'm not telling :)) in the birthday threads
I uploaded banner into my forum/images/banners file

SCRIPT3R
09-18-2005, 08:57 AM
[vB 3.0.9]

installed as instructed; works perfectly!

faast
09-24-2005, 02:37 PM
works great on 3.0.7 -- to creater: i would suggest that you let the installers know that in order to display bdays, the user MUST have receive emails from admin selected. i ran into the problem the other day when i kept running my cron and not knowing the user needed the option selectd.

Rhoads
09-30-2005, 03:14 PM
I think that it is a beautiful hack for vB 3.5, please update the hack for us :D

ozmazdaclub
10-06-2005, 01:15 AM
If not being ported do you give someone else the permission to port it over?

westi
10-16-2005, 12:25 PM
* westi need this hack for 3.5 .. pls :)

hbalagh1
10-21-2005, 11:03 PM
I too would love to have this hack... for 3.5

GamerJunk.net
11-21-2005, 04:14 PM
It is available for 3.5

bspiller82
11-21-2005, 05:38 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=100607&highlight=Birthday" target="_blank">https://vborg.vbsupport.ru/showt...light=Birthday</a>

nymyth
01-06-2006, 05:23 PM
Is there an edit that will allow me to let only people that are active on the board to get a birthday thread....ive realized that im sending out birthday threads to people that dont post at all ....

Thanks.

Peace

cambridgedaz
08-12-2007, 08:54 AM
I really love this mod but wish there was an option to post in an existing thread rather than create a new post each time. How easy would that be to do? :)