Ejemplo n.º 1
0
 function article_data($bodyArray, $aid = 0, $haspic = 0)
 {
     $id = (int) $_POST['adid'];
     $subtitle = iS::escapeStr($_POST['subtitle']);
     $body = implode('#--iCMS.PageBreak--#', $bodyArray);
     $body = preg_replace(array('/<script.+?<\\/script>/is', '/<form.+?<\\/form>/is'), '', $body);
     isset($_POST['dellink']) && ($body = preg_replace("/<a[^>].*?>(.*?)<\\/a>/si", "\\1", $body));
     iCMS::$config['publish']['autoformat'] && ($body = autoformat($body));
     articleTable::$ID = $aid;
     $fields = articleTable::data_fields($id);
     $data = compact($fields);
     if ($id) {
         articleTable::data_update($data, compact('id'));
     } else {
         $id = articleTable::data_insert($data);
     }
     if ($this->callback['data']) {
         $DCB = $this->callback['data'];
         $handler = $DCB[0];
         $params = (array) $DCB[1];
         if (is_callable($handler)) {
             call_user_func_array($handler, $params);
         }
     }
     $_POST['isredirect'] && (iFS::$redirect = true);
     $_POST['iswatermark'] && (iFS::$watermark = false);
     if (isset($_POST['remote'])) {
         $body = $this->remotepic($body, true, $aid);
         $body = $this->remotepic($body, true, $aid);
         $body = $this->remotepic($body, true, $aid);
         if ($body && $id) {
             articleTable::data_update(array('body' => $body), compact('id'));
         }
     }
     if (isset($_POST['autopic']) && empty($haspic)) {
         $picurl = $this->remotepic($body, 'autopic', $aid);
         $this->pic($picurl, $aid);
     }
     $this->pic_indexid($body, $aid);
 }
Ejemplo n.º 2
0
 function body($body, $subtitle, $aid = 0, $id = 0, &$haspic = 0)
 {
     $body = preg_replace(array('/<script.+?<\\/script>/is', '/<form.+?<\\/form>/is'), '', $body);
     isset($_POST['dellink']) && ($body = preg_replace("/<a[^>].*?>(.*?)<\\/a>/si", "\\1", $body));
     if (isset($_POST['markdown'])) {
         $body = '#--iCMS.Markdown--#' . $body;
     } else {
         iCMS::$config['publish']['autoformat'] && ($body = addslashes(autoformat($body)));
     }
     articleTable::$ID = $aid;
     $fields = articleTable::data_fields($id);
     $data = compact($fields);
     if ($id) {
         articleTable::data_update($data, compact('id'));
     } else {
         $id = articleTable::data_insert($data);
     }
     $_POST['isredirect'] && (iFS::$redirect = true);
     $_POST['iswatermark'] && (iFS::$watermark = false);
     if (isset($_POST['remote'])) {
         $body = $this->remotepic($body, true, $aid);
         $body = $this->remotepic($body, true, $aid);
         $body = $this->remotepic($body, true, $aid);
         if ($body && $id) {
             articleTable::data_update(array('body' => $body), compact('id'));
         }
     }
     if (isset($_POST['autopic']) && empty($haspic)) {
         if ($picurl = $this->remotepic($body, 'autopic', $aid)) {
             $this->pic($picurl, $aid);
             $haspic = true;
         }
     }
     $this->pic_indexid($body, $aid);
 }