コード例 #1
0
if (!isset($offset)) {
    $offset = getVar("offset");
}
if (empty($offset) || $offset < 0) {
    $offset = 0;
}
if (!isset($limit)) {
    $limit = getVar("limit");
}
if (empty($limit)) {
    $limit = 25;
}
$no_list = getVar("no_list");
//sort und sorttype nach search verschoben
$ADDRESS = new tm_ADR();
$QUEUE = new tm_Q();
$BLACKLIST = new tm_BLACKLIST();
$adr_grp_id = getVar("adr_grp_id");
$adr_id = getVar("adr_id");
$set = getVar("set");
$val = getVar("val");
$doit = getVar("doit");
//wird per js an url angefuegt!!! confirm()
if (!isset($search)) {
    $search = array();
}
require_once TM_INCLUDEPATH . "/adr_search.inc.php";
if ($no_list != 1) {
    if ($set == "aktiv") {
        $ADDRESS->setAktiv($adr_id, $val);
        if ($val == 1) {
コード例 #2
0
${$InputName_Autogen} = getVar($InputName_Autogen);
$InputName_Blacklist = "check_blacklist";
${$InputName_Blacklist} = getVar($InputName_Blacklist);
$InputName_Proof = "proof";
${$InputName_Proof} = getVar($InputName_Proof);
$check = true;
//abgeschickt?
if ($set == "save") {
    if (!empty($nl_id)) {
        $HOST = $HOSTS->getHost($host_id, array("aktiv" => 1, "type" => "smtp"));
        //SMTP Server ausgewaehlt?
        if (count($HOST) == 1) {
            $gc = count($adr_grp);
            //sind ueberhaupt gruppen gewaehlt???
            if ($gc > 0) {
                $QUEUE = new tm_Q();
                $ADDRESS = new tm_ADR();
                $_MAIN_MESSAGE .= "<br>" . sprintf(___("Ausgewählter Mail-Server: %s"), $HOST[0]['name']);
                if ($check_blacklist == 1) {
                    $_MAIN_MESSAGE .= "<br>" . tm_icon("ruby.png", ___("Blacklist")) . "&nbsp;" . ___("Blacklist Überprüfung aktiv");
                }
                //nur q eintraege hinzufügen die noch nicht vorhanden sind oder status gesendet haben
                //status gesendet=4,
                //NICHT:    neu=1, gestartet/wait=2, running=3
                //fuer jede gruppe im array adr_grp!
                for ($gcc = 0; $gcc < $gc; $gcc++) {
                    $group_add = false;
                    $grp_id = $adr_grp[$gcc];
                    $GRP = $ADDRESS->getGroup($grp_id);
                    //function getQ($id=0,$offset=0,$limit=0,$nl_id=0,$grp_id=0,$status=0)
                    $Qnew = $QUEUE->getQ(0, 0, 0, $nl_id, $grp_id, 1);
コード例 #3
0
$a_id = getVar("a_id");
$TrackImageType = "png";
$create_track_image = false;
if (checkid($nl_id)) {
    $NEWSLETTER = new tm_NL();
    //nl holen
    $NL = $NEWSLETTER->getNL($nl_id);
    //wenn newsletter gefunden, ok
    if (count($NL) > 0) {
        $create_track_image = true;
    }
    //nl view counter ++
    $NEWSLETTER->addView($nl_id);
    //history id? dann in der historie auf view setzen!
    if (checkid($h_id)) {
        $QUEUE = new tm_Q();
        //nur der erste aufruf wird mit der ip versehen! ansonsten wuerde diese jedesmal ueberschrieben wenn der leser oder ein anderer das nl anschaut.
        $H = $QUEUE->getH($h_id);
        if (isset($H[0])) {
            //https://sourceforge.net/tracker/?func=detail&aid=3114571&group_id=190396&atid=933192
            if (empty($H[0]['ip']) || $H[0]['ip'] == '0.0.0.0') {
                $QUEUE->setHIP($H[0]['id'], getIP());
                //save ip
            }
            if ($H[0]['status'] != 7) {
                //7:unsubscribed
                $QUEUE->setHStatus($h_id, 3);
                //view
            }
        }
        //isset H[0]
コード例 #4
0
if ($check && $set == "unsubscribe") {
    //unbedingt ^^^ pruefen auf gueltige email!
    //sonst findet getAdr alle adressen!!! da search - email null ist / leer ist
    //adr anhand email suchen!
    $search['email'] = $email;
    $search['email_exact_match'] = true;
    $ADR = $ADDRESS->getAdr(0, 0, 1, 0, $search);
    //print_r($ADR);
    if (count($ADR) > 0) {
        //noch nicht abgemeldet?
        if ($ADR[0]['status'] != 11) {
            /*
            if ($ADR[0]['code']==$code) {
            */
            if (checkid($h_id)) {
                $QUEUE = new tm_Q();
                $QUEUE->setHStatus($h_id, 7);
                //unsubscribe!
            }
            $created = date("Y-m-d H:i:s");
            //im memo speichern wir den namen des newsletter etc.
            $memo = "unsubscribed";
            $NEWSLETTER = new tm_NL();
            $NL = $NEWSLETTER->getNL($nl_id);
            if (count($NL) > 0) {
                $memo .= " (" . $NL[0]['subject'] . ")";
            }
            //set status adresse, set editor...
            $author = "unsubscribe";
            //always unsubscribe ...
            if ($ADDRESS->unsubscribe($ADR[0]['id'], $author)) {
コード例 #5
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
コード例 #6
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;
 }
コード例 #7
0
 /**
  * save log
  * @param
  * @return boolean
  */
 function log($arr)
 {
     //indexes:
     //author_id = given author id, if not given, check data array for author id, if not given, check login, if not given, set to 0=system
     //action = text = new/edit/delete
     //object = contact/ticket/contact_group/object/contact_type etc
     //data = array with data, e.g. from $contact array addContact Method etc.
     $Return = false;
     //check values
     //set log date
     $this->LOG['date'] = date("Y-m-d H:i:s");
     //chekc for author id
     $this->LOG['author_id'] = 0;
     //default is 0=system
     if (isset($arr['author_id']) && check_dbid($arr['author_id'])) {
         //if valid author_id in arr
         $this->LOG['author_id'] = $arr['author_id'];
     } else {
         //else check for author_id in data array
         if (isset($arr['data']['author_id']) && check_dbid($arr['data']['author_id'])) {
             $this->LOG['author_id'] = $arr['data']['author_id'];
         } else {
             // else, if not set at all get author id from logged in user
             global $LOGIN;
             if (isset($LOGIN->USER['id']) && check_dbid($LOGIN->USER['id'])) {
                 $this->LOG['author_id'] = $LOGIN->USER['id'];
             }
         }
     }
     //action
     //action should always be set, default is --
     $this->LOG['action'] = "--";
     if (isset($arr['action']) && !empty($arr['action'])) {
         //wenn aktion definiert
         $this->LOG['action'] = $arr['action'];
     }
     //object
     //object should always be set, default is --
     $this->LOG['object'] = "--";
     if (isset($arr['object']) && !empty($arr['object'])) {
         //wenn aktion definiert
         $this->LOG['object'] = $arr['object'];
     }
     //edit_id, die id des geaenderten datensatzes! oder neuen datensatzes, defakto muss log() erst am ende einer add methode aufgerufen werden wenn die id bekannt ist!
     //edit_id should always be set, default is 0
     $this->LOG['edit_id'] = 0;
     if (isset($arr['data']['id']) && !empty($arr['data']['id'])) {
         //wenn id
         $this->LOG['edit_id'] = $arr['data']['id'];
     }
     $this->LOG['memo'] = "";
     if (isset($arr['memo'])) {
         $this->LOG['memo'] = $arr['memo'];
     }
     $this->LOG['s_data'] = serialize($arr['data']);
     //hmmm, falls loeschung, daten aus altem datensatz anhand id ermitteln.... hmmmm
     if ($this->LOG['action'] == "delete" && check_dbid($this->LOG['edit_id'])) {
         switch ($this->LOG['object']) {
             //default:
             #no default, default : require_once (TM_INCLUDEPATH."/Welcome.inc.php"); break;
             case 'usr':
                 $LINK = new tm_CFG();
                 $DATA = $LINK->getUser("", $this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA);
                 break;
             case 'adr':
                 $LINK = new tm_ADR();
                 $DATA = $LINK->getAdr($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'adr_grp':
                 $LINK = new tm_ADR();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'nl':
                 $LINK = new tm_NL();
                 $DATA = $LINK->getNL($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'nl_grp':
                 $LINK = new tm_NL();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'bl':
                 $LINK = new tm_BLACKLIST();
                 $DATA = $LINK->getBL($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'frm':
                 $LINK = new tm_FRM();
                 $DATA = $LINK->getForm($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'host':
                 $LINK = new tm_HOST();
                 $DATA = $LINK->getHost($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'q':
                 $LINK = new tm_Q();
                 $DATA = $LINK->getQ($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'lnk':
                 $LINK = new tm_LNK();
                 $DATA = $LINK->get($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'lnk_grp':
                 $LINK = new tm_LNK();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
         }
         //switch
     }
     //if action=delete
     //serialisierte werte speichern, ein eintrag in die db pro aktion!
     $Query = "INSERT INTO " . TM_TABLE_LOG . " (\n\t\t\t\t\t\tdate,\n\t\t\t\t\t\tauthor_id,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tx_value,\n\t\t\t\t\t\tedit_id,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tmemo,\n\t\t\t\t\t\tsiteid\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . dbesc($this->LOG["date"]) . "',\n\t\t\t\t\t\t" . checkset_int($this->LOG["author_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG["action"]) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG["object"]) . "',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t" . checkset_int($this->LOG["edit_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG['s_data']) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG['memo']) . "',\n\t\t\t\t\t\t'" . TM_SITEID . "')";
     if ($this->DB->Query($Query)) {
         $Return = true;
     } else {
         $Return = FALSE;
         return $Return;
     }
     /*		
     //jeden wert einzeln speichern, ist aber unsinnn!!!!
     //iterate data array, fetch all indexes and values and save...... yes, it becomes a very very big table!!!!! anders gehts halt nicht!
     foreach ($arr['data'] as $data_key => $data_val) {
     	    	if (DEBUG) $_MAIN_MESSAGE.= "$data_key => $data_val\n, ";
     	$Query ="INSERT INTO ".TM_TABLE_LOG." (
     				date,
     				author_id,
     				action,
     				object,
     				property,
     				x_value,
     				edit_id,
     				siteid
     				)
     				VALUES (
     				'".dbesc($this->LOG["date"])."',
     				'".checkset_int($this->LOG["author_id"])."',
     				'".dbesc($this->LOG["action"])."',
     				'".dbesc($this->LOG["object"])."',
     				'".dbesc($data_key)."',
     				'".dbesc($data_val)."',
     				'".checkset_int($this->LOG["edit_id"])."',
     				'".TM_SITEID."')";
     	if (DEBUG_SQL) $_MAIN_MESSAGE.="\n".$Query."<br>";
     	if ($this->DB->Query($Query)) {
     		$Return=true;
     	} else {
     		$Return=FALSE;
     		return $Return;			
     	}
     }//foreach
     */
     return $Return;
 }
コード例 #8
0
ファイル: status.inc.php プロジェクト: aydancoskun/octobercms
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
include_once TM_INCLUDEPATH . "/libchart-1.1/libchart.php";
$_MAIN_DESCR = ___("Status");
$_MAIN_MESSAGE .= "";
$NEWSLETTER = new tm_NL();
$ADDRESS = new tm_ADR();
$QUEUE = new tm_Q();
$FORMULAR = new tm_FRM();
$shownlgURLPara = tmObjCopy($mSTDURL);
$shownlgURLPara->addParam("act", "nl_grp_list");
$shownlgURLPara->addParam("s", "s_menu_nl,s_menu_st");
$shownlgURLPara_ = $shownlgURLPara->getAllParams();
$shownlURLPara = tmObjCopy($mSTDURL);
$shownlURLPara->addParam("s", "s_menu_nl,s_menu_st");
$showformURLPara = tmObjCopy($mSTDURL);
$showformURLPara->addParam("s", "s_menu_frm,s_menu_st");
$showadrURLPara = tmObjCopy($mSTDURL);
$showadrURLPara->addParam("act", "statistic");
$showadrURLPara->addParam("s", "s_menu_adr,s_menu_st");
$showadrURLPara->addParam("set", "adr");
$showadrgURLPara = tmObjCopy($mSTDURL);
$showadrgURLPara->addParam("act", "statistic");
コード例 #9
0
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Karte");
$_MAIN_MESSAGE .= "";
$FORMULAR = new tm_FRM();
$QUEUE = new tm_Q();
$InputName_CreateMap = "create_map";
${$InputName_CreateMap} = getVar($InputName_CreateMap);
$create = getVar("create");
////////////////////////////////////////////////////////////////////////////////////////
require_once TM_INCLUDEPATH . "/status_map_form.inc.php";
require_once TM_INCLUDEPATH . "/status_map_form_show.inc.php";
////////////////////////////////////////////////////////////////////////////////////////
if ($create == 1) {
    require_once TM_INCLUDEPATH . "/geoip/geoip.inc";
    require_once TM_INCLUDEPATH . "/geoip/geoipcity.inc";
    require_once TM_INCLUDEPATH . "/geoip/geoipregionvars.php";
    $gi = geoip_open(TM_INCLUDEPATH . "/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
    //map oeffnen
    //usermap: neues bild erstellen, so gross wie map, png transparent!
    //frm_s auslesen,
コード例 #10
0
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Newsletter Warteschlange (Q)");
$_MAIN_MESSAGE .= "";
$QUEUE = new tm_Q();
$HOSTS = new tm_HOST();
$ADDRESS = new tm_ADR();
$NEWSLETTER = new tm_NL();
$set = getVar("set");
$val = getVar("val");
$q_id = getVar("q_id");
$nl_id = getVar("nl_id");
$grp_id = getVar("grp_id");
$doit = getVar("doit");
//wird per js an url angefuegt!!! confirm()
//logfile
if (check_dbid($q_id)) {
    $Q = $QUEUE->getQ($q_id);
    $logfilename = "q_.log.html";
    if (isset($Q[0]['id'])) {
コード例 #11
0
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Newsletter versenden");
$_MAIN_MESSAGE .= "";
require_once TM_INCLUDEPATH . "/queue_vars.inc.php";
$QUEUE = new tm_Q();
$NEWSLETTER = new tm_NL();
$ADDRESS = new tm_ADR();
//q starten?
if (!isset($startq)) {
    $startq = getVar("startq");
}
//wenn nl id dann queue ids fuer diesen newsletter ermitteln
if (!isset($nl_id)) {
    //damit wir es in queue_new includen koennen.....dort setzen wird diese werte
    $nl_id = getVar("nl_id");
}
if (!isset($q_id)) {
    $q_id = getVar("q_id");
}
if (!isset($grp_id)) {
コード例 #12
0
ファイル: send_it.php プロジェクト: aydancoskun/octobercms
ob_start();
/********************************************************************************/
require_once TM_INCLUDEPATH . "/Class_SMTP.inc.php";
#require_once (TM_INCLUDEPATH."/phphtmlparser/html2text.inc");
$called_via_url = FALSE;
if (isset($_SERVER['REMOTE_ADDR'])) {
    $called_via_url = TRUE;
}
//a http refresh may work
$reload_intervall = 300;
if ($called_via_url) {
    echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $encoding . "\">\n";
    echo "<html>\n<body bgcolor=\"#ffffff\">\n";
    echo "<pre>\n";
}
$QUEUE = new tm_Q();
$NEWSLETTER = new tm_NL();
$ADDRESS = new tm_ADR();
$HOSTS = new tm_HOST();
$BLACKLIST = new tm_BLACKLIST();
$T = new Timer();
//zeitmessung
$skip_send = FALSE;
//if true, skip sending routine// is true after new q has been prepared
$log_proc_id = rand(111111, 999999);
$log_q_id = "0";
$log_nl_id = "0";
$log_grp_id = "0";
$log_adr_id = "0";
$log_msg = "";
function send_log($text)
コード例 #13
0
 }
 if ($set == "copy_grp") {
     $_MAIN_MESSAGE .= "<br>" . ___("Ausgewählte Adressen werden in die gewählten Gruppen kopiert.");
 }
 if ($set == "move_grp") {
     $_MAIN_MESSAGE .= "<br>" . ___("Ausgewählte Adressen werden in die gewählten Gruppen verschoben.");
 }
 if ($set == "delete_grp") {
     $_MAIN_MESSAGE .= "<br>" . ___("Ausgewählte Adressen werden aus den gewählten Gruppen gelöscht.");
 }
 if ($blacklist == 1) {
     $BLACKLIST = new tm_BLACKLIST();
     $_MAIN_MESSAGE .= "<br>" . ___("Ausgewählte Adressen werden zur Blacklist hinzugefügt.");
 }
 if ($set == "delete_history") {
     $QUEUE = new tm_Q();
     $_MAIN_MESSAGE .= "<br>" . ___("Historie ausgewählter Adressen werden gelöscht.");
 }
 if ($set == "check") {
     $_MAIN_MESSAGE .= "<br>" . ___("Ausgewählte Adressen werden zur automatischen Prüfung vorgemerkt.");
 }
 //adressids holen ud in adr_id_arr speichern
 //function getAdrID($group_id=0,$search=Array())
 $adr_id_arr = $ADDRESS->getAdrID(0, $search);
 //adrarray durchwandern
 for ($acc_m = 0; $acc_m < $ac; $acc_m++) {
     //blacklist? MUSS vor anderen aktionen stehen wegen getAdr!!
     if ($blacklist == 1) {
         //hier wird naemlich auch nich $set abgefragt! sondern eben $blacklist als eigenes flag! (checkbox), soll aber auch verfuegbar sein wenn set==delete
         //ist.... sonst muesste man zum blacklisten alle anderen aktionen kombinieren :O
         //andere loesung waere checkboxen, die aber per js auf gueltigkeit geprueft werden muessen da verschieben und loeschen nix bringt!
コード例 #14
0
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Adressgruppen verwalten");
$_MAIN_MESSAGE .= "";
$ADDRESS = new tm_ADR();
$QUEUE = new tm_Q();
$adr_grp_id = getVar("adr_grp_id");
$set = getVar("set");
$val = getVar("val");
$doit = getVar("doit");
//wird per js an url angefuegt!!! confirm()
if ($set == "aktiv") {
    $ADDRESS->setGRPAktiv($adr_grp_id, $val);
    if ($val == 1) {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde aktiviert.");
    } else {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde de-aktiviert.");
    }
}
if ($set == "prod" && $doit == 1) {
    $ADDRESS->setGRPProd($adr_grp_id, $val);
コード例 #15
0
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Newsletter verwalten");
$_MAIN_MESSAGE .= "";
$NEWSLETTER = new tm_NL();
$QUEUE = new tm_Q();
$nl_grp_id = getVar("nl_grp_id");
$nl_id = getVar("nl_id");
$set = getVar("set");
$val = getVar("val");
$doit = getVar("doit");
//wird per js an url angefuegt!!! confirm()
//sucharray parameter, vorerst nur is_template!
$search_nl = array();
$s_nl_istemplate = getVar("s_nl_istemplate");
if ($set == "aktiv") {
    $NEWSLETTER->setAktiv($nl_id, $val);
    if ($val == 1) {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde aktiviert.");
    } else {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde de-aktiviert.");
コード例 #16
0
ファイル: view.inc.php プロジェクト: aydancoskun/octobercms
 //check if newsletter and tracking is personalized, massmail==0 track-personalized==1 need at least adr or history id here
 if ($NL[0]['massmail'] == 0 && (check_dbid($a_id) || check_dbid($h_id))) {
     $personalized = TRUE;
     if (DEBUG) {
         echo "nl is personalized<br>";
     }
 }
 if ($personalized && $NL[0]['track_personalized'] == 1) {
     $track_personalized = TRUE;
     if (DEBUG) {
         echo "tracking is personalized<br>";
     }
 }
 //check for valid record in history/rcpt-list
 if (check_dbid($h_id) && $personalized) {
     $QUEUE = new tm_Q();
     $H = $QUEUE->getH($h_id);
     if (isset($H[0])) {
         $valid_h = TRUE;
         //now we can check if we have a valid address record... if not, we can get one from the history table... :O
         if (!check_dbid($a_id) && check_dbid($H[0]['adr_id'])) {
             //if a_id is not valid yet, set a_id to a_id from history table
             //must be done before address checking ;)
             $a_id = $H[0]['adr_id'];
             if (DEBUG) {
                 echo "invalid adr id, gettind adr id from h_a_id:" . $a_id . "<br>";
             }
         }
         //if we have valid adr_id yet, lets check if it differs from the adr_i in hostory table... if not, we dont have a valid h record
         if (check_dbid($a_id) && $a_id != $H[0]['adr_id']) {
             $valid_h = FALSE;