upstream
This commit is contained in:
parent
4ee90aa2e5
commit
d30c3104f1
@ -1,10 +1,14 @@
|
||||
ChangeLog:
|
||||
""""""""""
|
||||
|
||||
[Version 1.8 2010/10/11] by Ian (Timbalu)
|
||||
- added highlighting static page, if not having a ['GET']['searchTerm'] REQUEST, but coming from a /search/ referrer
|
||||
- changed $_REQUEST to $serendipity['GET']
|
||||
|
||||
[Version 1.7 2010/09/30] by Ian (Timbalu)
|
||||
- added to support the wildcard(*) search which was added in core.
|
||||
it will now act like a fuzzy search, if you enter an asterisk search. The search 'word*' will highlight case insensive all occurences of '%word%'.
|
||||
- added the searchengine Bing (untested)
|
||||
- added to config the ability to highlight search results in static pages
|
||||
which are appended at the end of the search page. This does not work in the teaser itself, but on the opend static page.
|
||||
which are appended at the end of the search page. This does not work in the teaser itself, but inside the opened static page.
|
||||
- added lang files constants <en>, <de> and <de-utf8>
|
||||
|
@ -18,7 +18,7 @@ class serendipity_event_searchhighlight extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Tom Sommer');
|
||||
$propbag->add('version', '1.7');
|
||||
$propbag->add('version', '1.8');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -145,9 +145,22 @@ class serendipity_event_searchhighlight extends serendipity_event
|
||||
if (!empty($_REQUEST['serendipity']['searchTerm'])) {
|
||||
$query = $_REQUEST['serendipity']['searchTerm'];
|
||||
}
|
||||
|
||||
if (!empty($serendipity['GET']['searchTerm'])) {
|
||||
$query = $serendipity['GET']['searchTerm'];
|
||||
}
|
||||
/* highlight selected static page, if not having a ['GET']['searchTerm'] REQUEST, but coming from a /search/ referrer */
|
||||
if(empty($query)) {
|
||||
// look out for path or query depending mod_rewrite setting
|
||||
$urlpath = (($serendipity['rewrite'] == 'rewrite') ? parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH)
|
||||
: parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)
|
||||
);
|
||||
if ( strpos($urlpath, 'search/') ) {
|
||||
$urlpath = htmlspecialchars(strip_tags($urlpath)); // avoid spoofing
|
||||
$path = explode('/', urldecode($urlpath)); // split and decode non ASCII
|
||||
$query = $path[(array_search('search', $path)+1)];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PLUGIN_EVENT_SEARCHHIGHLIGHT_MSN :
|
||||
@ -204,6 +217,7 @@ class serendipity_event_searchhighlight extends serendipity_event
|
||||
if ( ($queries = $this->getQuery()) === false ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$_SESSION['is_searchengine_visitor'] = true;
|
||||
$_SESSION['search_referer'] = $this->uri;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user