/* PHP CODE HERE */
$maxdaysago=60;
$temp = getdate($now);
$month = $temp["mon"];
$mday = $temp["mday"];
$year = $temp["year"];
$visitlimit=time()-60*60*24*$maxdaysago;
if (isset($config['BIRTHDAYS_IN_CALENDAR']) && $config['BIRTHDAYS_IN_CALENDAR']) {
$query = "
SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR,t1.USER_MEMBERSHIP_LEVEL
FROM {$config['TABLE_PREFIX']}USERS as t1,
{$config['TABLE_PREFIX']}USER_PROFILE as t2,
{$config['TABLE_PREFIX']}USER_DATA as t3
WHERE t2.USER_BIRTHDAY LIKE ?
AND t1.USER_IS_BANNED != '1'
AND t2.USER_PUBLIC_BIRTHDAY = '1'
AND t3.USER_LAST_VISIT_TIME >= ?
AND t1.USER_ID = t2.USER_ID
AND t1.USER_ID = t3.USER_ID
";
$sth = $dbh -> do_placeholder_query($query,array("$month/$mday/%",$visitlimit),__LINE__,__FILE__);
$marray[0] = "";
while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) {
@list($bmonth,$bday,$byear) = @split("/",$birthday);
$age = "";
if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser && $byear) {
$age = $year - $byear;
$age = " ($age)";
} // end if
$Color = trim($Color);
$uname = $html->user_color($uname, $Color, $PostStatus);
$bdays .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=showprofile&User=$birthdayuser\">$uname</a>$age, ";
} // end while
} // end if
if (!$bdays)
{
$bdays="No birthdays today";
}
else
{
$bdays = substr($bdays,0,strlen($bdays)-2);
$bdays = "Happy birthday ".$bdays.".";
}
/* BODY HERE */
$body = <<<EOF
$bdays
EOF;