if($row["newsletter_type"])
    {
        if(!array_key_exists($row["newsletter_type"], $typesAdded))
        {
            $db->beginQuery();
            $sql = sprintf("INSERT INTO mm_newsletter_type (type) VALUES ('%s')", $row["newsletter_type"]);
            $db->query($sql);
            $id = $db->lastSerialID("mm_newsletter_type");
            $db->commitQuery();

            $typesAdded[$row["newsletter_type"]] = $id;
            $cli->output( "New style {$row["newsletter_type"]}" );
        }
    }

    $feedId = getFeedId($cli, $db, $row["cluster_identifier"], $typesAdded[$row["newsletter_type"]]);

    $publisherLogo = is_null($row["publisher_logo"]) ? "NULL" : "'{$row["publisher_logo"]}'";
    $newsletterPlacement = is_null($row["newsletter_placement"]) ? "NULL" : "{$row["newsletter_placement"]}";
    $articleList = is_null($row["number_article_list"]) ? "NULL" : "{$row["number_article_list"]}";
    $articleRandom = is_null($row["number_article_random"]) ? "NULL" : "{$row["number_article_random"]}";
    $articleNs = is_null($row["number_article_ns"]) ? "NULL" : "{$row["number_article_ns"]}";
    $articleLastX = is_null($row["number_article_last_x"]) ? "NULL" : "{$row["number_article_last_x"]}";
    $articleRandomY = is_null($row["number_article_random_y"]) ? "NULL" : "{$row["number_article_random_y"]}";
    $processed = is_null($row["processed"]) ? "NULL" : "{$row["processed"]}";
    $mechanism = is_null($row["mechanism"]) ? "NULL" : "{$row["mechanism"]}";

    $sql = "INSERT INTO
            mm_newsletter_application
            (application_localized_id, feed_id, template_type_id, publisher_logo, newsletter_placement, number_article_list, number_article_random, number_article_ns, number_article_last_x, number_article_random_y, processed, mechanism)
            VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)";
Ejemplo n.º 2
0
 function input_config($userid)
 {
     $out = "<div class='lightbox' style='margin-bottom:20px;'>";
     $out .= '<h3>2) Input Configuration:</h3>';
     if (isset($_POST["form"])) {
         $form = $_POST["form"];
     } else {
         $form = 0;
     }
     if ($form == 1 || $form == 2) {
         $input = $_POST["input"];
         $out .= "<h3>" . $input . "</h3>";
         $inputProcessList = getInputProcessList($userid, $input);
         // Form 2 is process addition ------------------------------------------
         if ($form == 2) {
             $processType = $_POST["sel"];
             // get process type
             $arg = $_POST["arg"];
             $out .= "<h2>here: " . $processType . " arg:" . $arg . "</h2>";
             // get feed name or scaler, offset etc
             if ($processType == 1 || $processType == 4 || $processType == 5 || $processType == 7 || $processType == 8) {
                 $name = $arg;
                 $id = getFeedId($userid, $name);
                 if ($id == 0) {
                     // Checks if feed of feed name arg exists
                     $id = createFeed($userid, $name);
                     // if not create feed and get its id
                 }
                 $arg = $id;
             }
             if ($processType == 6) {
                 $arg = getInputId($userid, $arg);
             }
             $inputProcessList[] = array($processType, $arg);
             // Add the new process list entry
             saveInputProcessList($userid, $input, $inputProcessList);
             // Save the new process list
         }
         //----------------------------------------------------------------------
         $out .= $this->view_processList($input, $inputProcessList);
     } else {
         $out .= "<p>Select an input to configure and map through to a feed</p>";
     }
     $out .= "</div>";
     return $out;
 }