<?php

/*
	[Discuz!] (C)2001-2006 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$RCSfile: birthdays_daily.inc.php,v $
	$Revision: 1.10.2.1 $
	$Date: 2007/02/07 15:48:19 $
*/

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

if($maxbdays) {
	require_once DISCUZ_ROOT.'./include/cache.func.php';
	updatecache('birthdays');
	updatecache('birthdays_index');
}

if($bdaystatus) {
	$today = gmdate('m-d', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
	$query = $db->query("SELECT uid, username, email, bday FROM {$tablepre}members WHERE RIGHT(bday, 5)='$today' ORDER BY bday");
	global $member;
	while($member = $db->fetch_array($query)) {
		sendmail("$member[username] <$member[email]>", 'birthday_subject', 'birthday_message');
	}
}

?>