PDA

View Full Version : [RELEASE] Birthday Hack


10-02-2000, 04:02 AM
This hack adds a birthday field to the users profile. It is viewable when a profile is viewed.

It will be required for the calendar hack.

Birthday Hack v.9 (http://www.hedgehogwheels.com/hacks/birthday_hack.txt)

10-04-2000, 07:01 PM
Maybe stupid question? But why leaving out the birthyear? Is it too difficult?

10-15-2000, 01:41 PM
bad_birthday template doesnt seem to work.
when i modify my profile and change the month to a blank, but fill in a date, it says the administrator has banned my email, instead of giving the error message.

10-15-2000, 09:26 PM
This has nothing to do with your email so you have done something wrong.

10-15-2000, 10:02 PM
i havent the faintest clue about what i did wrong, everything works except for that error, test it out (http://www.ctycamp.com/forums/index.php3)

10-16-2000, 06:55 PM
Rangersfan? luke? anyone?

10-16-2000, 07:42 PM
After looking at the instructions for the Birthday Hack I found your error...

It says:

Add this code:
[begin]
if ( ($day == -1 && $month != -1) || ($day !=-1 && $month == -1) )
{
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_banemail")."\");");
exit;
}
if (($day == -1)&&($month==-1))
{
$birthday = "";
}
else
{
$birthday = $month . "," . $day;
}
[end]


it should be:

Add this code:
[begin]
if ( ($day == -1 && $month != -1) || ($day !=-1 && $month == -1) )
{
eval("echo standarderror(\$bbtitle,\"".gettemplate("bad_birthday")."\");");
exit;
}
if (($day == -1)&&($month==-1))
{
$birthday = "";
}
else
{
$birthday = $month . "," . $day;
}
[end]


Make sure to add the second code twice as the intructions currently say.

p.s. I think a better name for the "bad_birthday" template would be "error_badbirthday" so that it gets listed with the other errors. :)

[Edited by wluke on 10-16-2000 at 04:48 PM]

10-16-2000, 08:07 PM
[smacks himself in the head] shoulda seen that! lol, only started using vB a couple of weeks ago, but I've been watching the boards for a number of months

10-25-2000, 08:16 PM
Nice hack Rangersfan

What do you have to do to have the year of birth included as an option? like you have on your board.

10-25-2000, 08:50 PM
I just need to update the instructions, will try to also get that done :)

One of my users emailed me that her birthday was showing up wrong on the calendar. She claimed she was 28 but she was born in Dec 1972. I has to explain to her that she was really 27 and not as old as she thought. The calendar does have its benefits for the age-challenged users out there.

10-25-2000, 08:52 PM
:)

thanks

11-01-2000, 02:36 AM
I've added the table, edited member.php, and modified the templates.

How come it won't show up in the profile?

http://aforums.com/member.php?action=getinfo&userid=31

11-01-2000, 03:32 AM
I dont even see the row that you should have put in the getinfo template so you at least need to do that (it is in the instructions)

12-12-2000, 12:30 AM
hmm ... dont see any differents after installing this hack. YES, i added the variable in 'getinfo'-template
$birthday

thx so far

12-12-2000, 05:24 PM
hi!
will u make a real final that works 100 percent....

if u do let me know ;)
thx

i need the hack
its very usefull

THX

12-12-2000, 05:46 PM
"real final"?

This does work 100% if you follow the instructions.

In any event I will not mess with this anymore as vb2.0 will allow you to input birthdays.

12-12-2000, 06:00 PM
ok

thx for fast answer
*wondering*

i am not new here but my first post .....

thx anyway will wate for 2.0

01-02-2001, 10:51 AM
in your file you said (ie edit member.php)

Find this line:
$username=htmlspecialchars($userinfo[username]);
Add this BEFORE it!

[begin]
if ($userinfo[birthday] != "")
{
$birthdate = explode(",",$userinfo[birthday]);
if ($birthdate[0] == 1)
{ $birthday = "January " . $birthdate[1]; }
else if ($birthdate[0] == 2)
{ $birthday = "February " . $birthdate[1]; }
else if ($birthdate[0] == 3)
{ $birthday = "March " . $birthdate[1]; }
else if ($birthdate[0] == 4)
{ $birthday = "April " . $birthdate[1]; }
else if ($birthdate[0] == 5)
{ $birthday = "May " . $birthdate[1]; }
else if ($birthdate[0] == 6)
{ $birthday = "June " . $birthdate[1]; }
else if ($birthdate[0] == 7)
{ $birthday = "July " . $birthdate[1]; }
else if ($birthdate[0] == 8)
{ $birthday = "August " . $birthdate[1]; }
else if ($birthdate[0] == 9)
{ $birthday = "September " . $birthdate[1]; }
else if ($birthdate[0] == 10)
{ $birthday = "October " . $birthdate[1]; }
else if ($birthdate[0] == 11)
{ $birthday = "November " . $birthdate[1]; }
else if ($birthdate[0] == 12)
{ $birthday = "December " . $birthdate[1]; }
else
{ $birthday = "DOH! Error"; }
}
else
{
$birthday = " ";
}
[end]

But i cannot found such coding

03-21-2001, 10:40 PM
how can I add a birthday year?