Goal:
To simply print a list in the header of the blog.
example: <ul> <li><a href="$path">$linkname</li></ul>
Once I learn this I should be able to change it to what I really want.
Im going to go over section by section, if I am misinterpreting something please correct me.
Code: Select all
<?php
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include dirname(__FILE__) . '/lang_en.inc.php';
Code: Select all
class serendipity_event_page_nugget extends serendipity_event
{
//introspect defines all data for the plugin
function introspect(&$propbag)
{
global $serendipity;
$propbag->add('name', PLUGIN_NAVBAR_NAME);
$propbag->add('description', PLUGIN_NAVBAR_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'CR');
$propbag->add('version', '0.1');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
Q1: What does the stackable property do?
Code: Select all
$propbag->add('groups', 'FRONTEND_ENTRY_RELATED');
Code: Select all
$propbag->add('event_hooks', 'frontend_header');
Code: Select all
$propbag->add('configuration', array('linkname','path'));
return true;
}
Code: Select all
function introspect_config_item($name, &$propbag)
{
//I think this assumes we are ONLY modifying configuration
switch($name) {
//title1
case 'linkname':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_LINK_NAME);
$propbag->add('description', PLUGIN_LINK_NAME_DETAILS);
$propbag->add('default', '');
break;
case 'path':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_PATH);
$propbag->add('description', PLUGIN_PATH_DETAILS);
$propbag->add('default', '');
break;
default:
return false;
}
return true;
}
Code: Select all
function generate_content(&$title)
{
$title = $this->get_config('title');
}
Code: Select all
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
$linkname = $this->get_config('linkname');
$path = $this->get_config('path');
}
}
Thanks for any help anyone gives.