Not sure if I'm off topic here, anyway I just wanna share a little mod I made to the official happy birthay rule so that the check it's made from the joomla (2.5.x) user profile data instead that from the alphauserpoints user data.
install the happy birthay rule, than edit the file plugins/user/sysplgaup_happybirthday/sysplgaup_happybirthday.php
first replace the query (line 36):
$query = "SELECT id FROM #__alpha_userpoints WHERE userid='".intval($instance->get('id'))."' AND birthdate!='0000-00-00'";
width:
$query = "SELECT profile_value FROM #__user_profiles WHERE user_id='".intval($instance->get('id'))."' AND profile_key='profile.dob' AND profile_value!='\"0000-00-00\"'";
than replace the check method (from line 42 to 47):
$year = date('Y');
// check if birthday today
$query = "SELECT id FROM #__alpha_userpoints WHERE userid='".intval($instance->get('id'))."' AND DATE_FORMAT(birthdate, '%-%m-%d')=DATE_FORMAT(NOW(), '%-%m-%d');";
$db->setQuery( $query );
$happybirthday = $db->loadResult();
if ( $happybirthday )
width:
$birthdate = str_replace( '"' , '', $birthdate ); // strips double quotes from the db result
$year = date('Y');
$today = date('m-d');
$happybirthday = substr_compare( $birthdate, $today , 5, 5 ); // check if birthday today
if ( $happybirthday === 0 ) // if it's 0 and not null
the check it's made directly with the php function substr_compare() instead that from mysql DATE_FORMAT comparison because joomla stores the user profile data type as a VARCHAR and contains double quotes.
That's it. hope could be usefoul to someone. cya.