public function __construct() { parent::__construct(); $this->plugin->call('codice_init'); $config = new configuration(); $blogConfig = $config->getBlogConfiguration(); $this->conf = $blogConfig; $this->themes->conf = $blogConfig; }
public function __construct() { parent::__construct(); if ($this->session->check("logged") == false) { $this->redirect("admin/login/nosession/"); } $config = new configuration(); $blogConfig = $config->getBlogConfiguration(); $userConfig = $config->getUserConfiguration(1); $this->conf = $blogConfig; $this->userConf = $userConfig; }
public function __construct() { parent::__construct(); $R = registry::getInstance(); $class = $R->router->getClass(); if ($class["action"] != "login" && $class["action"] != "logout") { if ($this->session->check("logged") == false) { $this->redirect("admin/login/nosession/"); } } $this->plugin->call('admin_init'); $C = new configuration(); $this->blogConfig = $C->getBlogConfiguration(); $this->userConf = $C->getUserConfiguration(1); $this->view->blogConfig = $this->blogConfig; $this->view->userConf = $this->userConf; }
public function addComment($urlfriendly = null) { $C = new configuration(); $codice = $C->getBlogConfiguration(); if ($this->data) { if (is_null($urlfriendly) === true) { $this->redirect($codice['blog_siteurl'], true); } $P = new post(); $post = $P->findBy('urlfriendly', $urlfriendly); if ($P->isNew() === true) { $this->redirect($codice['blog_siteurl'], true); } if (isset($this->data["resultado"]) === true) { $captcha = $this->data['resultado']; if ($captcha != '5') { $this->session->flash('Tu comentario no puede ser agregado. Necesitas contestar la pregunta correctamente.'); $this->redirect("{$post['urlfriendly']}#comments"); } unset($this->data['resultado']); } else { $this->session->flash('Tu comentario no puede ser agregado. Necesitas contestar la pregunta.'); $this->redirect("{$post['urlfriendly']}#comments"); } if ($this->cookie->check('id_user')) { $this->data['user_id'] = $this->cookie->id_user; $this->data['status'] = 'publish'; } else { $this->data['user_id'] = 0; $this->data['status'] = 'waiting'; } $this->data['type'] = ''; //'pingback', 'trackback', '' $this->data['IP'] = utils::getIP(); $this->data['ID_post'] = $post["ID"]; $this->cookie->author = $this->data['author']; $this->cookie->email = $this->data['email']; $this->cookie->url = $this->data['url']; $C = new comment(); $C->prepareFromArray($this->data); $valid = $C->save(); if ($valid) { $this->registry->lastCommentID = $valid; $this->registry->postID = $post["ID"]; $this->plugin->call("index_comment_added"); } if ($valid and $this->isAjax()) { echo $valid; } else { if ($valid) { $this->redirect("{$post['urlfriendly']}#comment-{$valid}"); } else { $this->redirect("{$post['urlfriendly']}"); } } } }
public function __construct() { parent::__construct(); $conf = new configuration(); $this->conf = $conf->getBlogConfiguration(); }