function archives() { $archive = sedot::loadJson('index', 'archive'); foreach ($archive as $year => $x) { foreach ($x as $month => $y) { $link = trim(SITE_URL, '/') . '/timeline/' . $year . '/' . $month; $list[] = '<li><a href="' . $link . '">' . date('F Y', strtotime($year . '-' . $month)) . '</a></li>'; } } $container = '<ul>%1$s</ul>'; return sprintf($container, implode('', $list)); }
# end sedot class include 'sp_theme/' . THEME . '/widget.php'; ### START LISTENING ### $post = new sedot(); if (!isset($_FRONT_PAGE)) { $_FRONT_PAGE = false; } if (!isset($_SINGLE_POST)) { $_SINGLE_POST = false; } if (!isset($_PAGE_404)) { $_PAGE_404 = false; } if (empty($getRequest[0])) { $_FRONT_PAGE = true; $pointer = $post->loadJson('index', 'index-0'); $entries = $post->index_page($pointer, false); $post->navi($post->totalpost(), 1); } elseif ($getRequest[0] == "page") { $_FRONT_PAGE = true; $pagenum = $getRequest[1]; $pointer = $post->loadJson('index', 'index-' . ($pagenum - 1)); $entries = $post->index_page($pointer, false); $post->navi($post->totalpost(), $pagenum); } elseif ($getRequest[0] == "rss") { header("Content-Type: application/rss+xml; charset=ISO-8859-1"); printf("%s", $post->loadFile("sp_static/xml/rss.xml")); exit; } elseif ($getRequest[0] == "search" || $getRequest[0] == "tag" || $getRequest[0] == "timeline") { $_FRONT_PAGE = true; $_SEARCH_MODE = true;