Ejemplo n.º 1
0
$NL_Filename_N = "nl_" . date_convert_to_string($created) . "_n.html";
//komplettes newsletter raw, body+file
$NL_Filename_T = "nl_" . date_convert_to_string($created) . "_t.txt";
//geparster Newsletter Online
$NL_Filename_P = "nl_" . date_convert_to_string($created) . "_p.html";
//Bild 1
$NL_Imagename1 = "nl_" . date_convert_to_string($created) . "_1.jpg";
#image watermark and resize
//temporary image
$NL_Imagename1_tmp = "nl_" . date_convert_to_string($created) . "_1_tmp.jpg";
//source image, original, delete if resize and/or watermark!
$NL_Imagename1_source = "nl_" . date_convert_to_string($created) . "_1_src.jpg";
//resized image
$NL_Imagename1_resized = "nl_" . date_convert_to_string($created) . "_1_resized.jpg";
//watermark image
$NL_Imagename1_watermarked = "nl_" . date_convert_to_string($created) . "_1_watermarked.jpg";
$watermark_image = TM_IMGPATH . "/" . ${$InputName_ImageWatermarkImage};
//html datei
// Wurde wirklich eine Datei hochgeladen?
if (is_uploaded_file($_FILES["file"]["tmp_name"])) {
    // Gültige Endung? ($ = Am Ende des Dateinamens) (/i = Groß- Kleinschreibung nicht berücksichtigen)
    if (preg_match("/\\." . $allowed_html_filetypes . "\$/i", $_FILES["file"]["name"])) {
        // Datei auch nicht zu groß
        if ($_FILES["file"]["size"] <= $max_upload_size) {
            // Alles OK -> Datei kopieren
            if ($check) {
                //http://www.php.net/manual/en/features.file-upload.php, use basename to preserve filename for multiple uploaded files.... if needed ;)
                if (move_uploaded_file($_FILES["file"]["tmp_name"], $tm_nlpath . "/" . $NL_Filename)) {
                    $_MAIN_MESSAGE .= "<br>" . ___("HTML-Datei erfolgreich hochgeladen.");
                    $_MAIN_MESSAGE .= "<ul>" . $_FILES["file"]["name"];
                    $_MAIN_MESSAGE .= " / " . $_FILES["file"]["size"] . " Byte";
Ejemplo n.º 2
0
//remove this line or add # in front of line
//inclue tm config
include "./include/tm_config.inc.php";
//change path to full path to tm_config if the script is not in tellmatic installation directory!
//Beispielcode: letzte X Newsletter anzeigen, newsletter aber aus q holen! nur mit status versendet!
//"Newsletter-Archiv"
//This is just a very simple example!
$nl_offset = 0;
//offset, kann auch aus $_GET oder per getVar ermittelt werden....
$nl_limit = 10;
//anzahl anzuzeigender newsletter
$nl_content = 0;
//do not return content
$nl_grpid = 0;
//nl group, 0=all groups
$QUEUE = new tm_Q();
$NL = new tm_NL();
$search_nl['is_template'] = 0;
$search_nl['aktiv'] = 1;
$search_nl['status'] = array(3, 4, 5);
//started, sent, archiv, see Stats.inc.php
$Q = $QUEUE->getQ(0, 0, $nl_limit, 0, $nl_grpid, 4);
foreach ($Q as $q) {
    $N = $NL->getNL($q['nl_id'], 0, 1, 0, 1, "", 1, $search_nl);
    $nl = $N[0];
    $nl_image = "nl_" . date_convert_to_string($nl['created']) . "_1.jpg";
    $nl_imageurl = $tm_URL_FE . "/" . $tm_nlimgdir . "/" . $nl_image;
    echo "created " . display($nl['created']) . " by " . display($nl['author']) . "\n<br>\n" . "last updated " . display($nl['updated']) . " by " . display($nl['editor']) . "\n<br>\n" . "<a href=\"" . $nl['link'] . "\" target=\"_blank\">" . display($nl['title']) . "<br>" . display($nl['title_sub']) . "</a>" . "\n<br>\n" . display($nl['summary']) . "\n<br>\n" . "<a href=\"" . $nl['link'] . "\" target=\"_blank\">" . "<img src=\"" . $nl_imageurl . "\" border=0 width=200 height=200>\n" . "\n<br>\n" . display($nl_imageurl) . "</a>" . "</font>\n";
    echo "<hr>\n";
}
//for / foreach
Ejemplo n.º 3
0
 function parseNL($data, $type)
 {
     //$data=Array( nl => $NL(Array) , adr => $ADR(Array))
     //e.g. pass NL[0] as $data['nl']
     //e.g. pass ADR[0] as $data['adr']
     //ouch, another global
     global $tm_URL_FE;
     //should become a constant
     global $tm_nldir, $tm_nlattachdir, $tm_nlimgdir, $tm_nlimgpath, $tm_nlpath;
     //should become a constant too
     $Log = array();
     $AGroups = array();
     //groups the adr belongs to
     $Return = "";
     $nl_id = 0;
     $a_id = 0;
     $q_id = 0;
     $h_id = 0;
     $frm_id = 0;
     $email = "";
     $code = "";
     $memo = "";
     $f0 = $f1 = $f2 = $f3 = $f4 = $f5 = $f6 = $f7 = $f8 = $f9 = "";
     #$personalized=false;
     if (isset($data['nl']) && isset($data['nl']['id']) && check_dbid($data['nl']['id'])) {
         $nl_id = $data['nl']['id'];
         //we can assume that all in ['nl']is set
     }
     //at first we need a nl_id, if not set, exit and return empty string!
     if (!check_dbid($nl_id)) {
         $Return = "!nl_id";
         return $Return;
     }
     //next we need to know the type, parse html or testpart? if not set, exit and return empty string!
     if ($type != "text" && $type != "html") {
         $Return = "!type";
         return $Return;
     }
     $data['text'] = $data['nl']['subject'];
     $NLSUBJECT = $this->parseSubject($data);
     //if isset $data['adr'] we assume that the newsletter is personalized and need personalized parsing with all parameters and variables, unles personalized tracking is disabled, then do not track h_id and adr_id
     if (isset($data['adr']) && isset($data['adr']['id']) && check_dbid($data['adr']['id'])) {
         $ADDRESS = new tm_ADR();
         #$personalized=true;
         $a_id = $data['adr']['id'];
         $email = $data['adr']['email'];
         $code = $data['adr']['code'];
         $memo = $data['adr']['memo'];
         $f0 = $data['adr']['f0'];
         $f1 = $data['adr']['f1'];
         $f2 = $data['adr']['f2'];
         $f3 = $data['adr']['f3'];
         $f4 = $data['adr']['f4'];
         $f5 = $data['adr']['f5'];
         $f6 = $data['adr']['f6'];
         $f7 = $data['adr']['f7'];
         $f8 = $data['adr']['f8'];
         $f9 = $data['adr']['f9'];
         $AGroups = $ADDRESS->getGroup(0, $a_id, $frm_id, 0, array("aktiv" => 1, "public" => 1));
         //fetch only public groups! dont show internal groups, "public_frm_ref"=>1, to show only pub groups with ref to form!
     }
     if (isset($data['q']) && isset($data['q']['id']) && check_dbid($data['q']['id'])) {
         $q_id = $data['q']['id'];
     }
     if (isset($data['h']) && isset($data['h']['id']) && check_dbid($data['h']['id'])) {
         $h_id = $data['h']['id'];
     }
     //parse date
     //if valid q id, then use send_at date! and convert to format for nl
     //if not valid q_id given, use now
     $QUEUE = new tm_Q();
     $Q = $QUEUE->getQ($q_id);
     if (isset($Q[0])) {
         $DATE = strftime(TM_NL_DATEFORMAT, mk_microtime($Q[0]['send_at']));
     } else {
         $DATE = date(TM_NL_DATEFORMAT);
     }
     //filenames
     //html datei//template for html parts
     $NL_Filename_N = "nl_" . date_convert_to_string($data['nl']['created']) . "_n.html";
     //text datei//template for textparts
     $NL_Filename_T = "nl_" . date_convert_to_string($data['nl']['created']) . "_t.txt";
     //image1
     $NL_Imagename1 = "nl_" . date_convert_to_string($data['nl']['created']) . "_1.jpg";
     //use view.php (1088)
     if ($data['nl']['massmail'] != 1) {
         $NLONLINE_URL = $tm_URL_FE . "/view.php?1=1&amp;nl_id=" . $nl_id . "&amp;q_id=" . $q_id . "&amp;a_id=" . $a_id . "&amp;h_id=" . $h_id;
     } else {
         $NLONLINE_URL = $tm_URL_FE . "/view.php?1=1&amp;nl_id=" . $nl_id . "&amp;q_id=" . $q_id;
     }
     $NLONLINE = "<a href=\"" . $NLONLINE_URL . "\" target=\"_blank\">";
     //template values
     $IMAGE1 = "";
     $IMAGE1_URL = "";
     $LINK1 = "";
     $LINK1_URL = "";
     $ATTACHEMENTS = "";
     $ATTACHEMENTS_TEXT = "";
     $GROUP = "";
     foreach ($AGroups as $AGroup) {
         $GROUP .= display($AGroup['name']) . "<br>";
     }
     //IMAGE1
     if (file_exists($tm_nlimgpath . "/" . $NL_Imagename1)) {
         #send_log("NL Image:".$tm_URL_FE."/".$tm_nlimgdir."/".$NL_Imagename1);
         $Log[] = "NL Image:" . $tm_URL_FE . "/" . $tm_nlimgdir . "/" . $NL_Imagename1;
         $IMAGE1_URL = $tm_URL_FE . "/" . $tm_nlimgdir . "/" . $NL_Imagename1;
         $IMAGE1 = "<img src=\"" . $IMAGE1_URL . "\" border=0 alt=\"Image1\">";
     }
     //Attachements!
     $attachements = $data['nl']['attachements'];
     $atc = count($attachements);
     if ($atc > 0) {
         foreach ($attachements as $attachfile) {
             $ATTACHEMENTS .= "<a href=\"" . $tm_URL_FE . "/" . $tm_nlattachdir . "/" . $attachfile['file'] . "\" target=\"_blank\" title=\"" . $attachfile['file'] . "\">";
             $ATTACHEMENTS .= $attachfile['file'];
             $ATTACHEMENTS .= "</a><br>\n";
             $ATTACHEMENTS_TEXT .= $attachfile['file'] . ": " . $tm_URL_FE . "/" . $tm_nlattachdir . "/" . $attachfile['file'];
             $ATTACHEMENTS_TEXT .= "\n";
         }
         //foreach
     }
     //if count/atc
     //Blindimage
     if ($data['nl']['track_personalized'] == 1) {
         $BLINDIMAGE_URL = $tm_URL_FE . "/news_blank.png.php?nl_id=" . $nl_id . "&amp;q_id=" . $q_id . "&amp;a_id=" . $a_id . "&amp;h_id=" . $h_id;
     } else {
         //tracking nicht personalisiert, wie massmail!
         //koennte auch ggf oben global gesetzt werden, hier doppelt!
         $BLINDIMAGE_URL = $tm_URL_FE . "/news_blank.png.php?nl_id=" . $nl_id . "&amp;q_id=" . $q_id;
     }
     $BLINDIMAGE = "<img src=\"" . $BLINDIMAGE_URL . "\" border=0 alt=\"\">";
     //no alt!
     #send_log("NL track personalized: ".$data['nl']['track_personalized']);
     $Log[] = "NL track personalized: " . $data['nl']['track_personalized'];
     #send_log("Blindimage: ".$BLINDIMAGE_URL);
     $Log[] = "Blindimage: " . $BLINDIMAGE_URL;
     //link to unsubscribe
     $UNSUBSCRIBE_URL = $tm_URL_FE . "/unsubscribe.php?nl_id=" . $nl_id . "&amp;q_id=" . $q_id . "&amp;a_id=" . $a_id . "&amp;h_id=" . $h_id . "&amp;code=" . $code;
     $UNSUBSCRIBE = "<a href=\"" . $UNSUBSCRIBE_URL . "\" target=\"_blank\">";
     //subscribe link for touch optin or subscribe
     $SUBSCRIBE_URL = $tm_URL_FE . "/subscribe.php?doptin=1&amp;email=" . $email . "&amp;code=" . $code;
     //."&amp;touch=1"
     //optional fid form id parameter! for optin mails etc
     //check if we have a valid form id, used in subscribe url e.g. for doptin mails!
     if (isset($data['frm']) && isset($data['frm']['id']) && check_dbid($data['frm']['id'])) {
         //add frm_id of form, needed to send subscribe mail and get greeting nl id!
         $SUBSCRIBE_URL .= "&amp;fid=" . $data['frm']['id'];
     }
     $SUBSCRIBE = "<a href=\"" . $SUBSCRIBE_URL . "\" target=\"_blank\">";
     #send_log("Unsubscribe: ".$UNSUBSCRIBE_URL);
     $Log[] = "Unsubscribe: " . $UNSUBSCRIBE_URL;
     #send_log("Subscribe (touch/double optin): ".$SUBSCRIBE_URL);
     $Log[] = "Subscribe (touch/double optin): " . $SUBSCRIBE_URL;
     if (!empty($data['nl']['link'])) {
         if ($data['nl']['track_personalized'] == 1) {
             $LINK1_URL = $tm_URL_FE . "/click.php?nl_id=" . $nl_id . "&amp;q_id=" . $q_id . "&amp;a_id=" . $a_id . "&amp;h_id=" . $h_id;
         } else {
             $LINK1_URL = $tm_URL_FE . "/click.php?nl_id=" . $nl_id . "&amp;q_id=" . $q_id;
         }
     }
     $LINK1 = "<a href=\"" . $LINK1_URL . "\" target=\"_blank\">";
     #send_log("Link1: ".$LINK1_URL);
     $Log[] = "Link1: " . $LINK1_URL;
     //set template vars
     #send_log("parse Template - Massmailing");
     $Log[] = "parse Template";
     $_Tpl_NL = new tm_Template();
     $_Tpl_NL->setTemplatePath($tm_nlpath);
     $_Tpl_NL->setParseValue("IMAGE1", $IMAGE1);
     $_Tpl_NL->setParseValue("LINK1", $LINK1);
     $_Tpl_NL->setParseValue("ATTACH1", "");
     $_Tpl_NL->setParseValue("CLOSELINK", "</a>");
     $_Tpl_NL->setParseValue("BLINDIMAGE", $BLINDIMAGE);
     $_Tpl_NL->setParseValue("UNSUBSCRIBE", $UNSUBSCRIBE);
     $_Tpl_NL->setParseValue("SUBSCRIBE", $SUBSCRIBE);
     $_Tpl_NL->setParseValue("NLONLINE", $NLONLINE);
     $_Tpl_NL->setParseValue("IMAGE1_URL", $IMAGE1_URL);
     $_Tpl_NL->setParseValue("LINK1_URL", $LINK1_URL);
     $_Tpl_NL->setParseValue("ATTACH1_URL", "");
     $_Tpl_NL->setParseValue("NLONLINE_URL", $NLONLINE_URL);
     $_Tpl_NL->setParseValue("BLINDIMAGE_URL", $BLINDIMAGE_URL);
     $_Tpl_NL->setParseValue("UNSUBSCRIBE_URL", $UNSUBSCRIBE_URL);
     $_Tpl_NL->setParseValue("SUBSCRIBE_URL", $SUBSCRIBE_URL);
     $_Tpl_NL->setParseValue("DATE", $DATE);
     $_Tpl_NL->setParseValue("EMAIL", $email);
     $_Tpl_NL->setParseValue("CODE", $code);
     $_Tpl_NL->setParseValue("F0", $f0);
     $_Tpl_NL->setParseValue("F1", $f1);
     $_Tpl_NL->setParseValue("F2", $f2);
     $_Tpl_NL->setParseValue("F3", $f3);
     $_Tpl_NL->setParseValue("F4", $f4);
     $_Tpl_NL->setParseValue("F5", $f5);
     $_Tpl_NL->setParseValue("F6", $f6);
     $_Tpl_NL->setParseValue("F7", $f7);
     $_Tpl_NL->setParseValue("F8", $f8);
     $_Tpl_NL->setParseValue("F9", $f9);
     $_Tpl_NL->setParseValue("MEMO", $memo);
     $_Tpl_NL->setParseValue("TITLE", $data['nl']['title']);
     $_Tpl_NL->setParseValue("TITLE_SUB", $data['nl']['title_sub']);
     $_Tpl_NL->setParseValue("SUMMARY", $data['nl']['summary']);
     $_Tpl_NL->setParseValue("GROUP", $GROUP);
     $_Tpl_NL->setParseValue("SUBJECT", $NLSUBJECT);
     $_Tpl_NL->setParseValue("TM_VERSION", TM_VERSION);
     $_Tpl_NL->setParseValue("TM_APPNAME", TM_APPNAME);
     $_Tpl_NL->setParseValue("TM_APPDESC", TM_APPDESC);
     $_Tpl_NL->setParseValue("TM_APPURL", TM_APPURL);
     $_Tpl_NL->setParseValue("TM_APPTEXT", TM_APPTEXT);
     $_Tpl_NL->setParseValue("TM_DISCLAIMER", TM_DISCLAIMER);
     //add htmlpart!
     if ($type == "html") {
         #if ($data['nl']['content_type']=="html" || $data['nl']['content_type']=="text/html") {
         #send_log("render HTML Template: ".$NL_Filename_N);
         $Log[] = "render HTML Template: " . $NL_Filename_N;
         //attachements html code
         $_Tpl_NL->setParseValue("ATTACHEMENTS", $ATTACHEMENTS);
         //Template rendern und body zusammenbauen
         //create header:
         //1st parse header:
         $HTML_Head = $this->parseHeader(array("text" => TM_NL_HTML_START));
         $HTML_Foot = $this->parseHeader(array("text" => TM_NL_HTML_END));
         //replacement array
         $HTML_search = array("{TITLE}", "{TITLE_SUB}", "{SUBJECT}");
         $HTML_replace = array(display($data['nl']['title']), display($data['nl']['title_sub']), $NLSUBJECT);
         //replace nl vars, title subttle, subject
         $HTML_Head = str_replace($HTML_search, $HTML_replace, $HTML_Head);
         $HTML_Foot = str_replace($HTML_search, $HTML_replace, $HTML_Foot);
         $Return = $HTML_Head . $_Tpl_NL->renderTemplate($NL_Filename_N) . $HTML_Foot;
     }
     //add textpart!
     //use body_text, if body_text is empty or "" or so, convert body to text, this is a fallback, the converting is broken due to wysiwyg and reconverting of e.g. german umlauts to html entitites :O
     if ($type == "text") {
         #if ($data['nl']['content_type']=="text" || $data['nl']['content_type']=="text/html") {
         #if (!empty($NL[0]['body_text']) && $NL[0]['body_text']!="") {
         //attachements text code
         $_Tpl_NL->setParseValue("ATTACHEMENTS", $ATTACHEMENTS_TEXT);
         #$NLBODY_TEXT=$NL[0]['body_text'];
         #send_log("render Text Template: ".$NL_Filename_T);
         $Log[] = "render Text Template: " . $NL_Filename_T;
         $Return = $_Tpl_NL->renderTemplate($NL_Filename_T);
         //text!
         #} else {
         #	$NLBODY_TEXT=$NEWSLETTER->convertNL2Text($NLBODY,$NL[0]['content_type']);
         #}
     }
     //if text text/html
     //finally parse links
     $LINK = new tm_LNK();
     //filter for linkparsing, if text then text, else "" for html version of parsed links
     $filter = "";
     if ($type == "text") {
         $filter = $type;
     }
     if ($data['nl']['track_personalized'] == 1) {
         $Return = $LINK->parseLinks($Return, $filter, array("nl_id" => $nl_id, "q_id" => $q_id, "a_id" => $a_id, "h_id" => $h_id));
     } else {
         $Return = $LINK->parseLinks($Return, $filter, array("nl_id" => $nl_id, "q_id" => $q_id));
     }
     //return string, later on we will return array [0] is text and [1] is log, containing all logmessages as array
     #$Return[0]=$parsedNL Array (subject,body);
     #$Return[1]=$Log;
     return $Return;
 }
Ejemplo n.º 4
0
$Form->set_InputOrder($FormularName, $InputName_NLUpdate, 15);
$Form->set_InputLabel($FormularName, $InputName_NLUpdate, "");
$Form->set_InputSize($FormularName, $InputName_NLUpdate, 0, 1);
$Form->set_InputMultiple($FormularName, $InputName_NLUpdate, false);
//add Data
$NEWSLETTER = new tm_NL();
//nur aktive, keine templates
$NL = $NEWSLETTER->getNL(0, 0, 0, 0, 0, $sortIndex = "id", $sortType = 1, array("aktiv" => 1, "is_template" => 1));
//, "massmail"=>0 does not work yet
$nc = count($NL);
$Form->add_InputOption($FormularName, $InputName_NLUpdate, 0, "--");
for ($ncc = 0; $ncc < $nc; $ncc++) {
    //only use personalized mailing!
    if ($NL[$ncc]['massmail'] == 0) {
        //nur nl mit existierenden templates f. html/textparts
        if (file_exists($tm_nlpath . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_n.html") && file_exists($tm_nlpath . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_t.txt")) {
            $NLSubj = display($NL[$ncc]['subject']);
            $Form->add_InputOption($FormularName, $InputName_NLUpdate, $NL[$ncc]['id'], $NLSubj);
        }
    }
}
//Beschreibung
$Form->new_Input($FormularName, $InputName_Descr, "textarea", display(${$InputName_Descr}));
$Form->set_InputJS($FormularName, $InputName_Descr, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputStyleClass($FormularName, $InputName_Descr, "mFormTextarea", "mFormTextareaFocus");
$Form->set_InputSize($FormularName, $InputName_Descr, 20, 3);
$Form->set_InputDesc($FormularName, $InputName_Descr, ___("Beschreibung"));
$Form->set_InputReadonly($FormularName, $InputName_Descr, false);
$Form->set_InputOrder($FormularName, $InputName_Descr, 13);
$Form->set_InputLabel($FormularName, $InputName_Descr, "");
//Double Optin Message
Ejemplo n.º 5
0
 $percent_skip_formatted = $one_percent > 0 ? DisplayDouble($hc_skip / $one_percent, 2, ",", ".") : 0;
 //anteil failed
 $percent_fail_formatted = $one_percent > 0 ? DisplayDouble($hc_fail / $one_percent, 2, ",", ".") : 0;
 //anteil failed aktuell
 $percent_done_fail_formatted = $hc_fail > 0 || $hc_ok > 0 ? DisplayDouble($hc_fail / (($hc_fail + $hc_ok) / 100), 2, ",", ".") : 0;
 $GRP = $ADDRESS->getGroup($Q[$qcc]['grp_id']);
 $NL = $NEWSLETTER->getNL($Q[$qcc]['nl_id']);
 $send_at = $Q[$qcc]['send_at'];
 //ist datetime feld!!! deswegen keine umformatierung!
 $created_date = $Q[$qcc]['created'];
 $sent_date = "--";
 if (!empty($Q[$qcc]['sent'])) {
     $sent_date = $Q[$qcc]['sent'];
 }
 $author = $Q[$qcc]['author'];
 $logfilename = "q_" . $Q[$qcc]['id'] . "_" . $Q[$qcc]['grp_id'] . "_" . date_convert_to_string($Q[$qcc]['created']) . ".log.html";
 $logfile = $tm_logpath . "/" . $logfilename;
 $logfileURL = $tm_URL_FE . "/" . $tm_logdir . "/" . $logfilename;
 $sendFastURLPara->addParam("q_id", $Q[$qcc]['id']);
 $sendFastURLPara_ = $sendFastURLPara->getAllParams();
 $restartQFailedURLPara->addParam("q_id", $Q[$qcc]['id']);
 $restartQFailedURLPara_ = $restartQFailedURLPara->getAllParams();
 $refreshRCPTListURLPara->addParam("q_id", $Q[$qcc]['id']);
 $refreshRCPTListURLPara_ = $refreshRCPTListURLPara->getAllParams();
 $showhistURLPara->addParam("q_id", $Q[$qcc]['id']);
 $showhistURLPara_ = $showhistURLPara->getAllParams();
 $delURLPara->addParam("q_id", $Q[$qcc]['id']);
 $delURLPara_ = $delURLPara->getAllParams();
 $delAllURLPara->addParam("q_id", $Q[$qcc]['id']);
 $delAllURLPara_ = $delAllURLPara->getAllParams();
 $dellogURLPara->addParam("q_id", $Q[$qcc]['id']);
Ejemplo n.º 6
0
         $val = "list";
     }
 }
 //val2==..... aktionen fuer die adressen
 if (!empty($val2)) {
     $ac = count($adr);
     if ($val2 == "none") {
         $_MAIN_MESSAGE .= "<br>" . ___("Keine Aktion.");
     }
     if ($export == 1) {
         $_MAIN_MESSAGE .= "<br>" . ___("Adressen werden exportiert.");
         //ausgabedatei:
         //standard name aus datum fuer export generieren
         $created = date("Y-m-d H:i:s");
         //default:
         $Export_Filename = "bounce_" . date_convert_to_string($created) . ".csv";
         $fp = fopen($tm_datapath . "/" . $Export_Filename, "w");
     }
     if ($ac > 0) {
         $_MAIN_MESSAGE .= "<br>" . sprintf(___("%s Adressen zum Bearbeiten ausgewählt."), $ac);
         for ($acc = 0; $acc < $ac; $acc++) {
             $search['email'] = $adr[$acc];
             $search['email_exact_match'] = true;
             if ($export == 1) {
                 $CSV = "\"" . $adr[$acc] . "\"\n";
                 fputs($fp, $CSV, strlen($CSV));
             }
             $A = $ADDRESS->getAdr(0, 0, 0, 0, $search, "", 0, 0);
             if (isset($A[0]['id'])) {
                 if ($val2 == "delete") {
                     if (!DEMO) {
Ejemplo n.º 7
0
            $IMPORT_MESSAGE .= "<br><br>" . sprintf(___("Es wurden %s von %s Einträgen importiert und in die gewählten Gruppen eingetragen."), $iok, $i);
            //i-1
            $IMPORT_MESSAGE .= "<br>" . sprintf(___("%s Einträge waren Fehlerhaft und wurden NICHT importiert."), $ifail);
            if ($skip_existing != 1) {
                $IMPORT_MESSAGE .= "<br>" . sprintf(___("%s Eintraege sind bereits vorhanden und wurden aktualisiert."), $idouble);
            } else {
                $IMPORT_MESSAGE .= "<br>" . sprintf(___("%s Eintraege sind bereits vorhanden und wurden übersprungen."), $iskipdouble);
                //
            }
        }
        $IMPORT_MESSAGE .= "<br>" . sprintf(___("Bearbeitungszeit: %s Sekunden"), number_format($T->MidResult(), 2, ',', ''));
        $action = "adr_import";
        //import messages vor log einfuegen
        $IMPORT_LOG = $IMPORT_MESSAGE . $IMPORT_LOG;
        //logdatei schreiben:
        $logfilename = "import_" . date_convert_to_string($created) . ".html";
        $IMPORT_MESSAGE .= "<br>" . ___("Logdatei für Import wurde gespeichert unter:") . " <a href=\"" . $tm_URL_FE . "/" . $tm_logdir . "/" . $logfilename . "\" target=\"_preview\">" . $tm_logdir . "/" . $logfilename . "</a>";
        //$IMPORT_LOG nach text convertieren
        #$htmlToText=new Html2Text($IMPORT_LOG, 1024);
        #$IMPORT_LOG=$htmlToText->convert();
        //logdatei speichern
        write_file($tm_logpath, $logfilename, $IMPORT_LOG);
    } else {
        //if lines>0
    }
} else {
}
$_MAIN_MESSAGE .= $IMPORT_MESSAGE;
$group_new_name = "";
require_once TM_INCLUDEPATH . "/adr_import_form.inc.php";
require_once TM_INCLUDEPATH . "/adr_import_form_show.inc.php";
Ejemplo n.º 8
0
}
#mail loeschen und postfach aufraeumen
$Mailer->expunge();
$bctotal = count($Bounces);
$Bounces = unify_array($Bounces);
$bc = count($Bounces);
echo sprintf(___("Es wurden %s Mails durchsucht."), $mc) . "\n" . sprintf(___("%s Mails ergaben einen Treffer."), $bcmatch) . "\n" . sprintf(___("Es wurden aus %s Adressen %s (eindeutige) potentiell fehlerhafte Adressen erkannt."), $bctotal, $bc) . "\n";
if ($bc < 1) {
    exit;
}
#adressen bearbeiten
$created = date("Y-m-d H:i:s");
srand((double) microtime() * 1000000);
$rcode = rand(11, 99);
$Export_Filename = "bounceit_" . date_convert_to_string($created) . "-" . $rcode . ".csv";
$BounceDel_Filename = "bounceit-delete_" . date_convert_to_string($created) . "-" . $rcode . ".csv";
$fp = fopen($tm_datapath . "/" . $Export_Filename, "a");
$fpdel = fopen($tm_datapath . "/" . $BounceDel_Filename, "a");
$delimiter = ",";
$CSV = $ADDRESS->genCSVHeader($delimiter);
if ($fp) {
    if (!DEMO) {
        fputs($fp, $CSV, strlen($CSV));
    }
}
if ($fpdel) {
    if (!DEMO) {
        fputs($fpdel, $CSV, strlen($CSV));
    }
}
echo ___("Export") . ": " . $Export_Filename . "\n";
Ejemplo n.º 9
0
        $_MAIN_MESSAGE .= "<br>" . sprintf(___("%s Einträge aus der Gruppe %s mit dem Status %s wurden zur Prüfung vorgemerkt."), "<b>" . $ac . "</b>", "<b>" . $GRP[0]['name'] . "</b>", "<b>" . display($STATUS['adr']['status'][$search['status']]) . "</b>");
    }
}
if ($remove_duplicates == 1) {
    $_MAIN_MESSAGE .= "<br>" . sprintf(___("Duplikate aus ALLEN Gruppen werden ermittelt und geloescht"));
    if ($remove_duplicates_limit > 0) {
        $_MAIN_MESSAGE .= "<br>" . ___("Limit") . ": " . $remove_duplicates_limit;
    }
    //if not exporting,just use delete dups method
    if ($remove_duplicates_export != 1) {
        $ADDRESS->remove_duplicates(array('method' => $remove_duplicates_method, 'limit' => $remove_duplicates_limit));
    }
    //otherwise, if we want to export addresses first, we have to fetch, export and delete the adr ourselv
    if ($remove_duplicates_export == 1) {
        $created = date("Y-m-d H:i:s");
        $CSV_Filename = "duplicates_" . date_convert_to_string($created) . "";
        //extension .csv
        $CSV_Filename = $CSV_Filename . ".csv";
        $delimiter = ",";
        $fp = fopen($tm_datapath . "/" . $CSV_Filename, "a");
        if ($fp) {
            $CSV = $ADDRESS->genCSVHeader($delimiter);
            if (!DEMO) {
                fputs($fp, $CSV, strlen($CSV));
            }
            $ADDRESS->fetch_duplicates(array('method' => $remove_duplicates_method, 'limit' => $remove_duplicates_limit));
            //now export and delete each entry
            foreach ($ADDRESS->DUPLICATES['dups'] as $DUPDEL) {
                foreach ($DUPDEL['del'] as $adr_dupdel_id) {
                    //fetch data for export
                    $ADRDUP = $ADDRESS->getAdr($adr_dupdel_id, 0, 0, 0, array(), "", 0, 1);
Ejemplo n.º 10
0
${$InputName_FileExisting} = getVar($InputName_FileExisting);
//append//an bestehende datei anfügen
$InputName_Append = "append";
//
${$InputName_Append} = getVar($InputName_Append);
//aaaaand action
$set = getVar("set");
//adr gruppe
$InputName_Group = "adr_grp_id";
//gruppen id
${$InputName_Group} = getVar($InputName_Group);
//ausgabedatei:
//standard name aus datum fuer export generieren
$created = date("Y-m-d H:i:s");
//default:
$Export_Filename = "export_" . date_convert_to_string($created) . "";
if (!empty(${$InputName_File})) {
    //wenn dateiname angegeben...:
    $CSV_Filename = ${$InputName_File};
} else {
    //wenn kein name --> default
    $CSV_Filename = $Export_Filename;
}
//extension .csv
$CSV_Filename = $CSV_Filename . ".csv";
//oder
//wenn bestehende datei ausgewaehlt, nehmen wir diese!
if (!empty($file_existing)) {
    $CSV_Filename = $file_existing;
}
//neuer name im formular ist default fuer naechsten aufruf
Ejemplo n.º 11
0
 if (file_exists($tm_nlpath . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_p.html")) {
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL_FE . "/" . $tm_nldir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_p.html\" target=\"_preview\" title=\"" . ___("Onlineversion des Newsletter anzeigen: ") . $tm_nldir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_p.html\">" . tm_icon("world_go.png", ___("Onlineversion anzeigen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
 }
 //link zum bild
 if (file_exists($tm_nlimgpath . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_1.jpg")) {
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL_FE . "/" . $tm_nlimgdir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_1.jpg\" target=\"_preview\" title=\"" . ___("Bild für diesen Newsletter anzeigen: ") . $tm_nlimgdir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_1.jpg\">" . tm_icon("photo.png", ___("Bild Newsletter anzeigen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL . "/" . $delimgURLPara_ . "\"  onclick=\"return confirmLink(this, '" . ___("Bild löschen") . ": " . $tm_nlimgdir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . "_1.jpg')\" title=\"" . ___("Bild löschen") . "\">" . tm_icon("photo_delete.png", ___("Bild löschen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
 }
 //link zur html datei!
 if (file_exists($tm_nlpath . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . ".html")) {
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL_FE . "/" . $tm_nldir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . ".html\" target=\"_preview\" title=\"" . ___("HTML-Datei anzeigen") . ": " . $tm_nldir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . ".html\">" . tm_icon("page_white_world.png", ___("HTML-Datei anzeigen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL . "/" . $delhtmlURLPara_ . "\"  onclick=\"return confirmLink(this, 'HTML Datei löschen: " . $tm_nldir . "/nl_" . date_convert_to_string($NL[$ncc]['created']) . ".html')\" title=\"" . ___("HTML Datei löschen") . "\">" . tm_icon("page_white_delete.png", ___("HTML Datei löschen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
 }
 //link zum link
 if (!empty($NL[$ncc]['link'])) {
     $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $NL[$ncc]['link'] . "\" target=\"_link\" title=\"" . $NL[$ncc]['link'] . "\">" . tm_icon("page_white_link.png", ___("Link anzeigen")) . "&nbsp;";
     $_MAIN_OUTPUT .= "</a>\n";
 }
 //aktiv
 $_MAIN_OUTPUT .= "<a class=\"list_edit_entry\" href=\"" . $tm_URL . "/" . $aktivURLPara_ . "\" title=\"" . ___("aktivieren/de-aktivieren") . "\">";
 if ($NL[$ncc]['aktiv'] == 1) {
     $_MAIN_OUTPUT .= tm_icon("tick.png", ___("Deaktivieren")) . "&nbsp;";
 } else {
     $_MAIN_OUTPUT .= tm_icon("cancel.png", ___("Aktivieren")) . "&nbsp;";
     #if (!$user_is_expert) $_MAIN_OUTPUT.=___("Aktivieren");
 }