Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
#229857 12/26/2002 5:38 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version - Profile Birthdays 1.5
    ver 1.1 fixes a bug where the "Happy Birthday" message repeated with each category.
            Lists the usernames in alphabetical order for a neater look.
    ver 1.2 update to work with UBB.Threads 6.2, adds the year and age calculation as an option
    ver 1.3 updates the age calculation function and fixes a bug.
    ver 1.4 fixes a bug where the date of the birthday wasn't displaying
    ver 1.5 fixes the age calculation bug. Thanks to Dimopoulos and JustDave for help in nailing that down.

Description - This modification will allow users to enter their birthdays into their profile and display birthday info.

Working Under - UBB.Threads 6.2

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.


Pre-requisites - none

Author - JoshPet - www.joshuapettit.com

Credits - PamW of www.thesoulelement.com for requesting it. Thanks to Dimopoulos for adding the year to the code. Thanks to Dave_L for help with the age calculation.

Files Altered - editbasic.tmpl, editbasic.php, changebasic.php, ubbthreads.php, ubbthreads.tmpl, showprofile.php, showprofile.tmpl

Database Altered - Three Fields added to the w3t_Users table (U_BirthMonth, U_BirthDay, U_BirthYear).

New Files - none

Other Info - Backup your database and your files before modifing!!!!!

Add On Available - A birthday Cron addon is available here. It automatically can send PMs or Make Posts for people's birthdays.
Attachments
62525-ProfileBirthday1.5.txt (0 Bytes, 311 downloads)

Last edited by JoshPet; 03/22/2003 1:32 PM.
Sponsored Links
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
I'm using the 1.1 mod on threads 6.1.1 and love it. Although it seems that as more of my members add their info (probably a couple thousand of my 18,000 members) the page loads slower. I think there was talk about cache this info ( I would be happy with a once a day look up ).

Q. - Is the additonal lookup time insignificant and I should forget it?

Q. - Should drop it from my Main Index page which is re-loaded many times and just leave the info in a PAL box on IIP?

Thanks... just looking to keep things running smoothly.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It would have to check and load the info each time the Main Index is loaded. That can slow things down I imagine.

I am working on an Updated Pal Box for the next version of IIP which will Cache the info. (Thanks to JustDave!) Next step will be figuring out if we can have the bottom of the index page pull the cached info from IIP. That would be best for sure. Let IIP update it however often it does when it loads, and just have the Main Index use the info.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I've got this all worked out and up and running. Thanks to some great IIP groundwork by JustDave, it was easy.

I've got the BirthdayPal box for IIP 5.2 ready to go. It will cache the birthdays however many minutes you want. You can define it in the IIP config file.

