<?php

define('_VALID_MOS', 1);
require_once '/home1/ctcweb9/public_html/includes/alastair.php';
require_once '/home1/ctcweb9/public_html/mailchimp/moderation.config.php';
GetLogonDetails($con, $username);
$dirs = array(ModerationConfig::GetInboxDir() . "/cur", ModerationConfig::GetInboxDir() . "/new", ModerationConfig::GetUnmoderatedDir() . "/cur", ModerationConfig::GetUnmoderatedDir() . "/new", ModerationConfig::GetModeratedDir() . "/cur", ModerationConfig::GetModeratedDir() . "/new");
foreach ($dirs as $dir) {
    $files = scandir($dir);
    foreach ($files as $file) {
        if (is_dir("{$dir}/{$file}")) {
            continue;
        }
        echo "deleting {$dir}/{$file}</br>";
        unlink("{$dir}/{$file}");
    }
}
$dir = "/home1/ctcweb9/public_html/mailchimp/TestEmails";
$files = scandir($dir);
foreach ($files as $file) {
    if (is_dir("{$dir}/{$file}")) {
        continue;
    }
    echo "copying {$dir}/{$file} to " . ModerationConfig::GetInboxDir() . "/cur/{$file}</br>";
    file_put_contents(ModerationConfig::GetInboxDir() . "/cur/{$file}", file_get_contents("{$dir}/{$file}"));
}
Exemple #2
0
             if (MailChimpSend($listid, $step2SubjectPrefix . $subject, $body, $from, $from, "You") === false) {
                 $ctcaction = "NOT sent to {$listname} by {$modname} - API call failed";
                 $action = "warning";
             } else {
                 $ctcaction = "sent to {$listname} by {$modname}";
             }
         }
     }
     $captionweb = "This message has just been {$ctcaction}";
     if (!$isImg) {
         // Add ctcaction to the message
         $raw = "ctc-action: {$ctcaction}\n{$raw}";
         file_put_contents(ModerationConfig::GetModeratedDir() . "/cur/{$msgid},S=" . strlen($raw), $raw);
         unlink($files[0]);
         if ($prevaction == "edit") {
             file_put_contents(ModerationConfig::GetModeratedDir() . "/cur/{$msgid}.edited.html", "<h3>" . htmlentities($subject) . "</h3>\n{$body}");
         }
     }
 } else {
     if ($location == "unmoderated" && $action == "edit") {
         $captionimg = "Click to edit before sending or discarding";
         $captionweb = "Edit before sending or discarding";
     } else {
         if ($location == "moderated" && ($action == "undo" || ($action = "retry"))) {
             // remove ctcaction from message
             $raw = str_replace("ctc-action: {$ctcaction}\n", "", $raw);
             file_put_contents(ModerationConfig::GetUnmoderatedDir() . "/cur/{$msgid},S=" . strlen($raw), $raw);
             unlink($files[0]);
             $ctcaction = "";
             $action = "edit";
             $captionimg = "Click to edit before sending or discarding";