Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_searchhighlight
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24806/plugins/serendipity_event_searchhighlight
Modified Files:
serendipity_event_searchhighlight.php
Log Message:
Merge from 'branch-smarty' to HEAD.
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.5
diff -u -d -r1.4 -r1.5
--- serendipity_event_searchhighlight.php 28 Aug 2004 15:55:53 -0000 1.4
+++ serendipity_event_searchhighlight.php 19 Nov 2004 11:05:42 -0000 1.5
@@ -12,7 +12,7 @@
case 'en':
default:
@define('PLUGIN_EVENT_SEARCHHIGHLIGHT_NAME', 'Highlight search queries');
- @define('PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC', 'Highlights queries used to locate your page in a search engine');
+ @define('PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC', 'Highlights queries used in the referring search engine to locate your page');
break;
}
@@ -24,7 +24,10 @@
$propbag->add('name', PLUGIN_EVENT_SEARCHHIGHLIGHT_NAME);
$propbag->add('description', PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC);
- $propbag->add('event_hooks', array('frontend_display' => true, 'css' => true));
+ $propbag->add('stackable', false);
+ $propbag->add('author', 'Tom Sommer');
+ $propbag->add('version', '1.0');
+ $propbag->add('event_hooks', array('frontend_display' => true, 'css' => true));
$this->markup_elements = array(
array(
@@ -170,11 +173,11 @@
$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;
@@ -184,9 +187,9 @@
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) ) {
@@ -217,4 +220,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file
|