コード例 #1
0
ファイル: nl_new.inc.php プロジェクト: aydancoskun/octobercms
    //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";
    } else {
        $body = stripslashes(strtr($body, $trans));
        require_once TM_INCLUDEPATH . "/nl_form.inc.php";
        require_once TM_INCLUDEPATH . "/nl_form_show.inc.php";
    }
} else {
    ${$InputName_Aktiv} = 1;
    require_once TM_INCLUDEPATH . "/nl_form.inc.php";
    require_once TM_INCLUDEPATH . "/nl_form_show.inc.php";
}
コード例 #2
0
 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
     $example_nl_welcome_id = $NEWSLETTER->addNL(array("subject" => "Willkommen / Welcome {DATE}", "body" => $example_nl_welcome_body_html, "body_text" => $example_nl_welcome_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 update mail, use 3rd example group
     $example_nl_update_id = $NEWSLETTER->addNL(array("subject" => "Aktualisierung / Update {DATE}", "body" => $example_nl_update_body_html, "body_text" => $example_nl_update_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 link groups
     $LINKS = new tm_LNK();
     $lnk_group_id_1 = $LINKS->addGrp(array("short" => "tellmatic", "name" => "Tellmatic", "descr" => "Tellmatic Links", "aktiv" => 1, "created" => date("Y-m-d H:i:s"), "author" => "install"));
     $lnk_group_id_2 = $LINKS->addGrp(array("short" => "index", "name" => "Index", "descr" => "Newsletter Index", "aktiv" => 1, "created" => date("Y-m-d H:i:s"), "author" => "install"));
     //add links
     $LINKS->add(array("short" => "tm.home", "name" => "Tellmatic Homepage", "url" => "http://www.tellmatic.org", "descr" => "Tellmatic Homepage", "aktiv" => 1, "created" => date("Y-m-d H:i:s"), "author" => "install"), array(0 => $lnk_group_id_1));
     $LINKS->add(array("short" => "tm.doc", "name" => "Tellmatic Documentation", "url" => "http://doc.tellmatic.org", "descr" => "Tellmatic Online Documentation", "aktiv" => 1, "created" => date("Y-m-d H:i:s"), "author" => "install"), array(0 => $lnk_group_id_1));