I have this mod for my forum and it calls the birthdate from the database. I would like to have it not see the year. What is happening if a person puts a year in the box in their profile it makes it Dec 31st because that year is already over. There is no way to remove that box from the code according to the forum tech people. I've added the two pieces that refer to date. It already is written where it only shows the month and day in the view. Thank you to anyone that can help.
[PHP]$birthdays = get_birthdays() ;
if(!$birthdays) {
$text = 'No birthdays yet';
} else {
$num = count($birthday s);
$i = 1;
foreach($birthd ays as $b) {
$date = explode("-", $b["user_birth day"]);
$user = get_user($b["user_id"]);
$user_menus[] = create_user_pop up($user);
if($date[2] == date('j')) {
$text.= "<img src='" . BASE_DIR . "/birthday.gif' title=\"User's birthday today!\"/>";
$dateprint = '<span style=\'color:r ed\'><strong>TO DAY!</strong></span>';
} else {
$dateprint = date('F jS', mktime(0, 0, 0, $date[1], $date[2], $date[0]));
}
$text .= user_link_code( $b["user_id"], $b["user_name"]);
$text .= " (" . $dateprint . ")";
if($num > $i) {
$text .= ', ';
}
$i++;
}
} [/PHP]
[PHP]/**** BEGIN BIRTHDAYS TODAY ****/
function get_birthdays() {
$result = db_query("SELEC T user_id, user_name, user_birthday FROM wowbb_users
WHERE DAYOFMONTH(user _birthday) >= DAYOFMONTH(NOW( )) AND MONTH(user_birt hday) = MONTH(CURRENT_D ATE) AND DAYOFMONTH(user _birthday) < DAYOFMONTH(CURR ENT_DATE)+7
ORDER BY DAYOFMONTH(user _birthday) ASC;");
while($row = db_fetch_row($r esult)) {
$birthdays[] = $row;
}
return $birthdays;
}
/**** END BIRTHDAYS TODAY ****/[/PHP]
[PHP]$birthdays = get_birthdays() ;
if(!$birthdays) {
$text = 'No birthdays yet';
} else {
$num = count($birthday s);
$i = 1;
foreach($birthd ays as $b) {
$date = explode("-", $b["user_birth day"]);
$user = get_user($b["user_id"]);
$user_menus[] = create_user_pop up($user);
if($date[2] == date('j')) {
$text.= "<img src='" . BASE_DIR . "/birthday.gif' title=\"User's birthday today!\"/>";
$dateprint = '<span style=\'color:r ed\'><strong>TO DAY!</strong></span>';
} else {
$dateprint = date('F jS', mktime(0, 0, 0, $date[1], $date[2], $date[0]));
}
$text .= user_link_code( $b["user_id"], $b["user_name"]);
$text .= " (" . $dateprint . ")";
if($num > $i) {
$text .= ', ';
}
$i++;
}
} [/PHP]
[PHP]/**** BEGIN BIRTHDAYS TODAY ****/
function get_birthdays() {
$result = db_query("SELEC T user_id, user_name, user_birthday FROM wowbb_users
WHERE DAYOFMONTH(user _birthday) >= DAYOFMONTH(NOW( )) AND MONTH(user_birt hday) = MONTH(CURRENT_D ATE) AND DAYOFMONTH(user _birthday) < DAYOFMONTH(CURR ENT_DATE)+7
ORDER BY DAYOFMONTH(user _birthday) ASC;");
while($row = db_fetch_row($r esult)) {
$birthdays[] = $row;
}
return $birthdays;
}
/**** END BIRTHDAYS TODAY ****/[/PHP]