1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id$ 7 8namespace Tiki\Sitemap\Type; 9 10use Tiki\Sitemap\AbstractType; 11use TikiLib; 12 13/** 14 * Generate Sitemap for Blogs 15 */ 16class Blog extends AbstractType 17{ 18 /** 19 * Generate Sitemap 20 */ 21 public function generate() 22 { 23 if (! $this->checkFeatureAndPermissions('feature_blogs')) { 24 return; 25 } 26 27 $blogLib = TikiLib::lib('blog'); 28 29 $listPages = $blogLib->list_blogs(); 30 $this->addEntriesToSitemap($listPages, '/tiki-view_blog.php?blogId=%s', 'blogId', 'blog', 'title', 'lastModif', '0.8'); 31 32 $posts = $blogLib->list_posts(); 33 $this->addEntriesToSitemap($posts, '/tiki-view_blog_post.php?postId=%s', 'postId', 'blogpost'); 34 } 35} 36