* @license PHP License * @package WB * @subpackage datasource */ WBClass::load('WBDatasource_Sitemap' ); /** * Datasource Sitemap Blog * * Add recent blog posts to sitemap * * @version 1.0.0 * @package WB * @subpackage datasource */ class WBDatasource_Sitemap_Gallery extends WBDatasource_Sitemap { /** * @var WBVFS_Gallery */ private $gallery; /** * VFS config * @var WBConfig */ private $config; /** * Find all the URLs * * Get recent blog posts */ public function find() { $this->config = WBClass::create('WBConfig'); $this->config->load('vfs'); // basic gallery path $pathFormat = $this->config->get('sitemap/gallery/path', 'gallery/%obscureid/%title'); $priority = floatval($this->config->get('sitemap/gallery/priority', 0.7)); $options = array(); $this->gallery = WBClass::create('WBVFS_Gallery', $options); $search = array( '%obscureid', '%title' ); $list = $this->gallery->getList(); $this->setPriority($priority); foreach ($list as $l) { $replace = array( $l['obscureid'], urlencode($l['title']) ); $this->setPath(str_replace($search, $replace, $pathFormat)); $this->notify(); } WBDatasource_Table::flushCache(); } }