public static function desc($vars) { if (!empty($vars)) { $desc = substr(strip_tags(htmlspecialchars_decode($vars) . ". " . self::$desc), 0, 150); } else { $desc = substr(self::$desc, 0, 150); } $desc = Hooks::filter('site_desc_filter', $desc); return $desc; }
public static function format($post, $id) { // split post for readmore... $post = Typo::Xclean($post); $more = explode('[[--readmore--]]', $post); //print_r($more); if (count($more) > 1) { $post = explode('[[--readmore--]]', $post); $post = $post[0] . " <a href=\"" . Url::post($id) . "\">" . READ_MORE . "</a>"; } else { $post = $post; } $post = Hooks::filter('post_content_filter', $post); return $post; }
case 'add': # code... $data[] = ''; switch (isset($_POST['submit'])) { case true: # code... // check token first if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) { // VALIDATE ALL $alertred[] = TOKEN_NOT_EXIST; } //cleanup first $title = Typo::cleanX($_POST['title']); $title = Hooks::filter('post_submit_title_filter', $title); $content = Typo::cleanX($_POST['content']); $content = Hooks::filter('post_submit_content_filter', $content); if (!isset($title) || $title == "") { $alertred[] = TITLE_CANNOT_EMPTY; } if (isset($alertred)) { $data['alertred'] = $alertred; } else { if (!isset($_POST['date']) || $_POST['date'] == "") { # code... $date = date("Y-m-d H:i:s"); } else { $date = $_POST['date']; } $vars = array('title' => $title, 'cat' => Typo::int($_POST['cat']), 'content' => $content, 'date' => $date, 'type' => 'post', 'author' => Session::val('username'), 'status' => Typo::int($_POST['status'])); //print_r($vars); Posts::insert($vars);