Then, I tweaked the mod for the main index. The only thing the main index will check for, is if it's that users Birthday (so they get a birthday greeting) or if their birthday is empty (so they get the link to fill in their profile).
All the big list of names (today's bdays and this months bdays) is pulled from the IIP cache. I figure it's sufficient for the IIP to update that info however often. So the Main Index won't do any pulling of that info.

So I guess you'll have to load IIP at least once so that there's info to read. But if your site is busy, IIP will get loaded at least once a day easily.

That should cut down on the load, caching the bulk of the info.

Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
Adding all my hacks to 6.2 test board........... hehe Or ummmmm all of your hacks I guess I should say?? *LMAO* Good Work!! Thanks!


Some people read their stars..... I choose to write my own
Sponsored Links
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165


THANKS!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I modified my directions in the attachment above.

NOTE: If you are upgrading from the old birthday Mod, you'll already have U_BirthMonth and U_BirthDay, but you'll need to
add U_BirthYear, as that was added in this version.

To add U_BirthYear run this:

ALTER TABLE w3t_Users ADD U_BirthYear INT (4) NULL

Otherwise, as Storm discovered, you'll get errors on the show profile page.



Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
Josh,

You referenced a new palbox that would cache the birthdays... was that released?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No didn't have a chance yet. Here's the PalBox for IIP 5.2. It's named custombox1pal.php

Put it in your pals directory and adjust it's location using the IIP admin editor. It's called Custom Box 1.

Adjust the Cache time for Custom Box 1 in the IIP Admin Interface.

Enjoy!


Updated with new tablewrapers to work with IIP 5.3

Updated with a tablewrapper tweak.
Attachments
62888-birthdaypal.zip (0 Bytes, 61 downloads)

Last edited by JoshPet; 02/11/2003 12:12 AM.
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
Thanks Again!

It Works.

Sponsored Links
Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
Works great on my site Josh! Thanks once again!!

[]https://www.ubbdev.com/images/panels/9936-14259.png[/] <~~~Me wants this hack


Some people read their stars..... I choose to write my own
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
If you are using the Pal Box.... and Caching the results.... you can pull that Cached info to the Main Index.... rather than pulling it each time the Main index Loads.

You must be using the Pal Box, and Caching the results.

I've attached instructions to this post.

Attachments
62930-ProfileBday1.2Cache.txt (0 Bytes, 63 downloads)

Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
works like a charm

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks Josh,

In editbasic.php you say find...

if (!$debug) {
include("$thispath/templates/$tempstyle/editbasic.tmpl");
}

but that code does not exist

Thanks.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Hi Josh,
jsut a quick not on the previous version (1.1). There is maybe a bug with the calendar entries. It might not be fixed with the 1.2 version :
If a user changes the date, say the month from april to may, a new may entry is added to the calendar. and the april entry stays. Looks like a bug to me.

Greetings and a happy new year to you all!

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Josh,
another thing the users pointed me at:
How do I DELETE birthday information (calender and profile)?

Greetings

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Hi Carl,

What you are seeing is quite weird. In my 6.1.1 board I went and changed my birthday from April to January. Immediately in my calendar board the entry from April disappeared and appeared in January.

What the calendar modification on the profile birtdays does is it queries the users table for birthdays on a particular month and while the script runs to display the data in the calendar it also displays the birthday. The w3t_events table is never used for birthdays.

Very weird that your users see the events.... Did you or your users manually entered events on the calendar board? To check this, see the color of the three little arrows in front of the person's name on the particular date. If they are blue, it was generated by this modification if Red then it was manually entered in the w3t_events table as a new event.

Any chance of having a sample to have a look at the behavior?

Warm regards

Nikos


Nikos
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
I found a bug I found a bug!

I tested it with my own birthday, and it lists me as a year older than I really am. Unless I forgot how old I was already? lol

My birthday is march 5th, 1980. I entered that into my profile. But it is showing me as 23, when infact I won't be 23 until March 5th of this year.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I have an update that I'll post this evening. I noticed that and with Dave_L's help, I got this worked out.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
[]My birthday is march 5th, 1980. [/]
Baby



Nice one Jeremy, thanks for spotting that. I was wondering why one of my users insisted he was 52....

Warm regards

Nikos


Nikos
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Excellent. But nice hack, I already have people using it. They have been begging for quite a while

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
What I had done was just use the year to calculate age. Duh.... everyone's a year older come the first of the year.

What I did was convert the bday to epoch time, and subtract from current date, then calculate the age. Then I have it where they have selected the age, but not a birthday or month, it will say "aporx. age" and just figure the difference in the years.

Will write up what I changed and repost tonight.

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Maybe you like this variant of the YEAR calculation in showprofile.php
(This spares the extra "age"-lines on the showprofile.tmpl)

// --------------------
// Figure out how old they are
if ($BirthYear) {
$age = date("Y") - $BirthYear -1;
//(modifiziert!)
$birthday .= " $BirthYear  ($age)";
}

Greetings

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Updated main post to version 1.3. Fixed the bug in age calculation... thanks to Dave_L for the assistance.

If you've previously installed this mod, check my revised instructions for showprofile.php and showprofile.tmpl file.

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Hi Nikos,
I tried to put your "Show Birthdays in Calendar" in the new Calendar 6.2 Hack version. Can you help me where to integrate your fabulous hack inside the calendar hack? - Could not get it running there was a problem with the UBirthDays = $d mysql request at the place it was before.

(By the way, Gardener, it is confusing to me, that there are two open threads on calendars now: a 3.0 and a 6.2. - I use the 6.2 version.)

Thanks a lot

Last edited by caymuc; 01/03/2003 6:26 PM.
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks - works fine - I like the direct link if they have not yet entered their Birthday - a great way to encourage people to fill in the little boxes - who kows they might even update some of the other boxes there as well LOL


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Another bug...

Have a lot of people adding b-days to their profiles now, but people older than 33 are showing up as 33. So we have a lot of people 33 years old

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hmmm... .check through my code from the begining, and make sure you've got it all.

The years are showing up correctly on my site. I got lots of people in their 50s and 60s on my site.

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
in show profile.php

I looked at my birthdate and
it shows the month (Birthday January )I was born but no date ,it should look like this correct(Birthday January 13)

then it shows my age as 35
I'm still 34 not 35 till the 13th

did i miss something or did you not include the date like on the older hack ?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Did you add the update to version 1.3 that I posted just after the first of the year.

First I was just going by year, but when the year changed, everyone ended up a year off.

Grab the latest file from the first post in this thread and make the adjustments to the showprofile.php script. I also fixed the bit with the day not showing. Had a typo in a variable or something.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I grabbed the file from the first post as well and mine displays Birthday April Age 36

I take it the day and year should be there

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
showprofile.tmpl
Code
<td class="darktable"><br />Birthday<br /></td><br /><td><br />$birthday &nbsp; $BirthDay<br />


added the $BirthDay to the end now it's showing

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - guess I never posted the fix to the date not appearing. It's a misplaced bracket that screws that up.

I'm going to update the file to version 1.4... but this is how to fix the missing day.

Code
In showprofile.php my original instructions had this:<br /><br />	if ($BithhDay == "0") { $BirthDay = "";<br />	$birthday .= " $BirthDay"; }<br /><br /><br />Change that to this:<br /><br />	if ($BithhDay == "0") { $BirthDay = ""; }<br />	if ($BirthMonth) { $birthday .= " $BirthDay"; }<br />


That'll do it.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Have you figured out how to integrate Dave's grab birthday fields into yours to fill it automatically?

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
ok that did it thanks
removed my quick date addon lol

woops forgot to say
Thank you nice hack & thanks for the fix

Last edited by Dslam; 01/07/2003 11:19 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yours would have worked.... but I remember why I did what I did.... so it doesn't show the day if they don't have a month.

It's flexible, as people sometimes don't want to give all the info.

If they only give the year, it'll say "aprox. age". If they give the Month, it'll only show the month, and at least show them in "this month's birthdays". If they give all 3, then it'll give accurate age, and a birthday greeting.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]Have you figured out how to integrate Dave's grab birthday fields into yours to fill it automatically? [/]

No I haven't. It kinda confused me. I need to ask Dave to simplify for me, and let me grab the month, day and year, as separate fields. So we can add them in. But I would like to do that.

I just had a hard time following what was happening.

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
any idea what the age is advanced ?
I mean only by a year
I'm 34 right now on the 13th I'll be 35 but it's already telling me I'm 35
unless I'v been a year off on my birthday LOL you never know with me

1-13,1968

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Because initially (in the earlier version) it just took the current year minus the birth year. That caused it to advnace on the switch to 2003. The latest version uses the whole birthday (month, day and year) to calculate the birthday.

I just wasn't thinking when I did it first..... I just figured the difference in the years was the age, but that changed when the year advanced by 1. Everyone got a year older.

If you update the code to the latest version, it'll figure the exact age, if you've filled in all three fields.

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
ok got ya thanks ..

Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)