if (preg_match('#<title[^>]*>(.+?)</title>#', $content, $matches0) && preg_match('#<meta name="description" content="(.+?)" />#', $content, $matches1)) { $page_title = $this->conv_symbs_to_ents($matches0[1], $length); $description = $this->conv_symbs_to_ents($matches1[1], $length); if (!empty($page_title) && !empty($description)) { /*$p .= '<item><link>' . $this->ensure_amp(htmlentities(str_replace(array("/index.html", "/index.php", "//"), array("/", "/", "/"), $site_root . $production_dir . $file))) . '</link><title>' . $page_title . '</title><description>' . $description . '</description><ror:updatePeriod>daily</ror:updatePeriod><ror:sortOrder>1</ror:sortOrder><ror:resourceOf>sitemap</ror:resourceOf></item>' . "\n";*/ $p .= '<item><link>' . $this->ensure_amp(htmlentities($site_root . $this->fix_dir_index($production_dir . $file))) . '</link><title>' . $page_title . '</title><description>' . $description . '</description><ror:updatePeriod>daily</ror:updatePeriod><ror:sortOrder>1</ror:sortOrder><ror:resourceOf>sitemap</ror:resourceOf></item>' . "\n"; } } } } } return $p; } } if (!isset($RSSGenerator) || empty($RSSGenerator)) { $RSSGenerator = new RSSGenerator(); } $length = 4000; $dir = null; require_once $relpa . 'inc/dir.inc'; sort($dir, 0); reset($dir); /** * update pages.xml */ $pages_xml = 'feeds/pages.xml'; $s = ''; for ($i = 0; $i < count($dir); $i++) { if (!empty($dir[$i][0])) { $s .= $RSSGenerator->update_dir_info($relpa, $dir[$i][0], $vars2_site_root, "html", $length); }
/** * Show the form for creating a new resource. * * @return Response */ public function category($permalink = "") { $category = Category::where('permalink', '=', $permalink)->firstOrFail(); $news = News::inCategories(array($category->id))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->paginate(10); return Response::make(RSSGenerator::rss($news), 200, array('Content-type' => 'text/xml')); }