1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
|
if ($shownextbirthdays > 0) {
unset($query);
$i = intval($shownextbirthdays);
$today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); //date("Y-m-d");
while ($i > 0){
$currentdate = formatdate("m-d", mktime(0, 0, 0, date("m"), date("d")+$i, date("Y")));
if (isset($query)) $query .= " OR birthday LIKE '%-$currentdate'";
else $query = "birthday LIKE '%-$currentdate'";
$i--;
}
$result = $db->unbuffered_query("SELECT u.userid, u.username, u.useronlinegroupid, u.birthday, g.useronlinemarking FROM bb".$n."_users u LEFT JOIN bb".$n."_groups g ON (u.useronlinegroupid=g.groupid) WHERE ".$query." ORDER BY username ASC");
while ($row = $db->fetch_array($result)) {
$nb_user_id = $row['userid'];
$row['username'] = htmlconverter($row['username']);
$nb_user_name = sprintf($row['useronlinemarking'], $row['username']);
$birthyear = intval(wbb_substr($row['birthday'], 0, 4));
$age = $currentyear - $birthyear;
$birthday = mktime(0, 0, 0, wbb_substr($row['birthday'], 6, 2), wbb_substr($row['birthday'], -2), date("Y"));
$in_days = floor(($birthday - $today)/86400);
if ($age < 1 || $age > 200) $age = '';
else $age = " ($age)";
$lang_in_days = $lang->get("LANG_JGSPORTAL_DAYS", array('$in_days' => $in_days));
if (isset($daybit[$in_days])) eval("\$daybit[$in_days] .= \"".$tpl->get("sponsor_portalboxen_geburtstag_next_bit")."\";");
else eval("\$daybit[$in_days] = \"".$tpl->get("sponsor_portalboxen_geburtstag_next_bit")."\";");
}
$j = 1;
unset($nextbirthdaybit);
while ($j <= intval($shownextbirthdays)){
if (!isset($nextbirthdaybit)) $nextbirthdaybit = $daybit[$j];
else if (isset($daybit[$j])) $nextbirthdaybit .= "<br /><br />".$daybit[$j];
$j++;
}
} |