How to make dropdownlist,
was described by vano some post above.
I didn't made the year as dropdownlist, cause it's to much scrolling i think.
To appear actual events on every site,
copy the listed code below to the page header.
to make it appear only on certain sites,
copy the code only to the specific php files:
if($config['birthday_index'] == 1) {
$currentdate = date("m-d", time());
$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
ORDER BY ".get_user_table_field("", "user_name");
$result = $site_db->query($sql);
$birthday_list = "";
while($row = $site_db->fetch_array($result)) {
$age = calc_age($row[$user_table_fields['birthday']]);
$birthday_list .= ($birthday_list) ? ", " : "";
$birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")";
}
$site_template->register_vars(array(
"lang_events" => $lang['events'],
"birthday_list" => $birthday_list,
"lang_congratulate" => $lang['congratulate']
));
}
this code comes then in the template file, where it should appear:
<!-- Start Events -->
{if birthday_list}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td >
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td valign="top" class="head1">
<table width="100%" border="0" cellpadding="4" cellspacing="2">
<tr>
<td class="head1" valign="top">{lang_events}</td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" >
<table width="100%" border="0" cellpadding="4" cellspacing="1" width="98%">
<tr>
<td width="40" class="catbgcolor"><img src="{template_url}/images/birthday_baloon.gif" alt=""></td>
<td class="catbgcolor"><b>{lang_congratulate}</b><br>{birthday_list}</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
{endif birthday_list}
<!-- End Events -->
And how can I put a space between day and month on the member-page? Now there is no space between the day and the month --> 31.März instead of 31. März
change this line:
$user_birthday = $birthday[2].".".$lang['months'][sprintf("%02d",$birthday[1])];
into
$user_birthday = $birthday[2].". ".$lang['months'][sprintf("%02d",$birthday[1])];