Version: 1.00, by ChurchMedia
Developer Last Online: Jun 2013
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.
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.
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:
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:
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:
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).
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.
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
PHP Code:
// 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.
Quote:
Originally Posted by Platinumgamer
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.