global $context, $scripturl, $boarddir, $txt; global $db_prefix; require_once($boarddir.'/SSI.php'); //number of days before birthday is shown $number_of_days = 30; $last_year = date('U') - (365 * 24 * 60 * 60); $low_date = strftime('%Y-%m-%d', forum_time(false) - 24 * 3600); $high_date = strftime('%Y-%m-%d', forum_time(false) + $number_of_days * 24 * 3600); if (substr($low_date, 0, 4) != substr($high_date, 0, 4)) $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004-12-31' OR birthdate BETWEEN '0004-01-01' AND '0004" . substr($high_date, 4) . "'"; else $allyear_part = "birthdate BETWEEN '0004" . substr($low_date, 4) . "' AND '0004" . substr($high_date, 4) . "'"; $year_low = (int) substr($low_date, 0, 4); $year_high = (int) substr($high_date, 0, 4); $query= db_query(" SELECT ID_MEMBER, realName, YEAR(birthdate) AS birthYear, birthdate FROM {$db_prefix}members WHERE YEAR(birthdate) != '0001' AND ({$allyear_part} OR DATE_FORMAT(birthdate, '{$year_low}-%m-%d') BETWEEN '$low_date' AND '$high_date'" . ($year_low == $year_high ? '' : " OR DATE_FORMAT(birthdate, '{$year_high}-%m-%d') BETWEEN '$low_date' AND '$high_date'") . ") AND lastLogin > '{$last_year}' ORDER BY memberName", __FILE__, __LINE__); if(db_affected_rows() != 0) { $birthdays = array(); $member = array(); while ($row = mysql_fetch_assoc($query)) { $day = substr($row['birthdate'],8,2); $month = substr($row['birthdate'],5,2); $birthdays[$row['realName']] = $month . $day; $member[$row['realName']] = $row['ID_MEMBER']; } echo '
' , $showdate , ' | ';
}
echo '' . $key . ' '; $yesterday = $value; } echo ' |