Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_searchhighlight
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31269/plugins/serendipity_event_searchhighlight
Modified Files:
Tag: branch-smarty
serendipity_event_searchhighlight.php
Log Message:
Allow to cache entire entries.
Needs some further work to maybe remove plugin references from _functions completely.
Possibly add a hook to rebuild entries on certain events (like when a new textile/bbcode etc. plugin is added)
Index: serendipity_event_searchhighlight.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- serendipity_event_searchhighlight.php 28 Aug 2004 15:55:53 -0000 1.4
+++ serendipity_event_searchhighlight.php 22 Sep 2004 10:58:59 -0000 1.4.2.1
@@ -170,23 +170,27 @@
$this->uri = $_SERVER['HTTP_REFERER'];
$hooks = &$bag->get('event_hooks');
-
+
if (!isset($hooks[$event])) {
return false;
}
-
+
if ( $event == 'frontend_display' ) {
if ( ($queries = $this->getQuery()) === false ) {
return;
}
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']])) ) {
continue;
}
-
+
$element = &$eventData[$temp['element']];
-
+
foreach ( $queries as $word ) {
/* If the data contains HTML tags, we have to be careful not to break URIs and use a more complex preg */
if ( preg_match('/\<.+\>/', $element) ) {
|