'Keywords to always include in the page\'s "meta=keywords" header value', 'include_categories' => 'Set to 1 to include post categories.' ); var $_frontend; // options var $always_include = ''; var $include_categories = 1; function TagMetaKeywords(&$frontend, $args, $dummy_run=false) { $this->LightPressPlugin($frontend, $args, $dummy_run); } function run($hook, &$post) { if (!$this->active) return ($this->hide()); $f =& $this->_frontend; $tpl =& $f->tpl; // add keywords & categories to page keywords array $pagekeys = explode(',', $this->always_include); if (isset($post['tags']) && count($post['tags']) > 0) { $pagekeys = array_merge($pagekeys, $post['tags']); } if ($this->include_categories && isset($post['categories'])) { $categories =& $f->getCategories(); foreach ($post['categories'] as $post_category) $pagekeys[] = $categories[$post_category]['cat_name']; } $pagekeys = array_unique($pagekeys); // setup meta keywords for page header $keywordlist = array(); foreach($pagekeys as $keyword) { $keyword = trim($keyword); if ($keyword) $keywordlist[] = htmlspecialchars($keyword); } $tpl->setVar('PLUGIN_TAGMETAKEYWORDS', ''); } function hide() { $this->_frontend->tpl->setVar('PLUGIN_TAGMETAKEYWORDS', ''); } } ?>