I've just cobbled this together for forums/index.php.
1) Open index.php and under the line that starts $templatesused='error_nopermission you need to add this:
Code:
$templateused.=',calendar_birthday';
then, straight after require('./global.php'); add this:
Code:
$today = vbdate("m-d",time());
$birthdays = $DB_site->query("SELECT * FROM user WHERE birthday LIKE('%-$today')");
while ($birthday = $DB_site->fetch_array($birthdays)) {
$bd_user = $birthday[username];
$bd_userid = $birthday[userid];
$datebits = explode("-", $birthday[birthday]);
$bdage = date("Y") - $datebits[0];
if ($bdage > 0) $age = "($bdage)";
else $age = "";
eval ("\$todaybirthdays .= \"".gettemplate("calendar_birthday")."\";");
}
When you have done that, edit your forumhome template and add $todaybirthdays wherever you want the birthdays to appear.
Using this hack will add one extra query to the main forums page (as you can see).
|