//the default article is the article_list $pathinfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ""; //$_SERVER['REDIRECT_URL']; $params = preg_split('|/|', $pathinfo, -1, PREG_SPLIT_NO_EMPTY); if (isset($params[0])) { $page = $params[0]; } if (isset($params[1])) { $article = $params[1]; } //Show page if ($page == 'feed') { $blog = new Blog(BASE_URL); $rss = new RSS($blog); header("Content-Type: application/xml; charset=ISO-8859-1"); echo $rss->getFeed(); } elseif ($page == 'blog') { require_once 'template/header.php'; $blog = new Blog(BASE_URL); if ($article == 'index') { require_once 'template/article_list.php'; } else { $articleContent = $blog->getArticleHTML($article); if ($articleContent !== false) { echo $articleContent; } else { //article not found echo "NOT FOUND"; //TODO: 404 } }
#!/usr/bin/php <?php define('ROOT', dirname(__FILE__) . "/../public_html"); chdir(ROOT); require_once ROOT . "/php/init.php"; echo date('Y-m-d h:i:s') . " [INFO] Start: Cache Rss fedd from mabra.com cron script. \n"; Misc::logMotiomera("Start: Cache Rss fedd from mabra.com cron script ", 'INFO'); $rss = new RSS(); $rss->getFeed(); Misc::logMotiomera("End Cache Rss fedd from mabra.com cron script \n", 'INFO');