Previous Thread
Next Thread
Print Thread
Rating: 10
Page 1 of 2 1 2
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

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.

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

New Files: none

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.
Attachments
77944-ProfileBirthday1.5.txt (0 Bytes, 259 downloads)

Last edited by JoshPet; 06/12/2003 3:37 AM.
Sponsored Links
Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
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?

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
// ---------------------
// Figure out what their Birthday is - by JoshPet

if ($BirthMonth == "Jan") { $birthday = "Januari"; }
if ($BirthMonth == "Feb") { $birthday = "Februari"; }
if ($BirthMonth == "Mar") { $birthday = "Maart"; }
if ($BirthMonth == "Apr") { $birthday = "April"; }
if ($BirthMonth == "May") { $birthday = "Mei"; }
if ($BirthMonth == "Jun") { $birthday = "Juni"; }
if ($BirthMonth == "Jul") { $birthday = "Juli"; }
if ($BirthMonth == "Aug") { $birthday = "Augustus"; }
if ($BirthMonth == "Sep") { $birthday = "September"; }
if ($BirthMonth == "Oct") { $birthday = "Oktober"; }
if ($BirthMonth == "Nov") { $birthday = "November"; }
if ($BirthMonth == "Dec") { $birthday = "December"; }
if ($BithhDay == "0") { $BirthDay = ""; }
if ($BirthMonth) { $birthday .= " $BirthDay"; } [/]

I know it's a very minor thing, but here in Holand that's the way the dates are displayed

Thanks in advance ! Pasquale

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Try changing this line:

if ($BirthMonth) { $birthday .= " $BirthDay"; }



to this:

if ($BirthMonth) { $birthday = "$BirthDay ".$birthday; }

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Yep, that did the trick! Thanks a lot!

Sponsored Links
Joined: Oct 2002
Posts: 64
Power User
Power User
Offline
Joined: Oct 2002
Posts: 64
Hello I have small problem

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)

when av is upload on my serwer every thing its ok

plis help me

Joined: Oct 2002
Posts: 64
Power User
Power User
Offline
Joined: Oct 2002
Posts: 64
>>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

Joined: Oct 2002
Posts: 64
Power User
Power User
Offline
Joined: Oct 2002
Posts: 64
ok secend problem is gone that was my mistake
byt 1st stil is

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That's a bug that's been in threads forever. It happens whenever you edit your profile.... it readjusts the picture size to those in the theme file.

I think Rick has this fixed for 6.3. But it's got nothing to do with the birthday mod.

Joined: Apr 2002
Posts: 30
User
User
Offline
Joined: Apr 2002
Posts: 30
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.

I am running 6.2.3 with zlib enabled.

Thanks!


Paul Fries
Systems Administrator
CWIE LLC
Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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
Attachments
83954-birthday.gif (0 Bytes, 47 downloads)

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Let me look at it more cloesly in a bit. I think I've got the stylesheet class in the tr instead of the td - but I'll study it in a bit.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Not a problem, just thought I'd point it out

Joined: Oct 2002
Posts: 64
Power User
Power User
Offline
Joined: Oct 2002
Posts: 64
I have instaled on 6.3b1 and its ok

http://www.forum.tarnow.pl/ubbthreads/ubbthreads.php

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Jeremy -
This is an issue with some browssers - I just updated my instructions.

We need to move the class from the tr to the td tag:

In ubbthreads.tmpl find this

<tr class="lighttable">
<td class="small" valign="top" colspan="3">


Change to this:

<tr>
<td class="small" valign="top" colspan="3" class="lighttable">

That should fix it.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Hmm, odd. That didn't fix it. Although it looks as if it should have, still a black background.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
When viewing the source of my index page, here is what it shows for the area starting your hack:

Code
!--Start of Birthday Mod - by JoshPet--><br />        <TR><br />          <TD class=small vAlign=top colSpan=3><B></B><B>This Month's <br />            Birthdays:</B>


Then it lists all of the birthdays. I don't see the lighttable class being called at all

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Jeremy - I have just installed in on 6.3 and am getting the same problem, so it is not just you


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That td needs the lighttable class.

Otherwise it'll take on the background in some browsers - as some browsers don't like it in the tr tag.

See my fix above.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Nope - doesn't work as above

needs to be

<tr>
<td class="lighttable" class="small" valign="top" colspan="3" >



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

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Works the other way round Jeremy


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
Hey, thanks Ian, I just used what you had posted, and it works Thanks.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Cool.

I was never seeing the problem - but I've heard of that before.

