} } else { //count adr //adresse existiert nicht, nix gefunden $email = ""; $FMESSAGE .= ___("Ungültige E-Mail-Adresse"); } } else { //keine eingabe $email = ""; $FMESSAGE .= ""; } require_once TM_INCLUDEPATH . "/unsubscribe_form.inc.php"; require_once TM_INCLUDEPATH . "/unsubscribe_form_show.inc.php"; //new Template $_Tpl_FRM = new tm_Template(); $_Tpl_FRM->setTemplatePath(TM_TPLPATH); $_Tpl_FRM->setParseValue("FMESSAGE", $FMESSAGE); $_Tpl_FRM->setParseValue("FHEAD", $FHEAD); $_Tpl_FRM->setParseValue("FFOOT", $FFOOT); $_Tpl_FRM->setParseValue("FSUBMIT", $FSUBMIT); $_Tpl_FRM->setParseValue("FEMAIL", $FEMAIL); if ($C[0]['unsubscribe_use_captcha'] == 1) { $_Tpl_FRM->setParseValue("FCAPTCHA", $FCAPTCHA); $_Tpl_FRM->setParseValue("FCAPTCHAIMG", $FCAPTCHAIMG); } else { $_Tpl_FRM->setParseValue("FCAPTCHA", ""); $_Tpl_FRM->setParseValue("FCAPTCHAIMG", ""); } $OUTPUT = $_Tpl_FRM->renderTemplate("Unsubscribe.html"); //anzeige
<?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 = ___("Hilfe / Dokumentation"); $_MAIN_MESSAGE .= ""; //new Template $_Tpl_Help = new tm_Template(); $_Tpl_Help->setTemplatePath(TM_TPLPATH); $_MAIN_OUTPUT .= $_Tpl_Help->renderTemplate("Help.html");
require_once TM_INCLUDEPATH . "/Head.inc.php"; //Status definitionen einbinden..... war vorher tm_lib, jetzt hier da abhaengig von der sprache :) sonst wirds nicht uebersetzt require_once TM_INCLUDEPATH . "/Stats.inc.php"; if ($logged_in) { //erst hier, da vorher nicht uebersetzt wuerde... $img_arrowup = tm_icon("bullet_arrow_up.png", ___("Sortierung aufsteigend")); $img_arrowdown = tm_icon("bullet_arrow_down.png", ___("Sortierung absteigend")); $mSTDURL->addParam("act", $action); require_once TM_INCLUDEPATH . "/Menu.inc.php"; } require_once TM_INCLUDEPATH . "/Main.inc.php"; require_once TM_INCLUDEPATH . "/Foot.inc.php"; require_once TM_INCLUDEPATH . "/Footer.inc.php"; // = $_FOOTER //new Template $_Tpl = new tm_Template(); if (DEBUG_LANG && (DEBUG_LANG_LEVEL == 2 || DEBUG_LANG_LEVEL == 3)) { $debug_not_translated = unify_array($debug_not_translated); $_MAIN .= "<div><b><font color=\"red\">NOT TRANSLATED:</font></b><font size=-2>"; foreach ($debug_not_translated as $word) { $_MAIN .= "<br>" . $word; } $_MAIN .= "</font></div>"; unset($debug_not_translated); $debug_same_translated = unify_array($debug_same_translated); $_MAIN .= "<br><div><b><font color=\"orange\">TRANSLATED WITH SAME STRING:</font></b><font size=-2>"; foreach ($debug_same_translated as $word) { $_MAIN .= "<br>" . $word; } $_MAIN .= "</font></div>"; unset($debug_same_translated);
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); //formular id, slashes, default=0 } $set = getVar("set");
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&nl_id=" . $nl_id . "&q_id=" . $q_id . "&a_id=" . $a_id . "&h_id=" . $h_id; } else { $NLONLINE_URL = $tm_URL_FE . "/view.php?1=1&nl_id=" . $nl_id . "&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 . "&q_id=" . $q_id . "&a_id=" . $a_id . "&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 . "&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 . "&q_id=" . $q_id . "&a_id=" . $a_id . "&h_id=" . $h_id . "&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&email=" . $email . "&code=" . $code; //."&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 .= "&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 . "&q_id=" . $q_id . "&a_id=" . $a_id . "&h_id=" . $h_id; } else { $LINK1_URL = $tm_URL_FE . "/click.php?nl_id=" . $nl_id . "&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; }
$_LANG_IMG_URL = $tm_imgURL . "/flags/gb.png"; } $_LANG_IMG = "<img src=\"" . $_LANG_IMG_URL . "\" border=\"0\" alt=\"" . $_LANG_CODE . "\" title=\"" . $_LANG_CODE . "\">"; $_LANG_SELECTED = ___("Gewählte Sprache:"); $_LANG_SUPPORTED = ___("Verfügbare Sprachen:"); foreach ($LANGUAGES['text'] as $lg) { $_LANG_SUPPORTED .= " " . $lg . ","; } $_STYLE = ___("Layout / Style") . ": <b>" . $LOGIN->USER['style'] . "</b>"; //get version and messages if ($C[0]['check_version'] == 1) { $t_new_version = getCurrentVersion(); $t_messages = getMessages(); } //new Template $_Tpl_Welcome = new tm_Template(); $_Tpl_Welcome->setTemplatePath(TM_TPLPATH); //set parse values $_Tpl_Welcome->setParseValue("_URL", $tm_URL); $_Tpl_Welcome->setParseValue("_LOGGED_IN_AS", $_LOGGED_IN_AS); $_Tpl_Welcome->setParseValue("_WELCOME", $_WELCOME); $_Tpl_Welcome->setParseValue("_HELLO", $_HELLO); $_Tpl_Welcome->setParseValue("_USER_NAME", $_USER_NAME); $_Tpl_Welcome->setParseValue("_STYLE", $_STYLE); $_Tpl_Welcome->setParseValue("_LANG_IMG", $_LANG_IMG); $_Tpl_Welcome->setParseValue("_LANG_IMG_URL", $_LANG_IMG_URL); $_Tpl_Welcome->setParseValue("_LANG_CODE", $_LANG_CODE); $_Tpl_Welcome->setParseValue("_LANG_SUPPORTED", $_LANG_SUPPORTED); $_Tpl_Welcome->setParseValue("_LANG_SELECTED", $_LANG_SELECTED); if ($C[0]['check_version'] == 1) { $_Tpl_Welcome->setParseValue("_VERSION_INFO", sprintf(___("Aktuell verfügbare Version: %s"), $t_new_version));
//MENU SECTIONS $sections = getVar('s'); if (PHP5) { $menu_sections = explode(",", $sections); //use explode instead of split } else { $menu_sections = split(",", $sections); } $menu_sections_c = count($menu_sections); $_SESSION["s"] = $sections; //new Template $_Tpl_Menu_Head = new tm_Template(); $_Tpl_Menu_Head->setTemplatePath(TM_TPLPATH . "/" . $LOGIN->USER['style']); $_Tpl_Menu_Entry = new tm_Template(); $_Tpl_Menu_Entry->setTemplatePath(TM_TPLPATH . "/" . $LOGIN->USER['style']); $_Tpl_Menu_Foot = new tm_Template(); $_Tpl_Menu_Foot->setTemplatePath(TM_TPLPATH . "/" . $LOGIN->USER['style']); //for topics $_MENU = ""; $mtc = count($MENU); for ($mtcc = 0; $mtcc < $mtc; $mtcc++) { if ($MENU[$mtcc]['aktiv'] == 1) { //add head $_NAME = $MENU[$mtcc]['name']; $_ID = $MENU[$mtcc]['id']; $_Tpl_Menu_Head->setParseValue("_NAME", $_NAME); $_Tpl_Menu_Head->setParseValue("_ID", $_ID); $_MENU_HEAD = $_Tpl_Menu_Head->renderTemplate("Menu_head.html"); //add entries $_MENU_ENTRY = ""; $mlc = count($MENU[$mtcc]['links']);
include TM_INCLUDEPATH . "/log_summary_section.inc.php"; } //logged in if (!empty($_MAIN_MESSAGE)) { $_MAIN_MESSAGE = "<font size=-1>" . "<!--a href=\"javascript:switchSection('main_info')\"-->" . "<a href=\"#\" id=\"toggle_main_info\">" . tm_icon("exclamation.png", ___("Hinweise"), ___("Hinweise")) . " " . ___("Informationen ausblenden") . "</a>" . "</font><br><br>" . "<script language=\"javascript\" type=\"text/javascript\">" . "</script>" . $_MAIN_MESSAGE; $_MAIN_MESSAGE .= "<br><br>"; } $_MAIN_OUTPUT .= ' <script type="text/javascript"> <!-- toggleSlide("toggle_main_info","main_info",0); checkForm(); --> </script> '; //show last xx lines of tellmatic php logfile: ... if there is something to show... if ($user_is_admin && TM_PHP_LOG_TAIL && file_exists(TM_PHP_LOGFILE) && filesize(TM_PHP_LOGFILE) > 0) { $_MAIN_MESSAGE .= "<br><div>"; $_MAIN_MESSAGE .= sprintf(___("Die letzten %s Einträge in der Tellmatic PHP Fehler-Log-Datei %s:"), TM_PHP_LOG_TAIL_LINES, TM_PHP_LOGFILE) . "<br>"; $_MAIN_MESSAGE .= "<font size=1>" . mtail(TM_PHP_LOGFILE, TM_PHP_LOG_TAIL_LINES) . "</font>"; $_MAIN_MESSAGE .= "</div>"; } //new Template $_Tpl_Main = new tm_Template(); $_Tpl_Main->setTemplatePath(TM_TPLPATH . "/" . $Style); $_Tpl_Main->setParseValue("_MAIN_DESCR", $_MAIN_DESCR); $_Tpl_Main->setParseValue("_MAIN_MESSAGE", $_MAIN_MESSAGE); $_Tpl_Main->setParseValue("_MAIN_HELP", $_MAIN_HELP); $_Tpl_Main->setParseValue("_MAIN_OUTPUT", $_MAIN_OUTPUT); $_MAIN = $_Tpl_Main->renderTemplate("Main.html") . "\n"; $_MAIN .= "<br><br><center>©-left 2006-2010 <a href=\"http://www.tellmatic.org\" target=\"blank\">" . TM_APPTEXT . "</a></center><br><br>";
function addForm($frm, $grp = array(), $grp_pub = array()) { global $tm_formpath, $tm_URL; $Return = false; //neues Formular speichern $Query = "INSERT INTO\n\t\t\t\t\t" . TM_TABLE_FRM . "\n\t\t\t\t\t(\t\t\t\n\t\t\t\t\t\tname, \n\t\t\t\t\t\taction_url, \n\t\t\t\t\t\tdescr, \n\t\t\t\t\t\taktiv, \n\t\t\t\t\t\tauthor, \n\t\t\t\t\t\tcreated, \n\t\t\t\t\t\teditor, \n\t\t\t\t\t\tupdated,\n\t\t\t\t\t\tstandard, \n\t\t\t\t\t\tdouble_optin,\n\t\t\t\t\t\tsubscriptions,\n\t\t\t\t\t\tuse_captcha,\n\t\t\t\t\t\tdigits_captcha,\n\t\t\t\t\t\tsubscribe_aktiv,\n\t\t\t\t\t\tcheck_blacklist,\n\t\t\t\t\t\tproof,\n\t\t\t\t\t\tforce_pubgroup,\n\t\t\t\t\t\toverwrite_pubgroup,\n\t\t\t\t\t\tmultiple_pubgroup,\n\t\t\t\t\t\tnl_id_doptin, nl_id_greeting, nl_id_update,\n\t\t\t\t\t\tmessage_doptin, message_greeting, message_update,\n\t\t\t\t\t\tsubmit_value, reset_value, \n\t\t\t\t\t\thost_id, siteid,\n\t\t\t\t\t\temail, \n\t\t\t\t\t\tf0,f1,f2,f3,f4,f5,f6,f7,f8,f9,\n\t\t\t\t\t\tf0_type, f1_type, f2_type, f3_type, f4_type, f5_type, f6_type, f7_type, f8_type, f9_type,\n\t\t\t\t\t\tf0_required, f1_required, f2_required, f3_required, f4_required, f5_required, f6_required, f7_required, f8_required, f9_required,\n\t\t\t\t\t\tf0_value, f1_value, f2_value, f3_value, f4_value, f5_value, f6_value, f7_value, f8_value, f9_value,\n\t\t\t\t\t\temail_errmsg, captcha_errmsg, blacklist_errmsg, pubgroup_errmsg, f0_errmsg, f1_errmsg, f2_errmsg, f3_errmsg, f4_errmsg, f5_errmsg, f6_errmsg, f7_errmsg, f8_errmsg, f9_errmsg,\n\t\t\t\t\t\tf0_expr, f1_expr, f2_expr, f3_expr, f4_expr, f5_expr, f6_expr, f7_expr, f8_expr, f9_expr\n\t\t\t\t\t)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t'" . dbesc($frm["name"]) . "', '" . dbesc($frm["action_url"]) . "', '" . dbesc($frm["descr"]) . "', " . checkset_int($frm["aktiv"]) . ", '" . dbesc($frm["author"]) . "', '" . dbesc($frm["created"]) . "', '" . dbesc($frm["author"]) . "', '" . dbesc($frm["created"]) . "', 0,\n\t\t\t\t\t" . checkset_int($frm["double_optin"]) . ", 0, " . checkset_int($frm["use_captcha"]) . ",\n\t\t\t\t\t" . checkset_int($frm["digits_captcha"]) . ", " . checkset_int($frm["subscribe_aktiv"]) . ", " . checkset_int($frm["check_blacklist"]) . ",\n\t\t\t\t\t" . checkset_int($frm["proof"]) . ",\n\t\t\t\t\t" . checkset_int($frm["force_pubgroup"]) . ", " . checkset_int($frm["overwrite_pubgroup"]) . ", " . checkset_int($frm["multiple_pubgroup"]) . ",\n\t\t\t\t\t" . checkset_int($frm["nl_id_doptin"]) . ", " . checkset_int($frm["nl_id_greeting"]) . ", " . checkset_int($frm["nl_id_update"]) . ",\n\t\t\t\t\t'" . dbesc($frm["message_doptin"]) . "', '" . dbesc($frm["message_greeting"]) . "', '" . dbesc($frm["message_update"]) . "',\n\t\t\t\t\t'" . dbesc($frm["submit_value"]) . "', '" . dbesc($frm["reset_value"]) . "','" . dbesc($frm["host_id"]) . "',\n\t\t\t\t\t'" . TM_SITEID . "',\n\t\t\t\t\t'" . dbesc($frm["email"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f0"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f1"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f2"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f3"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f4"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f5"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f6"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f7"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f8"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f9"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f0_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f1_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f2_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f3_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f4_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f5_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f6_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f7_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f8_type"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f9_type"]) . "',\n\t\t\t\t\t" . checkset_int($frm["f0_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f1_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f2_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f3_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f4_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f5_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f6_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f7_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f8_required"]) . ",\n\t\t\t\t\t" . checkset_int($frm["f9_required"]) . ",\n\t\t\t\t\t'" . dbesc($frm["f0_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f1_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f2_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f3_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f4_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f5_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f6_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f7_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f8_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f9_value"]) . "',\n\t\t\t\t\t'" . dbesc($frm["email_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["captcha_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["blacklist_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["pubgroup_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f0_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f1_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f2_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f3_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f4_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f5_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f6_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f7_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f8_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f9_errmsg"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f0_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f1_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f2_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f3_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f4_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f5_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f6_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f7_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f8_expr"]) . "',\n\t\t\t\t\t'" . dbesc($frm["f9_expr"]) . "'\n\t\t\t\t\t)"; if ($this->DB->Query($Query)) { $Return = true; } else { $Return = false; return $Return; } //Abfragen! und ID suchen, die brauchen wir fuer die Verknuepfung zu den Adressgruppen //wenn ein eintrag gefunden wurde....: $new_frm_id = $this->DB->LastInsertID; if (check_dbid($new_frm_id)) { //gruppen eintragen $acg = count($grp); for ($accg = 0; $accg < $acg; $accg++) { $Query = "INSERT INTO " . TM_TABLE_FRM_GRP_REF . " (frm_id,grp_id,public,siteid) VALUES (" . checkset_int($new_frm_id) . "," . checkset_int($grp[$accg]) . ",0,'" . TM_SITEID . "')"; if ($this->DB->Query($Query)) { $Return = true; } else { $Return = false; return $Return; } //if query } //for #öffentliche gruppen eintragen! ///TODO: Array diff etc, grp eintraege aus adr_pub entfernen! //machen wir hier, dann sparen wir us das in jeder abfrage etc blablablubb $grp_pub = array_diff($grp_pub, $grp); $grp_pub = array_values($grp_pub); $acgp = count($grp_pub); for ($accgp = 0; $accgp < $acgp; $accgp++) { $Query = "INSERT INTO " . TM_TABLE_FRM_GRP_REF . " (frm_id,grp_id,public,siteid) VALUES (" . checkset_int($new_frm_id) . "," . checkset_int($grp_pub[$accgp]) . ",1,'" . TM_SITEID . "')"; if ($this->DB->Query($Query)) { $Return = true; } else { $Return = false; return $Return; } //if query } //for } //jetzt die Formularvorlage speichern! //templatevariablen einfuegen etc. //namen der Felder einschreiben wenn angegeben //nur angegebene Felder! $Form_Filename_TPL = "/Form.html"; $Form_Filename = "/Form_" . $new_frm_id . ".html"; $Form_Success_Filename_TPL = "/Form_success.html"; $Form_Success_Filename = "/Form_" . $new_frm_id . "_success.html"; $_Tpl_FRM = new tm_Template(); $_Tpl_FRM->setTemplatePath(TM_TPLPATH); //Formular Template erzeugen $Form_Html = $_Tpl_FRM->renderTemplate($Form_Filename_TPL); write_file($tm_formpath, $Form_Filename, $Form_Html); $Form_Success_Html = $_Tpl_FRM->renderTemplate($Form_Success_Filename_TPL); write_file($tm_formpath, $Form_Success_Filename, $Form_Success_Html); //log $frm['id'] = $new_frm_id; $frm['grp'] = $grp; $frm['grp_pub'] = $grp_pub; if (TM_LOG) { $this->LOG->log(array("data" => $frm, "object" => "frm", "action" => "new")); } return $Return; }
<?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 */ /********************************************************************************/ $_SITEID = ""; if ($logged_in) { $_SITEID = TM_SITEID; } $_USER = ""; if ($logged_in) { $_USER = $LOGIN->USER['name']; } //new Template $_Tpl_Head = new tm_Template(); $_Tpl_Head->setTemplatePath(TM_TPLPATH . "/" . $Style); $_Tpl_Head->setParseValue("_SITEID", $_SITEID); $_Tpl_Head->setParseValue("_USER", $_USER); $_HEAD = $_Tpl_Head->renderTemplate("Head.html");
//DEBUG DATA!!! $_FOOT = ""; $_FOOT .= "<div id=\"div_debug\" class=\"debug\">"; $_FOOT .= "<a href=\"javascript:switchSection('div_debug');\"><img src=\"" . $tm_iconURL . "/information.png\" border=\"0\" alt=\"" . ___("Debug-Informationen") . "\"></a>"; $_FOOT .= "<br>"; if (function_exists('memory_get_usage')) { $_FOOT .= "<br>" . sprintf(___("Benutzer Speicher: %s MB"), number_format(memory_get_usage() / 1024 / 1024, 2, ',', '')); } $_FOOT .= "<br>" . sprintf(___("Bearbeitungszeit: %s Sekunden"), number_format($T->Result(), 2, ',', '')); $_FOOT .= "<br>" . sprintf(___("Max. Upload: %s"), ini_get("upload_max_filesize")); $_FOOT .= "<br>" . sprintf(___("Speicherlimit: %s"), ini_get("memory_limit")) . ""; $_FOOT .= "<br>" . sprintf(___("Max. POST Data: %s"), ini_get("post_max_size")); $_FOOT .= "<br>" . sprintf(___("Max. Ausführungszeit: %s Sekunden"), ini_get("max_execution_time")); $real_path = realpath("./index.php"); $path_info = pathinfo($real_path); $doc_root = $_SERVER["DOCUMENT_ROOT"]; $host = $_SERVER["HTTP_HOST"]; $self = $_SERVER["PHP_SELF"]; $pathinfo = pathinfo($self); $_FOOT .= "<br>Domain=: " . $host; $_FOOT .= "<br>Docroot=: " . $doc_root; $_FOOT .= "<br>Dir=: " . $pathinfo['dirname']; $_FOOT .= "<br><br><a href=\"" . $tm_URL_FE . "/" . TM_INCLUDEDIR . "/phpinfo.php\" target=\"_blank\">" . ___("PHP Info") . "</a><br><br>"; $_FOOT .= "<br><br><a href=\"javascript:switchSection('div_debug');\">(X) " . ___("Fenster schliessen") . "</a><br><br>"; $_FOOT .= "<br><br><center>©-left 2006-2010 <a href=\"http://www.tellmatic.org\" target=\"blank\">" . TM_APPTEXT . "</a></center><br><br>"; $_FOOT .= "</div>"; //new Template $_Tpl_Foot = new tm_Template(); $_Tpl_Foot->setTemplatePath(TM_TPLPATH . "/" . $Style); $_Tpl_Foot->setParseValue("_FOOT", $_FOOT); $_FOOT = $_Tpl_Foot->renderTemplate("Foot.html");
<?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 */ /********************************************************************************/ $helpfilename = "" . $action . ".html"; $helpfile = TM_DOCPATH . "/" . $LOGIN->USER['lang'] . "/" . $helpfilename; if (file_exists($helpfile)) { //new Template $_Tpl_HelpS = new tm_Template(); $_Tpl_HelpS->setTemplatePath(TM_DOCPATH . "/" . $LOGIN->USER['lang']); $H_TEXT = $_Tpl_HelpS->renderTemplate($helpfilename); $_Tpl_HelpS->setParseValue("H_TEXT", $H_TEXT); $_MAIN_HELP = $_Tpl_HelpS->renderTemplate("help.html"); } //Link online doku $OnlineHelpURL = "http://doc.tellmatic.org/doc_" . $action; $_MAIN_HELP .= "<div align=\"right\">\n<a href=\"" . $OnlineHelpURL . "\" target=\"_blank\" title=\"" . ___("Online Dokumentation") . "\">" . tm_icon("world.png", ___("Online Dokumentation"), ___("Online Dokumentation")) . " " . ___("Online Dokumentation") . "</a>\n</div>";