In diesem Fall folgendes Plugin ausprobieren. Ungetestet und es kann Dir Dein Hirn rausragen, den Server zerstören und sämtliche Daten ans BKA schicken:
Code: Select all
<?php
class serendipity_plugin_phpbox extends serendipity_plugin {
var $title = 'PHP Nugget';
function introspect(&$propbag)
{
$this->title = $this->get_config('title', $this->title);
$propbag->add('name', 'PHP Nugget');
$propbag->add('description', HOLDS_A_BLAHBLAH);
$propbag->add('stackable', true);
$propbag->add('author', '37331 h4x0rr');
$propbag->add('version', '1.0');
$propbag->add('configuration', array(
'title',
'content',
'markup',
'show_where'
)
);
$this->protected = TRUE; // If set to TRUE, only allows the owner of the plugin to modify its configuration
}
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', TITLE_FOR_NUGGET);
$propbag->add('default', '');
break;
case 'content':
$propbag->add('type', 'html');
$propbag->add('name', CONTENT);
$propbag->add('description', THE_NUGGET);
$propbag->add('default', '');
break;
case 'markup':
$propbag->add('type', 'boolean');
$propbag->add('name', DO_MARKUP);
$propbag->add('description', DO_MARKUP_DESCRIPTION);
$propbag->add('default', 'true');
break;
case 'show_where':
$select = array('extended' => PLUGIN_ITEM_DISPLAY_EXTENDED, 'overview' => PLUGIN_ITEM_DISPLAY_OVERVIEW, 'both' => PLUGIN_ITEM_DISPLAY_BOTH);
$propbag->add('type', 'select');
$propbag->add('select_values', $select);
$propbag->add('name', PLUGIN_ITEM_DISPLAY);
$propbag->add('description', '');
$propbag->add('default', 'both');
break;
default:
return false;
}
return true;
}
function generate_content(&$title)
{
global $serendipity;
$title = $this->get_config('title');
$show_where = $this->get_config('show_where', 'both');
if ($show_where == 'extended' && (!isset($serendipity['GET']['id']) || !is_numeric($serendipity['GET']['id']))) {
return false;
} else if ($show_where == 'overview' && isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id'])) {
return false;
}
$_content = $this->get_config('content');
ob_start();
eval($content);
$content = ob_get_contents();
ob_end_clean();
if ($this->get_config('markup', 'true') == 'true') {
$entry = array('html_nugget' => $content);
serendipity_plugin_api::hook_event('frontend_display', $entry);
echo $entry['html_nugget'];
} else {
echo $content;
}
}
}
?>
(Den Code als /plugins/serendipity_plugin_phpbox.php abspeichern und dann einstellen)
English notice: This plugin may cause serious damage to your server, brain, and friends. It will kill your animals, create a nuclear fallout in the street you're living and will cripple any organs you may have left. You've been warned. This plugin is considered dangerous.