Example #1
0
      fetch adr record again
      if adr not exists and double optin is used, send double optin mail to user/admin
      if adr not exists and no double optin is used, send notify mail to user/admin
      if adr already exists, send update mail to user/admin (optional)
      if adr not exists, count/add subscription to form
      show successmessage      $Form_Filename
if we have a valid form and set is not set to 'save' yet, no double optin confirmation or form input not ok: show form 
*/
if (!isset($_CONTENT)) {
    $_CONTENT = "";
}
if (!isset($called_via_url)) {
    $called_via_url = true;
}
$HOSTS = new tm_HOST();
$NEWSLETTER = new tm_NL();
$FORMULAR = new tm_FRM();
$ADDRESS = new tm_ADR();
$_Tpl_FRM = new tm_Template();
$MESSAGE = "";
$OUTPUT = "";
if (DEBUG && $called_via_url) {
    $OUTPUT .= tm_debugmessage("called via url");
}
if (DEBUG && !$called_via_url) {
    $OUTPUT .= tm_debugmessage("included");
}
$date_sub = date(TM_NL_DATEFORMAT);
//used in template and email, formatted
if (!isset($frm_id) || empty($frm_id)) {
    $frm_id = getVar("fid", 0, 0);
Example #2
0
$Form->set_InputReadonly($FormularName, $InputName_Summary, false);
$Form->set_InputOrder($FormularName, $InputName_Summary, 22);
$Form->set_InputLabel($FormularName, $InputName_Summary, "");
//Gruppe
$Form->new_Input($FormularName, $InputName_Group, "select", "");
$Form->set_InputJS($FormularName, $InputName_Group, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputDefault($FormularName, $InputName_Group, $nl_grp_id);
$Form->set_InputStyleClass($FormularName, $InputName_Group, "mFormSelect", "mFormSelectFocus");
$Form->set_InputDesc($FormularName, $InputName_Group, ___("Newsletter-Gruppe waehlen"));
$Form->set_InputReadonly($FormularName, $InputName_Group, false);
$Form->set_InputOrder($FormularName, $InputName_Group, 6);
$Form->set_InputLabel($FormularName, $InputName_Group, "");
$Form->set_InputSize($FormularName, $InputName_Group, 0, 1);
$Form->set_InputMultiple($FormularName, $InputName_Group, false);
//add Data
$NEWSLETTER = new tm_NL();
$GRP = $NEWSLETTER->getGroup();
$acg = count($GRP);
for ($accg = 0; $accg < $acg; $accg++) {
    $Form->add_InputOption($FormularName, $InputName_Group, $GRP[$accg]['id'], $GRP[$accg]['name']);
}
//Select existing Trackimage
$Form->new_Input($FormularName, $InputName_TrackImageExisting, "select", "");
$Form->set_InputJS($FormularName, $InputName_TrackImageExisting, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputDefault($FormularName, $InputName_TrackImageExisting, basename(${$InputName_TrackImageExisting}));
$Form->set_InputStyleClass($FormularName, $InputName_TrackImageExisting, "mFormSelect", "mFormSelectFocus");
$Form->set_InputDesc($FormularName, $InputName_TrackImageExisting, ___("Blind-/Tracking-Bild auswählen"));
$Form->set_InputReadonly($FormularName, $InputName_TrackImageExisting, false);
$Form->set_InputOrder($FormularName, $InputName_TrackImageExisting, 10);
$Form->set_InputLabel($FormularName, $InputName_TrackImageExisting, "");
$Form->set_InputSize($FormularName, $InputName_TrackImageExisting, 0, 1);
$nl_grp_id = getVar("nl_grp_id");
//field names for query
$InputName_Name = "name";
//range from
${$InputName_Name} = getVar($InputName_Name);
$InputName_Descr = "descr";
//range from
${$InputName_Descr} = getVar($InputName_Descr, 0);
$InputName_Aktiv = "aktiv";
//range from
${$InputName_Aktiv} = getVar($InputName_Aktiv);
$InputName_Color = "color";
${$InputName_Color} = getVar($InputName_Color);
$InputName_ColorView = "color_view";
//nur anzeige....
$NEWSLETTER = new tm_NL();
$GRP = $NEWSLETTER->getGroup($nl_grp_id, 0, 0);
$standard = $GRP[0]['standard'];
if ($set == "save") {
    $check = true;
    //checkinput
    if (empty($name)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Name der Gruppe sollte nicht leer sein.");
    }
    if ($check) {
        $NEWSLETTER->updateGrp(array("id" => $nl_grp_id, "name" => $name, "descr" => $descr, "aktiv" => $aktiv, "created" => $created, "author" => $author));
        $_MAIN_MESSAGE .= "<br>" . sprintf(___("Newslettergruppe %s wurde aktualisiert."), "'<b>" . display($name) . "</b>'");
        $action = "nl_grp_list";
        require_once TM_INCLUDEPATH . "/nl_grp_list.inc.php";
    } else {
Example #4
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                     */
/********************************************************************************/
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");
//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
settings per newsletter -->
	blankimage ? --> blank png erzeigen
	eigenes bild --> extension auslesen, jpg oder png erzeugen
	global? --> globale settings auslesen
		blank? --> blank png erzeugen
		eigenes bild --> extension auslesen, jpg oder png erzeugen

	bild ausgeben.
*/
$h_id = getVar("h_id");
$nl_id = getVar("nl_id");
$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
/* 2006/2010 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                     */
/********************************************************************************/
if ($check) {
    $MESSAGE .= "<br><br>Beispieldaten werden hinzugefügt / Inserting some example Data.";
    if (!DEMO) {
        /***********************************************************/
        //create example data
        /***********************************************************/
        //nl gruppe
        $NEWSLETTER = new tm_NL();
        //create a new group
        $example_nl_group_1_id = $NEWSLETTER->addGrp(array("name" => "Newsletter Group 1", "descr" => "zum testen / for testings", "aktiv" => 1, "author" => "install", "created" => $created, "editor" => "install", "updated" => $created));
        //make this group the default group
        $NEWSLETTER->setGRPStd($example_nl_group_1_id, 1);
        //create a 2nd example group
        $example_nl_group_2_id = $NEWSLETTER->addGrp(array("name" => "Newsletter Group 2", "descr" => "zum testen / for testings", "aktiv" => 0, "author" => "install", "created" => $created, "editor" => "install", "updated" => $created));
        //create a 3rd group used for templates (subscribe form)
        $example_nl_group_3_id = $NEWSLETTER->addGrp(array("name" => "Subscribe", "descr" => "templates for subscribe mails send by subscribe-forms", "aktiv" => 1, "author" => "install", "created" => $created, "editor" => "install", "updated" => $created));
        //add a first testnewsletter in first group
        $example_nl_1_id = $NEWSLETTER->addNL(array("subject" => "{DATE} Newsletter 1", "body" => $example_nl_body_html, "body_text" => $example_nl_body_text, "aktiv" => 1, "status" => 1, "massmail" => 0, "link" => "http://www.tellmatic.org", "created" => date("Y-m-d H:i:s"), "author" => "install", "grp_id" => $example_nl_group_1_id, "rcpt_name" => "Newsletter", "track_image" => "_blank", "content_type" => "text/html", "attachements" => array(), "is_template" => 0, "title" => 'Titel', "title_sub" => 'Titel 2', "summary" => 'Zusammenfassender Text zBsp. zur Anzeige auf der Webseite etc.', "track_personalized" => 1));
        //add a second testnewsletter in 2nd group
        $example_nl_2_id = $NEWSLETTER->addNL(array("subject" => "{DATE} Newsletter 2", "body" => $example_nl_body_html, "body_text" => $example_nl_body_text, "aktiv" => 1, "status" => 1, "massmail" => 0, "link" => "http://www.tellmatic.org", "created" => date("Y-m-d H:i:s"), "author" => "install", "grp_id" => $example_nl_group_2_id, "rcpt_name" => "Newsletter", "track_image" => "_blank", "content_type" => "text/html", "attachements" => array(), "is_template" => 0, "title" => 'Titel', "title_sub" => 'Titel 2', "summary" => 'Zusammenfassender Text zBsp. zur Anzeige auf der Webseite etc.', "track_personalized" => 1));
        //add newsletter for doubleoptin message, use 3rd example group
        $example_nl_doptin_id = $NEWSLETTER->addNL(array("subject" => "Newsletteranmeldung / Subscribe {DATE}", "body" => $example_nl_doptin_body_html, "body_text" => $example_nl_doptin_body_text, "aktiv" => 1, "status" => 1, "massmail" => 0, "link" => "http://www.tellmatic.org", "created" => date("Y-m-d H:i:s"), "author" => "install", "grp_id" => $example_nl_group_3_id, "rcpt_name" => "Newsletter", "track_image" => "_blank", "content_type" => "text/html", "attachements" => array(), "is_template" => 1, "title" => '', "title_sub" => '', "summary" => '', "track_personalized" => 1));
        //add newsletter for welcome/subscribe message, use 3rd example group
/********************************************************************************/
/* 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                     */
/********************************************************************************/
include_once TM_INCLUDEPATH . "/libchart-1.1/libchart.php";
$_MAIN_DESCR = ___("Top X");
$_MAIN_MESSAGE .= "";
$NEWSLETTER = new tm_NL();
$ADDRESS = new tm_ADR();
$QUEUE = new tm_Q();
$FORMULAR = new tm_FRM();
$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");
$InputName_TopX = "topx";
$show_top_x = getVar("topx");
if (empty($show_top_x)) {
    $show_top_x = 5;
Example #9
0
 }
 //force pubgroup
 if ($FRM[$acc]['force_pubgroup'] == 1) {
     $_MAIN_OUTPUT .= "<br>" . tm_icon("group_error.png", ___("Auswahl öffentlicher Gruppen erzwingen")) . "&nbsp;" . ___("Auswahl öffentlicher Gruppen erzwingen") . ",&nbsp;";
     $_MAIN_OUTPUT .= "<br>&nbsp;&nbsp;&nbsp;" . ___("Fehlermeldung") . ": <em>" . display($FRM[$acc]['pubgroup_errmsg']) . "</em>";
 } else {
     #$_MAIN_OUTPUT.=  "<br>".tm_icon("group.png",___("Auswahl öffentlicher Gruppen nicht erzwingen"))."&nbsp;".___("Auswahl öffentlicher Gruppen nicht erzwingen").",&nbsp;";
 }
 //update/overwrite pubgroup refs
 if ($FRM[$acc]['force_pubgroup'] == 1) {
     $_MAIN_OUTPUT .= "<br>" . tm_icon("group_gear.png", ___("Gruppen überschreiben")) . "&nbsp;" . ___("Gruppen überschreiben") . ",&nbsp;";
 } else {
     #$_MAIN_OUTPUT.=  "<br>".tm_icon("group_link.png",___("Gruppen aktualisieren, nur Neue hinzufügen"))."&nbsp;".___("Gruppen aktualisieren, nur Neue hinzufügen").",&nbsp;";
 }
 //newsletters that are sent as double-optin mail and greeting mail!
 $NEWSLETTER = new tm_NL();
 $_MAIN_OUTPUT .= "<br>" . tm_icon("newspaper_link.png", ___("Double Opt-in Mail")) . "&nbsp;" . ___("Newsletter welcher als Double-Opt-In Mail verschickt wird") . ":";
 if (check_dbid($FRM[$acc]['nl_id_doptin'])) {
     $NLDOptin = $NEWSLETTER->getNL($FRM[$acc]['nl_id_doptin']);
     $_MAIN_OUTPUT .= "<br>" . display($NLDOptin[0]['subject']);
 } else {
     $_MAIN_OUTPUT .= ___("-- STANDARD --");
 }
 $_MAIN_OUTPUT .= "<br>" . tm_icon("newspaper_add.png", ___("Bestätigungs-Mail")) . "&nbsp;" . ___("Newsletter welcher als Bestätigungs-Mail verschickt wird") . ":";
 if (check_dbid($FRM[$acc]['nl_id_greeting'])) {
     $NLGreeting = $NEWSLETTER->getNL($FRM[$acc]['nl_id_greeting']);
     $_MAIN_OUTPUT .= "<br>" . display($NLGreeting[0]['subject']);
 } else {
     $_MAIN_OUTPUT .= ___("-- STANDARD --");
 }
 $_MAIN_OUTPUT .= "<br>" . tm_icon("newspaper_go.png", ___("Aktulisierungs-Mail")) . "&nbsp;" . ___("Newsletter welcher als Aktualisierungs-Mail verschickt wird") . ":";
Example #10
0
$track_personalized = FALSE;
//is personalized mailing?
$valid_nl = FALSE;
//valid nl record?
$valid_adr = FALSE;
//valid address record?
$valid_lnk = FALSE;
//valid link?
$valid_h = FALSE;
//do we have a valid history entry?
$valid_url = FALSE;
$URL = "";
//check valid nl id
if (check_dbid($nl_id)) {
    //checkid()?
    $NEWSLETTER = new tm_NL();
    //Link holen
    $NL = $NEWSLETTER->getNL($nl_id);
    //check for valid newsletter, must be active and not a template
    if (isset($NL[0]) && $NL[0]['aktiv'] == 1 && $NL[0]['is_template'] != 1) {
        $valid_nl = TRUE;
        //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 ($personalized && $NL[0]['track_personalized'] == 1) {
            $track_personalized = TRUE;
        }
        //check for valid url
        if (!empty($NL[0]['link'])) {
            $URL = $NL[0]['link'];
$nl_offset = 0;
//offset, kann auch aus $_GET oder per getVar ermittelt werden....
$nl_rows = 5;
$nl_columns = 2;
$nl_limit = $nl_rows * $nl_columns;
//anzahl anzuzeigender newsletter
$nl_sortIndex = "updated";
//letztes edit datum, alternativ: "created"
$nl_content = 0;
//do not return content
$nl_grpid = 0;
//nl group, 0=all groups
//umstaendehalber koennte man auch das sendedatum aus der q auslesen!
//wir gehen aber den einfachen weg
//neues address-objekt
$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
#$N=Array();//array
//function getNL($id=0,$offset=0,$limit=0,$group_id=0,$return_content=0,$sortIndex="",$sortType=0, $search=Array())
//get nl_limit newsletters with offset nl_offset and sort by nl_sortIndex, and return Content
//hole nl_limit newsletter, ab nl_offset , sortiere vorher nach nl_sortIndex und gib den Inhalt und Details zurueck
$N = $NL->getNL(0, $nl_offset, $nl_limit, 0, 1, "updated", 1, $search_nl);
#, $nl_grpid, $nl_content, $nl_sortIndex);
echo "<table border=1 width=600>\n";
echo "<tbody>\n";
echo "<tr>\n";
//Array durchwandern und jede Adresse pruefen
$ni = 0;
Example #12
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 {
Example #13
0
//instead we have the linktracker which can give much better statistics
$personalized = FALSE;
//is personalized mailing?
$track_personalized = FALSE;
//is personalized tracking? (click on links etc, blindimage)
$valid_nl = FALSE;
//valid nl record?
$valid_adr = FALSE;
//valid address record?
$valid_h = FALSE;
//do we have a valid history entry?
$_NEWSLETTER = "";
//check valid nl id
if (check_dbid($nl_id)) {
    //checkid()?
    $NEWSLETTER = new tm_NL();
    //Link holen
    $NL = $NEWSLETTER->getNL($nl_id, 0, 0, 0, 1);
    //check for valid newsletter, must be active and not a template
    if (isset($NL[0]) && $NL[0]['aktiv'] == 1 && $NL[0]['is_template'] != 1) {
        $valid_nl = TRUE;
        if (DEBUG) {
            echo "nl is valid<br>";
        }
        //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>";
            }
        }
Example #14
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;
 }
Example #15
0
/********************************************************************************/
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)
{
Example #16
0
        }
    }
}
//NL send as update mail
$Form->new_Input($FormularName, $InputName_NLUpdate, "select", "");
$Form->set_InputJS($FormularName, $InputName_NLUpdate, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputDefault($FormularName, $InputName_NLUpdate, $nl_id_update);
$Form->set_InputStyleClass($FormularName, $InputName_NLUpdate, "mFormSelect", "mFormSelectFocus");
$Form->set_InputDesc($FormularName, $InputName_NLUpdate, ___("Newsletter wählen"));
$Form->set_InputReadonly($FormularName, $InputName_NLUpdate, false);
$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);
        }
    }
}
Example #17
0
${$InputName_ImageWatermarkImage} = getVar($InputName_ImageWatermarkImage);
//resize?
$InputName_ImageResize = "image_resize";
//resize image?
${$InputName_ImageResize} = getVar($InputName_ImageResize, 0, 0);
$InputName_ImageResizeSize = "image_resize_size";
//what size?
${$InputName_ImageResizeSize} = getVar($InputName_ImageResizeSize, 0, 180);
$check = true;
if ($set == "save") {
    //checkinput
    if (empty($subject)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Betreff sollte nicht leer sein.");
    }
    $NEWSLETTER = new tm_NL();
    //upload ?!
    include_once TM_INCLUDEPATH . "/nl_upload.inc.php";
    $track_image = "";
    if ($uploaded_track_image_new) {
        $track_image = "/" . $uploaded_track_image_new_name;
    } else {
        $track_image = $track_image_existing;
    }
    if ($check) {
        $status = 1;
        $NEWSLETTER->addNL(array("subject" => $subject, "title" => $title, "title_sub" => $title_sub, "body" => $body, "body_text" => $body_text, "summary" => $summary, "aktiv" => $aktiv, "is_template" => $is_template, "status" => $status, "massmail" => $massmail, "link" => $link, "created" => $created, "author" => $author, "grp_id" => $nl_grp_id, "content_type" => $content_type, "track_image" => $track_image, "track_personalized" => $track_personalized, "rcpt_name" => $rcpt_name, "attachements" => $attach_existing));
        $_MAIN_MESSAGE .= "<br>" . sprintf(___("Neuer Newsletter %s wurde erstellt."), "'<b>" . display($subject) . "</b>'");
        $_MAIN_MESSAGE .= "<br>" . ___("Der Newsletter wurde gespeichert unter:") . "<ul>" . ___("Template:") . " <a href=\"" . $tm_URL_FE . "/" . $tm_nldir . "/" . $NL_Filename_N . "\" target=\"_preview\">" . $tm_nldir . "/" . $NL_Filename_N . "</a>" . "<br>" . ___("Online:") . " <a href=\"" . $tm_URL_FE . "/" . $tm_nldir . "/" . $NL_Filename_P . "\"  target=\"_preview\">" . $tm_nldir . "/" . $NL_Filename_P . "</a>" . "<br>" . ___("Text:") . " <a href=\"" . $tm_URL_FE . "/" . $tm_nldir . "/" . $NL_Filename_T . "\" target=\"_preview\">" . $tm_nldir . "/" . $NL_Filename_T . "</a>" . "</ul>";
        $action = "nl_list";
        require_once TM_INCLUDEPATH . "/nl_list.inc.php";
 //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)) {
             $ADDRESS->setAktiv($ADR[0]['id'], 0);
             $ADDRESS->addMemo($ADR[0]['id'], $memo);
             //unsubscribed
             if ($C[0]['unsubscribe_action'] == "blacklist" || $C[0]['unsubscribe_action'] == "blacklist_delete") {
                 //add adr to blacklist
                 if (!$BLACKLIST->isBlacklisted($ADR[0]['email'], "email", 0)) {
                     //only_active=0, also alle, nicht nur aktive, was default waere
Example #19
0
/* 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'])) {
        $logfilename = "q_" . $Q[0]['id'] . "_" . $Q[0]['grp_id'] . "_" . date_convert_to_string($Q[0]['created']) . ".log.html";
    }
}
Example #20
0
         $_MAIN_MESSAGE .= "<br><font color=\"#006600\">" . sprintf(___("In der  Gruppe %s existieren %s gültige Adressen. Gruppe hinzugefügt!"), "'<b>" . display($GRP[0]['name']) . "</b>'", "<b>" . $ac . "</b>") . "</font>";
     }
     //if ac
 }
 //for gcc
 //array neu indizieren, indexe neu erstellen.....
 $adr_grp = array_values($adr_grp);
 //neu zaehlen...
 $gc = count($adr_grp);
 //sind jetzt ueberhaupt noch gruppen gewaehlt???
 if ($gc > 0) {
     $send_at = $send_at_date . " " . $send_at_h . ":" . $send_at_m . ":00";
     $new_q_arr = $QUEUE->addQ(array("created" => $created, "author" => $author, "status" => $status, "nl_id" => $nl_id, "host_id" => $host_id, "send_at" => $send_at, "check_blacklist" => $check_blacklist, "proof" => $proof, "autogen" => $autogen, "touch" => 0), $adr_grp);
     //
     //nl auf status queued setzen =2/6=terminiert
     $NEWSLETTER = new tm_NL();
     $NEWSLETTER->setStatus($nl_id, 6);
     //war 2, ist 6 fuer terminierten versand!!
     $_MAIN_MESSAGE .= "<br>" . ___("Neuer Eintrag wurde erstellt.");
     $action = "queue_list";
     if ($send_now == 1) {
         require_once TM_INCLUDEPATH . "/queue_send.inc.php";
     }
     #require_once (TM_INCLUDEPATH."/nl_list.inc.php");
     //show q list instead
     require_once TM_INCLUDEPATH . "/queue_list.inc.php";
 } else {
     // $gc>0
     $_MAIN_MESSAGE .= "<br>" . ___("Keine Gruppe(n) gewählt. Nichts hinzugefügt");
     require_once TM_INCLUDEPATH . "/queue_form.inc.php";
     require_once TM_INCLUDEPATH . "/queue_form_show.inc.php";
Example #21
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)) {
    $grp_id = getVar("grp_id");
Example #22
0
//range from
${$InputName_Aktiv} = getVar($InputName_Aktiv);
//
$InputName_Color = "color";
${$InputName_Color} = getVar($InputName_Color);
$InputName_ColorView = "color_view";
//nur anzeige....
$check = true;
if ($set == "save") {
    //checkinput
    if (empty($name)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Name der Gruppe sollte nicht leer sein.");
    }
    if ($check) {
        $NEWSLETTER = new tm_NL();
        $NEWSLETTER->addGrp(array("name" => $name, "descr" => $descr, "aktiv" => $aktiv, "created" => $created, "author" => $author));
        $_MAIN_MESSAGE .= "<br>" . sprintf(___("Neue Newslettergruppe %s wurde erstellt."), "'<b>" . display($name) . "</b>'");
        $action = "nl_grp_list";
        require_once TM_INCLUDEPATH . "/nl_grp_list.inc.php";
    } else {
        require_once TM_INCLUDEPATH . "/nl_grp_form.inc.php";
        require_once TM_INCLUDEPATH . "/nl_grp_form_show.inc.php";
    }
} else {
    ${$InputName_Aktiv} = 1;
    ${$InputName_Name} = ___("Neue Gruppe");
    ${$InputName_Descr} = ___("Neue Gruppe");
    require_once TM_INCLUDEPATH . "/nl_grp_form.inc.php";
    require_once TM_INCLUDEPATH . "/nl_grp_form_show.inc.php";
}
/********************************************************************************/
/* 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 = ___("Newslettergruppen verwalten");
$_MAIN_MESSAGE .= "";
$NEWSLETTER = new tm_NL();
$nl_grp_id = getVar("nl_grp_id");
$set = getVar("set");
$val = getVar("val");
$doit = getVar("doit");
//wird per js an url angefuegt!!! confirm()
if ($set == "aktiv") {
    $NEWSLETTER->setGRPAktiv($nl_grp_id, $val);
    if ($val == 1) {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde aktiviert.");
    } else {
        $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde de-aktiviert.");
    }
}
if ($set == "standard") {
    $NEWSLETTER->setGRPStd($nl_grp_id, $val);