if (!$spam and Config::meta('comment_notifications')) { $comment->notify(); } return Response::redirect($posts_page->slug . '/' . $slug . '#comment'); }); /** * Rss feed */ Route::get(array('rss', 'feeds/rss'), function () { $uri = 'http://' . $_SERVER['HTTP_HOST']; $rss = new Rss(Config::meta('sitename'), Config::meta('description'), $uri, Config::app('language')); $query = Post::where('status', '=', 'published')->sort(Base::table('posts.created'), 'desc'); foreach ($query->get() as $article) { $rss->item($article->title, Uri::full(Registry::get('posts_page')->slug . '/' . $article->slug), $article->description, $article->created); } $xml = $rss->output(); return Response::create($xml, 200, array('content-type' => 'application/xml')); }); /** * Json feed */ Route::get('feeds/json', function () { $json = Json::encode(array('meta' => Config::get('meta'), 'posts' => Post::where('status', '=', 'published')->sort(Base::table('posts.created'), 'desc')->get())); return Response::create($json, 200, array('content-type' => 'application/json')); }); /** * Search */ Route::get(array('search', 'search/(:any)', 'search/(:any)/(:num)'), function ($slug = '', $offset = 1) { // mock search page $page = new Page();