예제 #1
0
 protected function set_post(tpost $post)
 {
     extract($_POST, EXTR_SKIP);
     $post->title = $title;
     $cats = self::processcategories();
     $cats = array_unique($cats);
     array_delete_value($cats, 0);
     array_delete_value($cats, '');
     array_delete_value($cats, false);
     array_delete_value($cats, null);
     $post->categories = $cats;
     if ($post->id == 0 && litepublisher::$options->user > 1) {
         $post->author = litepublisher::$options->user;
     }
     if (isset($tags)) {
         $post->tagnames = $tags;
     }
     if (isset($icon)) {
         $post->icon = (int) $icon;
     }
     if (isset($idview)) {
         $post->idview = $idview;
     }
     if (isset($files)) {
         $files = trim($files, ', ');
         $post->files = tdatabase::str2array($files);
     }
     if (isset($date) && $date) {
         $post->posted = tadminhtml::getdatetime('date');
     }
     if (isset($status)) {
         $post->status = $status == 'draft' ? 'draft' : 'published';
         $post->comstatus = $comstatus;
         $post->pingenabled = isset($pingenabled);
         $post->idperm = (int) $idperm;
         if ($password != '') {
             $post->password = $password;
         }
     }
     if (isset($url)) {
         $post->url = $url;
         $post->title2 = $title2;
         $post->keywords = $keywords;
         $post->description = $description;
         $post->rawhead = $head;
     }
     $post->content = $raw;
     if (isset($excerpt)) {
         $post->excerpt = $excerpt;
     }
     if (isset($rss)) {
         $post->rss = $rss;
     }
     if (isset($more)) {
         $post->moretitle = $more;
     }
     if (isset($filtered)) {
         $post->filtered = $filtered;
     }
     if (isset($upd)) {
         $update = sprintf($this->lang->updateformat, tlocal::date(time()), $upd);
         $post->content = $post->rawcontent . "\n\n" . $update;
     }
 }