Birthday Mail Extension
Verfasst: 11.10.2004 17:23
Code: Alles auswählen
includes/page_header.php
#
#-----[ FIND ]------------------------------------------------
#
$template->assign_var("GREETING_POPUP",
"<script language=\"Javascript\" type=\"text/javascript\"><!--
window.open('".append_sid('birthday_popup.'.$phpEx)."', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
//-->
</script>");
#
#-----[ REPLACE BY ]------------------------------------------
#
// START Birthday Mail Extension
$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $lang['bd_sqlerror']);
}
while( $row = $db->sql_fetchrow($result) )
{
$bd_mail = intval($row['user_email']);
}
$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $lang['bd_sqlerror']);
}
while ($row = $db->sql_fetchrow($result))
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->email_address(trim($row['user_email']));
$emailer->use_template("birthday", $row['user_lang']);
$emailer->set_subject($lang['bd_subject']);
$emailer->assign_vars(array(
'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $row['username']), 0, 25)),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
'BOARDNAME' => str_replace('<br />', "\n", "-- \n" . $board_config['sitename'])
);
$emailer->send();
$emailer->reset();
}
// END Birthday Mail Extension
Code: Alles auswählen
rse error: parse error, unexpected ';' in /../../forum/includes/page_header.php on line 365
Code: Alles auswählen
// Start add - Birthday MOD
// see if user has or have had birthday, also see if greeting are enabled
if ( $userdata['user_birthday']!=999999 && $board_config['birthday_greeting'] && create_date('Ymd', time(), $board_config['default_timezone']) >= $userdata['user_next_birthday_greeting'].realdate ('md',$userdata['user_birthday'] ) )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_next_birthday_greeting = " . (create_date('Y', time(), $board_config['board_timezone'])+1) . "
WHERE user_id = " . $userdata['user_id'];
if( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update next_birthday_greeting for user.", "", __LINE__, __FILE__, $sql);
}
// START Birthday Mail Extension
$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $lang['bd_sqlerror']);
}
while( $row = $db->sql_fetchrow($result) )
{
$bd_mail = intval($row['user_email']);
}
$sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $lang['bd_sqlerror']);
}
while ($row = $db->sql_fetchrow($result))
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->email_address(trim($row['user_email']));
$emailer->use_template("birthday", $row['user_lang']);
$emailer->set_subject($lang['bd_subject']);
$emailer->assign_vars(array(
'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $row['username']), 0, 25)),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
'BOARDNAME' => str_replace('<br />', "\n", "-- \n" . $board_config['sitename'])
);
$emailer->send();
$emailer->reset();
}
// END Birthday Mail Extension
} //Sorry user shall not have a greeting this year
// End add - Birthday MOD
danke schon mal für die hilfe!