$greets = file(C_BDAY_PATH);
                }
                while (list($dob_username, $dob_firstname, $dob_lastname, $dob_email, $dob_birthday, $dob_lang) = $ChatB->next_record()) {
                    $dob_name = $dob_firstname != "" ? $dob_firstname : $dob_username;
                    $greet = rand(0, sizeof($greets) - 1);
                    $greet_text = $greets[$greet];
                    $greet_text = str_replace("<br />", $eol, $greet_text);
                    if ($dob_lang && file_exists("localization/" . $dob_lang . "/localized.chat.php")) {
                        include_once "localization/" . $dob_lang . "/localized.chat.php";
                    } else {
                        include_once "localization/" . C_LANGUAGE . "/localized.chat.php";
                    }
                    $dob1_subject = sprintf($L_DOB_SUBJ, $dob_name);
                    if (send_dob_email($dob_name, $dob_email, "[" . (C_CHAT_NAME != "" ? C_CHAT_NAME : APP_NAME) . "] " . $dob1_subject, $greet_text)) {
                        include_once "admin/mail4admin.lib.php";
                        send_email_admin($Sender_name . " <" . $Sender_email . ">", "[" . (C_CHAT_NAME != "" ? C_CHAT_NAME : APP_NAME) . "] " . $dob1_subject . " - copy", "This is a copy:" . $eol . $eol . $greet_text . $eol . $eol . $dob1_subject . $eol . $dob_birthday, "", "");
                        $ChatB->query("UPDATE " . C_REG_TBL . " SET bday_email_sent=" . time() . " WHERE username='******'");
                    }
                    unset($dob_username, $dob_firstname, $dob_lastname, $dob_name, $dob_email, $dob_birthday, $dob_lang, $dob1_subject, $greet_text);
                }
            }
        }
    }
    $ChatB->close();
}
$ChatM = new DB();
# clean old bot entrances but keep the last one
// Archive and Clean the old messages
$ChatM->query("SELECT m_time FROM " . C_MSG_TBL . " WHERE username = '******' AND message LIKE '%\"" . C_BOT_NAME . "\"%' ORDER BY m_time DESC LIMIT 1");
if ($ChatM->num_rows() > 0) {
    list($bot_time) = $ChatM->next_record();
Exemple #2
0
    if ($emails != "") {
        $SendTo = array_merge($SendTo, $SendToExtra);
    }
    if (count($SendTo) > 0 && trim($subject) != "" && trim($message) != "") {
        if ($sign) {
            $message .= $eol . $signature;
        }
        include 'mail4admin.lib.php';
        $MultiSend = "";
        for (reset($SendTo); $mailTo = current($SendTo); next($SendTo)) {
            $MultiSend .= $mailTo . ", ";
            if ($MultiSend == "") {
                break;
            }
        }
        $Send = send_email_admin($MultiSend, $subject, $message, $pmc_email, $BCC);
        if ($Ccopy) {
            $MessCc = "<tr><td width=1% nowrap=\"nowrap\"><b>Cc:</b></td><td><b>" . $pmc_username . "</b> &lt;" . $pmc_email . "></td></tr>";
        }
        $Success = "<table border=1 width=70% class=\"msg2\"><tr><td width=1% nowrap=\"nowrap\"><b>From:</b></td><td><b>" . $Sender_Name1 . "</b> &lt;" . $Sender_email . "></td></tr><tr><td width=1% nowrap=\"nowrap\" class=\"success\"><b>" . A_SHEET4_2 . "</b></td><td>" . (!$BCC ? "<b>" . str_replace(">,", ">,<b>", str_replace("<", "</b>&lt;", implode(", ", $SendTo))) : "") . "</td></tr>" . $MessCc . "<tr><td width=1% nowrap=\"nowrap\" class=\"error\"><b>Bcc:</b></td><td>" . ($BCC ? "<b>" . str_replace(">,", ">,<b>", str_replace("<", "</b>&lt;", implode(", ", $SendTo))) : "") . "</td></tr><tr><td width=1% nowrap=\"nowrap\"><b>" . A_SHEET4_4 . "</b></td><td>" . stripslashes($subject) . "</td></tr><tr><td width=1% nowrap=\"nowrap\"><b>" . A_SHEET4_5 . "</b></td><td>" . stripslashes(str_replace("\n", "<br />", $message)) . "</td></tr></table>";
        $Message = $Send ? A_SHEET4_7 . $Success : A_SHEET4_8;
        $MsgStyle = $Send ? "success" : "error";
    } else {
        $Message = A_SHEET4_9;
        $MsgStyle = "error";
    }
}
?>

<P CLASS=title><?php 
echo A_SHEET4_1;