Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_bbcode
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29422/plugins/serendipity_event_bbcode
Modified Files:
serendipity_event_bbcode.php
Log Message:
* Move Smarty object instancing to a function call, so that is not
created when not needed (like for CSS)
* make head_title / head_subtitle globally available, so that plugins
can also use it
* Code optimizations: Queries, referenced variables, plugin API
* Improved entryproperties cache
* Improved Plugin API calls to fetch titles of entries
* Improved Plugin aPI calls to set the authorid of a plugin
* Improved some plugins to not create costy introspect() calls, and move
them to the introspect_config_item() part
* Fixed trackexits plugin to not abuse the query() function too often
Index: serendipity_event_bbcode.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_bbcode/serendipity_event_bbcode.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serendipity_event_bbcode.php 19 Nov 2004 11:05:37 -0000 1.9
+++ serendipity_event_bbcode.php 19 Nov 2004 11:24:51 -0000 1.10
@@ -17,7 +17,7 @@
class serendipity_event_bbcode extends serendipity_event
{
-
+ var $title = PLUGIN_EVENT_BBCODE_NAME;
function introspect(&$propbag)
{
global $serendipity;
@@ -27,6 +27,7 @@
$propbag->add('stackable', false);
$propbag->add('author', 'Jez Hancock, Garvin Hicking');
$propbag->add('version', '1.0');
+ $propbag->add('cachable_events', array('frontend_display' => true));
$propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true, 'css' => true));
$this->markup_elements = array(
@@ -153,7 +154,7 @@
}
function generate_content(&$title) {
- $title = PLUGIN_EVENT_BBCODE_NAME;
+ $title = $this->title;
}
@@ -175,6 +176,15 @@
return true;
}
+ function install() {
+ serendipity_plugin_api::hook_event('backend_cache_entries', $this->title);
+ }
+
+ function uninstall() {
+ serendipity_plugin_api::hook_event('backend_cache_purge', $this->title);
+ serendipity_plugin_api::hook_event('backend_cache_entries', $this->title);
+ }
+
function bbcode($input) {
/* Regular expressions taken from http://smarty.incutio.com/?page=BBCodePlugin Wiki (Andre Rabold) */
$input = preg_replace(array_keys($this->bbcodes), array_values($this->bbcodes), $input);
@@ -195,10 +205,6 @@
case 'frontend_display':
foreach ($this->markup_elements as $temp) {
- if (isset($eventData['is_cached']) && $eventData['is_cached'] && ($temp['element'] == 'body' || $temp['element'] == 'extended')) {
- continue;
- }
-
if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
$element = $temp['element'];
$eventData[$element] = $this->bbcode($eventData[$element]);
|