Description: Allows users to add their birthdays to their profiles. The main index will list this month's and today's birthdays. And users get a personal birthday greeting on their birthdays. Profiles will show birthdays and age calculations.
Working Under: UBB.Threads 6.2-6.3
Mod Status: Finished
Any pre-requisites: none
Author(s): JoshPet
Date: 04/28/03
Credits: PamW of www.thesoulelement.com for commissioning it, Dimopoulos, Dave_L and JustDave for help with the year/age calculation.
Database Altered: Three Fields added to the User table (U_BirthMonth, U_BirthDay, U_BirthYear).
Info/Instructions: Backup your database before modifing!!!
Features -
Birthday will Display in their Profile.
Age will appear in their Profile if they have entered the year of their Birth. (Thanks Dimopoulos)
Bottom of Main Index Will Display "Today's Birthdays" and "This Months Birthdays" if there are any.
Birthday Names will link to the users profiles.
Top of Main Index will wish the User a Happy Birthday if It's their Birthday.
Bottom of Main Index will offer a link to update their profile if the profile does not contain the Birthday Info
If they have completed their whole birthday, an accurate age will be calculated.
If they have only filled in their birthyear, an aprox. age will be calculated.
AddOn available:Birthday Cron AddOn will automatically send a PM to people on their birthdays, and make a post in a select forum announcing today's birthdays. Fully configurable.
I've succesfully installed this mod and I realy love it! Now I would also like to change the IIP profile index so that the birthdays can also be seen there (and maybe even sortable on age). What should I add to my profileindex to make it work that way?
I instaled this mod now when i change my bithday date in my profil my av autmotical change his size tu max (80x80) and secend problem is in showflat I can`t see av if user use this option URL to your picture (80x80 max pixels, may be smaller) (.gif, .jpg, .png accepted)
>>and secend problem is in showflat I can`t see av if user use this option URL to your picture (80x80 max pixels, may be smaller) (.gif, .jpg, .png accepted)
when av is upload on my serwer every thing its ok <<<
hmm its somthing else if user not edit his profil after instal modyfication his av is not show on showflat
I dont know if this is a result of this hack or not, but when a user edits their profile on my board, and clicks submit, it takes a very long time (about a minute or so) for the page to refresh.
All other parts of the board seem to work fine and without this kind of delay. Even IIP doesnt have much more than a 1.5 second delay most of the time.
My board has 515 users, and about 90,000 posts. I am sure that there are people running much bigger boards than this and able to use this hack yes?
I went back through this hack and made sure that everything was done correctly. I am not sure how to debug from here though.
Hey josh.. just installed this on 6.3, and everything looks good. Although... I am having a stylesheet problem with the birthday table at the bottom of the forum index... attached is an example
that is the fix I had applied, but was still pulling up the black background. I will double check and make sure I added it to the right place, I did do the hack before I had my pot of coffee this morning, so I might have fudged it up
I don't have the code in front of me - or else I'd find the specific place, but search for U_OnlineFormat in there - and I suspect you'll see the missing comma between the fields.
<tr> <td class="lighttable" class="small" valign="top" colspan="3" >
[/]
This is defaulting to a dark blue on the Infopop style, making the names invisible once they have been clicked on. I note that this is not actually calling the "lighttable" color as defined in the infopop.css. I've tried changing the infopop.css lightable without effect. I also added a birthday class to the css and changed the birthday template call. What am I missing? the obvious?
This is a great hack and it worked like a charm (with the style sheet correction noted in this thread). I'm wondering how hard it would be to give users the option to not display their age in their profiles, though. Some people will want to and some will definitely NOT want to, but I would like people to be able to enter their birthdays without having to also display ages. Any thoughts on how to do that? (Otherwise I figure people will just lie, and I will have a forum full of 16 year olds.)
Edited because I worked around by just adding text to the editbasic template saying they should leave the age field blank if they don't want the birthday to display, but I'm not sure if that will interfere with the COPPA check they fill out at registration. Will it?
This mod uses date()...on our board we have people on the other side of the globe and I'm wondering if maybe the user's time offset from board time instead should be taken so they're not told it's their birthday 14 hours before it is?
Maybe that doesnt' make sense, daates and timezones confuse me.
Probably you could base it off their time offset. Although needless to say I won't be doing anything more with this since it'll be standard in 6.4. (and I think it does take the user time zone into effect).
Josh - in Classic, there's a little cake icon that shows next to the user's name in posts when it's their birthday. Is there any chance of getting that to work with this?
OK - if you have this installed - one query may fail when you run the 6.4 altertable. As w already have the U_BirthDay field - the query in 6.4 which adds U_Birthday conflicted on my tests.
Backup your database first! I developed this for my own needs so use at your own risk.
The attached file - download it and raname it from .txt to .php. Upload it to your ubbthreads directory.
Then AFTER you run your 6.4 altertable, run the convertbday.php script.
It will change the name of the old birtday field.... add the new fields (which may have failed with the 6.4 altertable) and convert all the previously entered birthdays with this mod to the new UBB.Threads version 6.4 birthday field.
After the 6.4 altertable, I run convertbday.php and here are some results:
[]// script to convert JoshPet's birthday mod dates to the 6.4 date format // Written by Joshua Pettit www.joshuapettit.com We need to rename the old field. You might get an error here, which is OK.
SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators We need to create the new birthday fields - in case the 6.4 altertable couldn't do this at the time. You might get an error here too, which is OK.
SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators Now we will cycle through the users and update their birthday information.
The User Pasqual - had 1-8-1974 for their birthday the new field was set to 1/8/1974 Marcela - No Birthday Information The User Nicole - had 8-31-1977 for their birthday the new field was set to 8/31/1977 Yvonne - No Birthday Information lamlam - No Birthday Information[/]
This seems to work fine, but as you can see in the attached picture, the U_Birthday field is not filled. How come ?
Which SQL command should I use to fill that columm ?
>> SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators Probably would need to see the SQL Errors to see what's going wrong. They should be in your MySQL Error log - but looks like the script isn't being able to update the new field.
Yeah, this is like an altertable, you can't run it more than once without causing troubles.
The errors you show now are because you already ran it. We still don't know what the real error was when you ran it the first time.
If you need to run it on a db that you already ran it on, you could try commenting out the two queries which alter the tables... the update part of the script should do the trick.
This is sooo weird I tried it once again and I get no errors, but the birthday field doesn't get updated I attached the script I've run and the result page I get.
Main forum index page ends up with a query to match birthdays with no key index on any of the birthday fields added in this mod. Mysql ends up examining all w3t_User records. I noticed this when I did a debug=1 on the main forum index page.
(Saves a fraction of a second on page loads with an index added)
[]JoshPet said: OK - if you have this installed - one query may fail when you run the 6.4 altertable. As w already have the U_BirthDay field - the query in 6.4 which adds U_Birthday conflicted on my tests.
Backup your database first! I developed this for my own needs so use at your own risk. <img src="/forum/images/graemlins/wink.gif" alt="" />
The attached file - download it and raname it from .txt to .php. Upload it to your ubbthreads directory.
Then AFTER you run your 6.4 altertable, run the convertbday.php script.
It will change the name of the old birtday field.... add the new fields (which may have failed with the 6.4 altertable) and convert all the previously entered birthdays with this mod to the new UBB.Threads version 6.4 birthday field. <img src="/forum/images/graemlins/smile.gif" alt="" />
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.