'Run the plugin only for this file', 'post_separator'=>'character(s) to use when joining post titles' ); var $limit_to = 'list_archives.php'; var $post_separator = '‖'; var $default_context = LP_CONTEXT_INDEX; var $description = 'Display archive months and their posts titles'; var $active = true; var $hooks = array('pre_render'); var $_extra_months = 3; function ArchivesListExtended(&$frontend, $args, $dummy_run=false) { $this->LightPressPlugin($frontend, $args, $dummy_run); if (!$dummy_run && !empty($this->limit_to) && basename($_SERVER['PHP_SELF']) != $this->limit_to) $this->active = false; } function &run($hook, &$hook_data) { $f =& $this->_frontend; $tpl =& $f->tpl; $db =& $f->db; $sep = $this->post_separator; $tpl->setFile('plugin_archiveslistextended', 'plugins/archives_list_extended.xml'); $archives = $this->_frontend->getArchives(); $q = "select id, post_name, post_title, UNIX_TIMESTAMP(post_date) as tstamp, " . "concat(year(post_date), lpad(month(post_date), 2, '0')) as archive " . "from " . $f->tables['posts'] . " " . "where post_status='publish' and post_date_gmt <= '" . $f->where_date . "' " . "order by post_date desc"; $db->query($q); $opt_url = $f->options['url']; $archive = null; foreach ($db->all() as $post) { if ($archive != $post['archive']) { if (!is_null($archive)) $archives[$archive]['posts'] = '