Thanks for tracking it down Ian - I'll update the file tonight.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
At least I am useful 5% of the time - it is the other 95% that concerns me


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Okay, I've installed this hack before, but I'm having problems with it now... I try updating my birthday, and then on changebasic, I get this error:

SQL ERROR: Unable to do_query: UPDATE w3t_Users SET (removed some stuff for space).......
U_AcceptPriv = 'yes', U_OnlineFormat = 'no' U_BirthMonth = 'Mar', U_BirthDay = '24', U_BirthYear = '1953' WHERE U_Number = '6'


You have an error in your SQL syntax near 'U_BirthMonth = 'Mar', U_BirthDay = '24', U_BirthYear = ' at line 22


Anyone know what I should check?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You're missing the comma in the query after the U_OnlineFormat line.

There should be a comma added to the end of that line.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Josh where should I look for that?

In editbasic - this is what I find --

,U_AcceptPriv,U_OnlineFormat,U_PicHeight,

Coma is there? Where else should I look? I feel like such a newb!

-peter

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Look in changebasic.php for the missing comma.

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.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Allusivekudos,

In changebasic.php the code should read

Code
// --------------------------<br />// Update the User's profile<br />   $query  = "<br />    UPDATE {$config['tbprefix']}Users<br />    SET U_Password   = '$Password_q',<br />    U_Email          = '$Email_q',<br />    U_Fakeemail      = '$Fakeemail_q',<br />    U_Name           = '$Name_q',<br />    U_Signature      = '$Signature_q',<br />    U_Homepage       = '$Homepage_q',<br />    U_Occupation     = '$Occupation_q',<br />    U_Hobbies        = '$Hobbies_q',<br />    U_Location       = '$Location_q',<br />    U_Bio            = '$Bio_q',<br />    U_Extra1         = '$ICQ_q',<br />    U_Extra2	   = '$Extra2_q',<br />    U_Extra3	   = '$Extra3_q',<br />    U_Extra4	   = '$Extra4_q',<br />    U_Extra5	   = '$Extra5_q',<br />    U_Picture        = '$Picture_q',<br />    U_Visible	   = '$Visible_q',<br />    U_AcceptPriv     = '$AcceptPriv_q',<br />    U_OnlineFormat   = '$OnlineFormat_q',<br />    U_PicWidth       = '$imagewidth',<br />    U_PicHeight      = '$imageheight',<br />    U_BirthMonth     = '$Birthmonth_q',<br />    U_BirthDay       = '$Birthday_q',<br />    U_BirthYear        = '$Birthyear_q'    <br />    $extra<br />    WHERE U_Number = '{$user['U_Number']}'<br />   "; <br />   $dbh -> do_query($query); <br />


make sure you have a comma after U_OnlineFormat = '$OnlineFormat_q'


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks ian.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Thank you sooooooo much! This was driving me crazy!!!

Seriously, that was muchly appreciated. Both of you.



-peter

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Isn't there supposed to be a U_CoppaUser in the showprofile.php instructions under "Grab the profile for this user"?

Gorlum #244571 07/01/2003 10:19 AM
Joined: Oct 2002
Posts: 18
Newbie
Newbie
Offline
Joined: Oct 2002
Posts: 18
[]Ian_W said:
Nope - doesn't work as above

needs to be

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

Brent

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
[]Ian_W said:
Nope - doesn't work as above

needs to be

<tr>
<td class="lighttable" class="small" valign="top" colspan="3" >

[/]

Correction to this.

It needs to be


<tr>
<td class="lighttable" valign="top" colspan="3" >
<span class="small">
<b>$TodayIntro</b> $todaybday
<b>$MonthIntro</b> $thismonthbday
$BirthdayWarning
</span>
</td>
</tr>

This works fine. - the earlier version did not display the correct size text.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jun 2001
Posts: 43
User
User
Offline
Joined: Jun 2001
Posts: 43
I can not edit year field. Even when I has edited this field in MySql table, I not seen year in my profile.

Thanks.

Joined: Feb 2001
Posts: 26
User
User
Offline
Joined: Feb 2001
Posts: 26
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?

Last edited by xeney; 07/13/2003 1:37 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That's the way it currently works.

The year does not appear in people's profile. So if they leave the year off their brithday - then the age calculation will not display either.

This hack isnt' connected to the COPPA check - so you should be fine removing it from the template.

Auto - same answer - the year does not appear in their profile - just their age (if they have a year filled in).

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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).

Page 1 of 2 1 2

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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)