add('name', PLUGIN_EXTERNALPHP_TITLE); $propbag->add('description', PLUGIN_EXTERNALPHP_TITLE_BLAHBLAH); $propbag->add('event_hooks', array('entries_header' => true, 'entry_display' => true, 'genpage' => true)); $propbag->add('configuration', array('permalink', 'pagetitle', 'include', 'articleformat')); $propbag->add('author', 'Garvin Hicking'); $propbag->add('version', '1.3'); $propbag->add('requirements', array( 'serendipity' => '0.7', 'smarty' => '2.6.7', 'php' => '4.1.0' )); $propbag->add('groups', array('FRONTEND_EXTERNAL_SERVICES')); $propbag->add('stackable', true); } function introspect_config_item($name, &$propbag) { global $serendipity; switch($name) { case 'permalink': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EXTERNALPHP_PERMALINK); $propbag->add('description', PLUGIN_EXTERNALPHP_PERMALINK_BLAHBLAH); $propbag->add('default', $serendipity['rewrite'] != 'none' ? $serendipity['serendipityHTTPPath'] . 'pages/phpname.html' : $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/pages/phpname.html'); break; case 'include': // THIS IS AN EVIL EVIL PLUGIN. if ($serendipity['serendipityUserlevel'] < USERLEVEL_ADMIN) { return false; } $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EXTERNALPHP_INCLUDE); $propbag->add('description', PLUGIN_EXTERNALPHP_INCLUDE_DESC); $propbag->add('default', $serendipity['serendipityPath'] . 'include/your_php.inc.php'); break; case 'pagetitle': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EXTERNALPHP_PAGETITLE); $propbag->add('description', ''); $propbag->add('default', 'phpname'); break; case 'articleformat': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EXTERNALPHP_ARTICLEFORMAT); $propbag->add('description', PLUGIN_EXTERNALPHP_ARTICLEFORMAT_BLAHBLAH); $propbag->add('default', 'true'); break; default: return false; } return true; } function show() { global $serendipity; if ($this->selected()) { if (!headers_sent()) { header('HTTP/1.0 200'); header('Status: 200 OK'); } if (!is_object($serendipity['smarty'])) { serendipity_smarty_init(); } $serendipity['smarty']->assign('staticpage_pagetitle', preg_replace('@[^a-z0-9]@i', '_',$this->get_config('pagetitle'))); if ($this->get_config('articleformat') == TRUE) { echo '