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 create($url = "post", $type = 'post', $class = 'Url') { $posts = Posts::recent(20, $type); header("Content-Type: text/xml"); $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xml .= "\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n "; //print_r($posts); if (!isset($posts['error'])) { # code... foreach ($posts as $p) { # code... $xml .= "\n <url>\n <loc>" . $class::$url($p->id) . "</loc>\n </url>\n "; } } $xml .= "\n </urlset>\n "; echo $xml; }
?> </h5> <p><em><?php echo Options::get('siteslogan'); ?> </em> <?php echo Site::$desc; ?> </p> </div> <div class="sidebar-module"> <h4>Recent Post</h4> <ol class="list-unstyled"> <?php $recent = Posts::recent(10); $num = Db::$num_rows; if ($num > 0) { foreach ($recent as $r) { # code... echo "<li><a href=\"" . Url::post($r->id) . "\">{$r->title}</a></li>\n "; } } else { echo "No Post to Show"; } ?> </ol> </div> <div class="sidebar-module"> <h4>Elsewhere</h4> <ol class="list-unstyled">
<div class="row"> <?php echo Hooks::run('admin_page_dashboard_action', $data); ?> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-file-text-o"></i> <?php echo LATEST_POST; ?> </h3> </div> <div class="panel-body"> <ul class="list-group"> <?php $post = Posts::recent(5, 'post'); //print_r($post); if (isset($post['error'])) { echo "<li class=\"list-group-item\">{$post['error']}</li>"; } else { foreach ($post as $p) { # code... echo "\n <li class=\"list-group-item\">\n <a href=\"" . Url::post($p->id) . "\" target=\"_blank\">\n {$p->title} \n </a>\n <small class=\"badge\">{$p->author}</small>\n \n </li>"; } } ?> </ul> </div> </div> </div> <div class="col-md-6">