Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14724
Modified Files:
NEWS serendipity_sidebar_items.php
Log Message:
html nugget can be shown on extended view / overview or both.
TODO: should be applicable to ALL sidebar items, not only html nugget?
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- serendipity_sidebar_items.php 9 Jul 2004 09:01:59 -0000 1.69
+++ serendipity_sidebar_items.php 9 Jul 2004 18:59:14 -0000 1.70
@@ -529,6 +529,7 @@
'title',
'content',
'markup',
+ 'show_where'
)
);
@@ -559,6 +560,15 @@
$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;
}
@@ -567,7 +577,17 @@
function generate_content(&$title)
{
+ global $serendipity;
+
$title = $this->get_config('title', $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;
+ }
+
if ($this->get_config('markup', 'true') == 'true') {
$entry = array('html_nugget' => $this->get_config('content'));
serendipity_plugin_api::hook_event('frontend_display', $entry);
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- NEWS 9 Jul 2004 09:34:52 -0000 1.168
+++ NEWS 9 Jul 2004 18:59:13 -0000 1.169
@@ -3,6 +3,9 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Allow HTML nugget to be displayable on extended article only, over-
+ view only or both (default) (garvinhicking)
+
* New plugin 'serendipity_event_blogpdf'. Will export your blog
as PDF file. Proof-of-concept, no nice formatting, no images yet.
If you're using 'mod_rewrite' you need to update your .htaccess
|