Mas*Mind
06-14-2001, 10:00 PM
Description: This hack prints some message or displays a picture in a post when that particular user has a birthday on that moment.
Version tested: 2.01, but will probaby work on all 2.0 versions
instructions:
Create a new file called birthday.php with the following content:
<?php
$today_day = date("d",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$today_month = date("m",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$today_year = date("Y",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$userday = explode("-",$post[birthday]);
if($today_day == $userday[2] && $today_month == $userday[1])
{ $bday = explode("-",$userinfo[birthday]);
if(date("Y")>$bday[0] and $bday[0]>1901 && $bday[0]!='0000')
{ $birthday = @date($calformat1,mktime(0,0,0,$bday[1],$bday[2],$bday[0]));
}
else
{ // lets send a valid year as some PHP3 don't like year to be 0
// $calformat2 should not contania year identifier so the year doesn't matter
$birthday = @date($calformat2,mktime(0,0,0,$bday[1],$bday[2],1993));
}
if($birthday=="")
{ $birthday="$bday[1]-$bday[2]-$bday[0]";
}
if($today_year > $userday[0] && $userday[0] != '0000')
{ $age = $today_year-$userday[0];
}
eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."\";");
}
?>
create a new template called postbit_birthday
with some text like:
Congrats! It's $post[username]'s birthday!
(you can use the following variables in this template:
$birthday: Will contain the birthday of the user in a nice format
$age: Will only contain a value (obviously the age of this user) when the user has filled in his birthyear
backup showthread.php
open showthread.php
and add:
// Begin birthdayhack
include("birthday.php");
// End birthdayhack
before:
eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";");
save showthread.php
insert $post[has_a_birthday] somewhere in the postbit template
enjoy :)
Version tested: 2.01, but will probaby work on all 2.0 versions
instructions:
Create a new file called birthday.php with the following content:
<?php
$today_day = date("d",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$today_month = date("m",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$today_year = date("Y",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+($bbuserinfo[timezoneoffset]-$timeoffset)*3600);
$userday = explode("-",$post[birthday]);
if($today_day == $userday[2] && $today_month == $userday[1])
{ $bday = explode("-",$userinfo[birthday]);
if(date("Y")>$bday[0] and $bday[0]>1901 && $bday[0]!='0000')
{ $birthday = @date($calformat1,mktime(0,0,0,$bday[1],$bday[2],$bday[0]));
}
else
{ // lets send a valid year as some PHP3 don't like year to be 0
// $calformat2 should not contania year identifier so the year doesn't matter
$birthday = @date($calformat2,mktime(0,0,0,$bday[1],$bday[2],1993));
}
if($birthday=="")
{ $birthday="$bday[1]-$bday[2]-$bday[0]";
}
if($today_year > $userday[0] && $userday[0] != '0000')
{ $age = $today_year-$userday[0];
}
eval ("\$post[has_a_birthday] = \"".gettemplate("postbit_birthday")."\";");
}
?>
create a new template called postbit_birthday
with some text like:
Congrats! It's $post[username]'s birthday!
(you can use the following variables in this template:
$birthday: Will contain the birthday of the user in a nice format
$age: Will only contain a value (obviously the age of this user) when the user has filled in his birthyear
backup showthread.php
open showthread.php
and add:
// Begin birthdayhack
include("birthday.php");
// End birthdayhack
before:
eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";");
save showthread.php
insert $post[has_a_birthday] somewhere in the postbit template
enjoy :)