public static function create($url = 'post', $type = 'post', $count = '20') { $posts = Posts::recent($count, $type); header("Content-Type: text/xml"); $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xml .= "\n <rss version=\"2.0\">\n <channel>\n <title>" . Site::$name . "</title>\n <link>" . Site::$url . "</link>\n <description>" . Site::$desc . "</description>\n "; foreach ($posts as $p) { # code... $xml .= "\n <item>\n <title>" . $p->title . "</title>\n <link>" . Url::$url($p->id) . "</link>\n <description>" . substr(strip_tags(Typo::Xclean($p->content)), 0, 260) . "</description>\n </item>\n "; } $xml .= "\n </channel>\n </rss>\n "; echo $xml; }
public static function meta($cont_title = '', $cont_desc = '', $pre = '') { global $data; //print_r($data); //if(empty($data['posts'][0]->title)){ if (is_array($data)) { $sitenamelength = strlen(self::$name); $limit = 70 - $sitenamelength - 6; if (isset($data['sitetitle'])) { $cont_title = substr(Typo::Xclean(Typo::strip($data['sitetitle'])), 0, $limit); $titlelength = strlen($data['sitetitle']); } elseif (isset($data['posts'][0]->title) && !isset($data['posts'][1]->title)) { $cont_title = substr(Typo::Xclean(Typo::strip($data['posts'][0]->title)), 0, $limit); $titlelength = strlen($data['posts'][0]->title); } else { $cont_title = substr(Typo::Xclean(Typo::strip(Options::get('siteslogan'))), 0, $limit); $titlelength = strlen(Options::get('siteslogan')); } if ($titlelength > $limit + 3) { $dotted = "..."; } else { $dotted = ""; } $cont_title = "{$pre} {$cont_title}{$dotted} - "; } else { $cont_title = ""; } if (is_array($data) && isset($data['posts'][0]->content)) { $desc = Typo::strip($data['posts'][0]->content); } else { $desc = ""; } $cont_title = Hooks::filter('site_title_filter', $cont_title); $keyword = Hooks::filter('site_key_filter', self::$key); echo "\n <!--// Start Meta: Generated Automaticaly by GeniXCMS -->\n <meta charset=\"" . Options::get('charset') . "\">"; echo "\n <!-- SEO: Title stripped 70chars for SEO Purpose -->\n <title>{$cont_title}" . self::$name . "</title>\n <meta name=\"Keyword\" content=\"" . $keyword . "\">\n <!-- SEO: Description stripped 150chars for SEO Purpose -->\n <meta name=\"Description\" content=\"" . self::desc($desc) . "\">"; if (isset($data['posts'][0]->author) && !isset($data['posts'][1]->author)) { echo "\n <meta name=\"Author\" content=\"{$data['posts'][0]->author}\">"; } echo "\n <meta name=\"Generator\" content=\"GeniXCMS " . System::v() . "\">\n <meta name=\"robots\" content=\"" . Options::get('robots') . "\">\n <link rel=\"shortcut icon\" href=\"" . Options::get('siteicon') . "\" />\n "; echo Hooks::run('header_load_meta', $data); echo "\n <!-- Generated Automaticaly by GeniXCMS :End Meta //-->"; // echo $meta; }
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; }
<div class="col-sm-8 blog-main"> <?php foreach ($data['posts'] as $p) { # code... echo "\n <div class=\"blog-post\">\n <h2 class=\"blog-post-title\">{$p->title}</h2>\n \n " . Typo::Xclean($p->content) . "\n </div>\n "; } ?> </div> <?php Theme::theme('rightside', $data);
* GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20141006 * @version 0.0.6 * @link https://github.com/semplon/GeniXCMS * @link http://genixcms.org * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */ $post = ""; $cat = Db::escape(Typo::Xclean($_GET['cat'])); $data['max'] = Options::get('post_perpage'); if (isset($_GET['paging'])) { $paging = Typo::int($_GET['paging']); if ($paging > 0) { $offset = ($paging - 1) * $data['max']; } else { $offset = 0; } $pagingtitle = " - Page {$paging}"; } else { $offset = 0; $paging = 1; $pagingtitle = ""; } $data['sitetitle'] = "Category: " . Categories::name($cat) . $pagingtitle;