Hi!
The javascript in the sidebar should basically work well; what did you enter? And did you disable the "Apply Markup Transformations" option for that nugget? And if you use the WYSIWYG editor, you need to put it into HTML source mode to enter javascript.
Having said this, PHP in the sidebar is also very easy, you can just create your own plugin. It's as easy as this:
Code: Select all
<?php # $Id: serendipity_plugin_authors.php,v 1.11 2005/08/01 18:20:06 garvinhicking Exp $
@define('PHPADSNEW_TITLE', 'phpAdsNew');
class serendipity_plugin_phpadsnew extends serendipity_plugin
{
var $title = PHPADSNEW_TITLE;
function introspect(&$propbag)
{
$propbag->add('name', PHPADSNEW_TITLE);
$propbag->add('description', PHPADSNEW_TITLE);
$propbag->add('stackable', true);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '1.0');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('groups', array('FRONTEND_VIEWS'));
$propbag->add('configuration', array('title'));
}
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', TITLE);
$propbag->add('default', PHPADSNEW_TITLE);
break;
}
return true;
}
function generate_content(&$title) {
global $serendipity;
include '/your/path/to/the/phpadsnew/snippet/code.php';
}
}
(BTW, the minimum code for a plugin would be this:
Code: Select all
<?php
class serendipity_plugin_phpadsnew extends serendipity_plugin
{
function introspect(&$propbag) {
$propbag->add('name', 'phpAdsNew');
}
function generate_content(&$title) {
include '/your/path/to/the/phpadsnew/snippet/code.php';
}
}
Now, tell me, isn't serendipity's plugin API great?
Regards,
Garvin