Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7252
Modified Files:
serendipity_functions.inc.php NEWS serendipity.css.php
serendipity_plugin_api.php
Log Message:
* Added Karma event plugin.
* New event hook 'css'
* New variable 'add_footer' for use within entry-handling event plugins
* Enhanced plugin API to allow passing of second array of data
Index: serendipity.css.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- serendipity.css.php 21 Mar 2004 16:35:31 -0000 1.25
+++ serendipity.css.php 26 May 2004 12:06:59 -0000 1.26
@@ -12,7 +12,6 @@
function serendipity_printStylesheet($file) {
global $serendipity;
echo str_replace('{TEMPLATE_PATH}', dirname($file) .'/', file_get_contents($file, 1));
-
}
if (!file_exists('serendipity_config_local.inc.php')) {
@@ -30,5 +29,8 @@
$css = serendipity_getCSS($_REQUEST['style']);
echo $css['data'];
}
+
+serendipity_plugin_api::hook_event('css', $_REQUEST['style']);
+
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: serendipity_plugin_api.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_plugin_api.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- serendipity_plugin_api.php 15 May 2004 11:00:19 -0000 1.19
+++ serendipity_plugin_api.php 26 May 2004 12:06:59 -0000 1.20
@@ -349,10 +349,10 @@
return $title;
}
- /* conditional to see if the named plugin is an event plugin
- Refactoring: decompose conditional */
- function is_event_plugin($name) {
- return (strstr($name, '_event_'));
+ /* conditional to see if the named plugin is an event plugin
+ Refactoring: decompose conditional */
+ function is_event_plugin($name) {
+ return (strstr($name, '_event_'));
}
function &get_event_plugins($instance = false) {
@@ -387,7 +387,7 @@
}
}
- function hook_event($event_name, &$eventData) {
+ function hook_event($event_name, &$eventData, $addData = null) {
global $serendipity;
// Can be bypassed globally
@@ -398,7 +398,7 @@
if (is_array($plugins)) {
foreach($plugins AS $plugin => $plugin_data) {
$bag = &$plugin_data['b'];
- $plugin_data['p']->event_hook($event_name, $plugin_data['b'], $eventData);
+ $plugin_data['p']->event_hook($event_name, $plugin_data['b'], $eventData, $addData);
}
}
}
@@ -613,7 +613,7 @@
$this->instance = $instance;
}
- function event_hook($event, &$bag, &$eventData) {
+ function event_hook($event, &$bag, &$eventData, $addData = null) {
// Define event hooks here, if you want you plugin to execute those instead of being a sidebar item.
// Look at external plugins 'serendipity_event_mailer' or 'serendipity_event_weblogping' for usage.
// Currently available events:
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -d -r1.272 -r1.273
--- serendipity_functions.inc.php 25 May 2004 16:18:09 -0000 1.272
+++ serendipity_functions.inc.php 26 May 2004 12:06:58 -0000 1.273
@@ -927,7 +927,8 @@
function serendipity_printEntries($entries, $extended = 0, $preview = false) {
global $serendipity;
- serendipity_plugin_api::hook_event('entry_display', $entries);
+ $addData = array('extended' => $extended, 'preview' => $preview);
+ serendipity_plugin_api::hook_event('entry_display', $entries, $addData);
if (isset($entries['clean_page']) && $entries['clean_page'] === true) {
return; // no display of this item
@@ -1005,6 +1006,10 @@
if ($_SESSION['serendipityAuthedUser'] === true && ($_SESSION['serendipityUserlevel'] >= USERLEVEL_CHIEF || $_SESSION['serendipityAuthorid'] == $entry['authorid'])) {
echo ' | <a href="' . $serendipity['baseURL'] . 'serendipity_entries.php?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]=' . $entry['id'] . '">' . EDIT_ENTRY . '</a>';
}
+
+ if (!empty($entry['add_footer'])) {
+ echo $entry['add_footer'];
+ }
?>
</div>
@@ -1019,11 +1024,11 @@
dc:identifier="<?php echo serendipity_archiveURL($entry['id'], $entry['title']); ?>" />
</rdf:RDF>
-->
- <?php
- $eventData = array_merge(array('display_dat' => ''), $entry);
- serendipity_plugin_api::hook_event('frontend_display:html:per_entry', $eventData);
- echo $eventData['display_dat'];
- ?>
+ <?php
+ $eventData = array_merge(array('display_dat' => ''), $entry);
+ serendipity_plugin_api::hook_event('frontend_display:html:per_entry', $eventData);
+ echo $eventData['display_dat'];
+ ?>
<?php
if (isset($serendipity['GET']['id'])) {
?>
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- NEWS 25 May 2004 16:16:09 -0000 1.132
+++ NEWS 26 May 2004 12:06:59 -0000 1.133
@@ -3,6 +3,14 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Added new plugin "serendipity_event_karma": Allows karma voting
+ for each article with a flexible voting period.(garvinhicking)
+
+ * Added event hook-variable for displaying an article footer.
+ Enhanced Plugin API to allow passing a second array of data to the
+ hook_event() function (backwards-compatible). Added hook for
+ embedding CSS data from within a event plugin. (garvinhicking)
+
* When sending trackbacks, the excerpt will now be stripped of HTML
code BEFORE selecting the 255 characters to be sent.
(garvinhicking)
|