function init_metapages() { if ($this->options['sort'][1] === 'reading') { // Beta Function if ($this->options['tag'][1] == '') { $readings = $this->get_readings(); } else { $plugin_tag = new PluginTag(); $pages = $plugin_tag->get_taggedpages($this->options['tag'][1]); if ($pages === FALSE) { $this->error = 'The tag token, ' . htmlspecialchars($this->options['tag'][1]) . ', is invalid. '; $this->error .= 'Perhaps, the tag does not exist. '; } $readings = $this->get_readings(); // why can not set pages... foreach ($pages as $page) { $tagged_readings[$page] = ''; } // array_intersect_key >= PHP 5.1.0 RC1 // $readings = array_intersect_key($readings, $tagged_readings); foreach ($readings as $page => $reading) { if (!isset($tagged_readings[$page])) { unset($readings[$page]); } } } $metapages = array(); foreach ($readings as $page => $reading) { unset($readings[$page]); $metapages[] = array('reading' => $reading, 'page' => $page, 'exist' => true, 'depth' => 1, 'listdepth' => 1, 'timestamp' => 1, 'date' => ''); } $this->metapages = $metapages; } else { if ($this->options['tag'][1] == '') { $pages = get_existpages(); } else { $plugin_tag = new PluginTag(); $pages = $plugin_tag->get_taggedpages($this->options['tag'][1]); if ($pages === FALSE) { $this->error = 'The tag token, ' . htmlspecialchars($this->options['tag'][1]) . ', is invalid. '; $this->error .= 'Perhaps, the tag does not exist. '; } } $metapages = array(); foreach ($pages as $i => $page) { unset($pages[$i]); $metapages[] = array('page' => $page, 'exist' => true, 'depth' => 1, 'listdepth' => 1, 'timestamp' => 1, 'date' => ''); } $this->metapages = $metapages; } }
function init_metapages() { $qm = get_qm(); if ($this->options['sort'][1] === 'reading') { // Beta Function if ($this->options['tag'][1] == '') { $readings = $this->get_readings(); } else { $plugin_tag = new PluginTag(); $pages = $plugin_tag->get_taggedpages($this->options['tag'][1]); if ($pages === FALSE) { $this->error = $qm->replace('plg_lsx.err_invalid_tag', h($this->options['tag'][1])); } $readings = $this->get_readings(); // why can not set pages... foreach ($pages as $page) { $tagged_readings[$page] = ''; } // array_intersect_key >= PHP 5.1.0 RC1 // $readings = array_intersect_key($readings, $tagged_readings); foreach ($readings as $page => $reading) { if (!isset($tagged_readings[$page])) { unset($readings[$page]); } } } $metapages = array(); foreach ($readings as $page => $reading) { unset($readings[$page]); $metapages[] = array('reading' => $reading, 'page' => $page, 'exist' => true, 'depth' => 1, 'listdepth' => 1, 'timestamp' => 1, 'date' => ''); } $this->metapages = $metapages; } else { if ($this->options['tag'][1] == '') { $pages = get_existpages(); } else { $plugin_tag = new PluginTag(); $pages = $plugin_tag->get_taggedpages($this->options['tag'][1]); if ($pages === FALSE) { $this->error = $qm->replace('plg_lsx.err_invalid_tag', h($this->options['tag'][1])); } } $metapages = array(); foreach ($pages as $i => $page) { unset($pages[$i]); $metapages[] = array('page' => $page, 'exist' => true, 'depth' => 1, 'listdepth' => 1, 'timestamp' => 1, 'date' => ''); } $this->metapages = $metapages; } }