Example #1
0
 public function uninstall()
 {
     $files = tfiles::i();
     $files->lock();
     $icons = ticons::i();
     $icons->lock();
     $this->delete('post', 'document-list.png');
     $this->delete('categories', 'asterisk.png');
     $this->delete('tags', 'tag-label.png');
     $this->delete('archives', 'book.png');
     $this->delete('audio', 'document-music.png');
     $this->delete('video', 'film.png');
     $this->delete('bin', 'document-binary.png');
     $this->delete('document', 'document-text.png');
     $this->delete('news', 'blog-blue.png');
     $icons->unlock();
     $files->unlock();
     litepublisher::$urlmap->clearcache();
 }
 public function processform()
 {
     $icons = ticons::i();
     foreach ($_POST as $name => $value) {
         if (isset($icons->items[$name])) {
             $icons->items[$name] = (int) $value;
         }
     }
     $icons->save();
     $lang = tlocal::i('files');
     return $this->html->h2->iconupdated;
 }
 public function CreateFirstPost()
 {
     $html = THtmlResource::instance();
     $html->section = 'installation';
     $lang = tlocal::instance();
     $theme = ttheme::instance();
     $post = tpost::instance(0);
     $post->title = $lang->posttitle;
     $post->catnames = $lang->postcategories;
     $post->tagnames = $lang->posttags;
     $post->content = $theme->parse($lang->postcontent);
     $posts = tposts::instance();
     $posts->add($post);
     $icons = ticons::instance();
     $cats = tcategories::instance();
     $cats->setvalue($post->categories[0], 'icon', $icons->getid('news'));
     $comusers = tcomusers::instance($post->id);
     $userid = $comusers->add($lang->author, $lang->email, $lang->homeurl);
     echo "new comuser id = ";
     var_dump($userid);
     echo "<br>";
     litepublisher::$classes->commentmanager->addcomment($post->id, $userid, $lang->postcomment);
     $plugins = tplugins::instance();
     $plugins->lock();
     //$plugins->add('oldestposts');
     //$plugins->add('adminlinks');
     //$plugins->add('nicedit');
     $plugins->unlock();
 }
Example #4
0
 public function add(tpost $post)
 {
     if ($post->posted == 0) {
         $post->posted = time();
     }
     $this->beforechange($post);
     if ($post->posted == 0) {
         $post->posted = time();
     }
     if ($post->posted <= time()) {
         if ($post->status == 'future') {
             $post->status = 'published';
         }
     } else {
         if ($post->status == 'published') {
             $post->status = 'future';
         }
     }
     if ($post->icon == 0 && !litepublisher::$options->icondisabled) {
         $icons = ticons::i();
         $post->icon = $icons->getid('post');
     }
     if ($post->idview == 1) {
         $views = tviews::i();
         if (isset($views->defaults['post'])) {
             $post->id_view = $views->defaults['post'];
         }
     }
     $post->url = tlinkgenerator::i()->addurl($post, $post->schemalink);
     $id = $post->create_id();
     $this->updated($post);
     $this->cointerface('add', $post);
     $this->added($post->id);
     $this->changed();
     litepublisher::$urlmap->clearcache();
     return $post->id;
 }
 public function CreateFirstPost()
 {
     $html = tadminhtml::i();
     $html->section = 'installation';
     $lang = tlocal::i();
     $theme = ttheme::i();
     $post = tpost::i(0);
     $post->title = $lang->posttitle;
     $post->catnames = $lang->postcategories;
     $post->tagnames = $lang->posttags;
     $post->content = $theme->parse($lang->postcontent);
     $posts = tposts::i();
     $posts->add($post);
     $icons = ticons::i();
     $cats = tcategories::i();
     $cats->setvalue($post->categories[0], 'icon', $icons->getid('news'));
     $cm = tcommentmanager::i();
     $users = tusers::i();
     $cm->idguest = $users->add(array('email' => '', 'name' => tlocal::get('default', 'guest'), 'status' => 'hold', 'idgroups' => 'commentator'));
     $cm->save();
     $users->setvalue($cm->idguest, 'status', 'approved');
     tcomments::i()->add($post->id, $cm->idguest, $lang->postcomment, 'approved', '127.0.0.1');
     $plugins = tplugins::i();
     $plugins->lock();
     $plugins->add('oldestposts');
     //$plugins->add('adminlinks');
     //$plugins->add('nicedit');
     $plugins->unlock();
 }