Revision history for HighlightSearch


Revision [23492]

Last edited on 2016-05-20 07:38:48 by EmeraldIsland [Replaces old-style internal links with new pipe-split links.]
Additions:
Handler also available for [[HighlightSearchWikka12 | Wikka 1.2 ]] and [[HighlightSearchWikka13 | Wikka 1.3]]
RolandStens did [[SearchHighlighter]] based on Javascript. Here is my contribution in PHP. The work is based on show.php handler and a small part of textsearchexpanded.php action. You can see this new handler in action [[http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight | here]].
Deletions:
Handler also available for [[HighlightSearchWikka12 Wikka 1.2 ]] and [[HighlightSearchWikka13 Wikka 1.3]]
RolandStens did [[SearchHighlighter]] based on Javascript. Here is my contribution in PHP. The work is based on show.php handler and a small part of textsearchexpanded.php action. You can see this new handler in action [[http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight here]].


Revision [21595]

Edited on 2011-10-08 08:56:24 by EmeraldIsland [Link to Wikka version 1.3 added]
Additions:
Other: [[SearchHighlighter]], HighlightSearchWikka12, HighlightSearchWikka13
Handler also available for [[HighlightSearchWikka12 Wikka 1.2 ]] and [[HighlightSearchWikka13 Wikka 1.3]]
Deletions:
Other: [[SearchHighlighter]]
Version also [[HighlightSearchWikka12 available for Wikka 1.2]] (updating according to the new theme schema)


Revision [20829]

Edited on 2009-09-06 10:54:56 by EmeraldIsland [See HighlightSearchWikka12 for Wikka 1.2]
Additions:
Wikka 1.1.6.2 - 1.1.6.6>>//NOT included in any Wikka version//
Version also [[HighlightSearchWikka12 available for Wikka 1.2]] (updating according to the new theme schema)
Deletions:
Wikka 1.1.6.2>>//NOT included in any Wikka version//


Revision [19073]

Edited on 2008-01-28 00:14:02 by EmeraldIsland [Modified links pointing to docs server]

No Differences

Revision [16398]

Edited on 2007-04-11 16:19:21 by EmeraldIsland [Modified links pointing to docs server]

No Differences

Revision [16397]

Edited on 2007-04-11 16:18:08 by EmeraldIsland [Modified links pointing to docs server]
Additions:
3. That's all !
==Remark :==
- change 'highlightsearch' by 'show' in textsearch.php (step 2. above)
Deletions:
That's all !
**Remark :**
If you prefer, you can replace 'show' handler. In that case, don't forget to also change 'highlightsearch' by 'show' in textsearch.php
- change 'highlightsearch' by 'show' in textsearch.php


Revision [16396]

Edited on 2007-04-11 16:15:45 by EmeraldIsland [Modified links pointing to docs server]
Additions:
>>==See also :==
Documentation : ""HighlightSearchHandlerInfo""
Other: [[SearchHighlighter]]
==Works with :==
Wikka 1.1.6.2>>//NOT included in any Wikka version//
This is the development page for the HighlightSearch handler.
::c::
==Installation==
- Save the code block below as ##handlers/page/highlightsearch.php##
- Give it the same file permissions as the other php files in that directory
==Code==
1. New handlers/page/highlightsearch.php file
2. In textsearch.php action, change only one line :
**Remark :**
If you prefer, you can replace 'show' handler. In that case, don't forget to also change 'highlightsearch' by 'show' in textsearch.php
For a better integration in your wiki, you can also replace 'show' handler.
- rename or save handlers/page/show.php in handlers/page/show_ref.php
- rename handlers/page/highlightsearch.php in handlers/page/show.php
- change 'highlightsearch' by 'show' in textsearch.php
Deletions:
>>==See also:==
Documentation: ""HighlightSearchHandlerInfo""
Other: [[SearchHighlighter]]>>This is the development page for the HighlightSearch handler.::c::
You just need to create the new file highlightsearch.php in your /handlers/page directory and copy this code :
**Remark :** if you prefer, you can replace 'show' handler.In that case, don't forget to also change 'highlightsearch' by 'show' in textsearch.php
For a better integration in your wiki, you will need to change only one line in textsearch.php action :


Revision [15694]

Edited on 2006-11-25 20:50:13 by EmeraldIsland [Modified links pointing to docs server]
Additions:
You just need to create the new file highlightsearch.php in your /handlers/page directory and copy this code :
**Remark :** if you prefer, you can replace 'show' handler.In that case, don't forget to also change 'highlightsearch' by 'show' in textsearch.php
if (isset($_REQUEST['search']) && ($search = $_REQUEST['search'])) {
$search_re = stripslashes(trim($search));
if ($search_re) {
// display page with highlighted string
$txt_stripped = $this->Format($this->page['body'], 'wakka');
// The evil REGEXP
$pattern = '/('.$this->htmlspecialchars_ent($search_re).')(?![^<]*?>)/i';
$highlightMatch = preg_replace($pattern,'<<$1>>',$txt_stripped,-1);
$matchText = str_replace(array('<<', '>>'), array('<span class="tse_keywords">', '</span>'), $highlightMatch);
echo $matchText;
} else { echo $this->Format($this->page['body'], 'wakka'); }
Deletions:
Then you just need to create the new file highlightsearch.php in your /handlers/page directory and copy this code :
if (isset($_REQUEST['search']) && ($search = $_REQUEST['search'])) {
$search_re = stripslashes(trim($search));
if (!$search_re) return;
// display page with highlighted string
$txt_stripped = $this->Format($this->page['body'], 'wakka');
// The evil REGEXP
$pattern = '/('.$this->htmlspecialchars_ent($search_re).')(?![^<]*?>)/i';
$highlightMatch = preg_replace($pattern,'<<$1>>',$txt_stripped,-1);
$matchText = str_replace(array('<<', '>>'), array('<span class="tse_keywords">', '</span>'), $highlightMatch);
echo $matchText;


Revision [15693]

Edited on 2006-11-25 20:31:07 by EmeraldIsland [Modified links pointing to docs server]
Deletions:
// EMERALDISLAND
echo '<div class="footcopyright"><a href="http://creativecommons.org/licenses/by-nc-nd/2.5/"><img src="./css/images/somerights20.png" alt="Some rights reserved" title="Some rights reserved" width="88px" height="31px" /></a><br />Except where otherwise <a href="http://creativecommons.org/policies#license">noted</a>, content on this site is licensed<br />under a <a href="http://creativecommons.org/licenses/by-nc-nd/2.5/">Creative Commons Attribution - Noncommercial - No Derivative Works 2.5 License</a>.</div>';


Revision [15692]

Edited on 2006-11-25 20:20:36 by EmeraldIsland [Modified links pointing to docs server]
Additions:
Documentation: ""HighlightSearchHandlerInfo""
Other: [[SearchHighlighter]]>>This is the development page for the HighlightSearch handler.::c::
For a better integration in your wiki, you will need to change only one line in textsearch.php action :
Old textsearch.php source code (line 50) :
New textsearch.php source code (line 50) :
Deletions:
Documentation: HighlightSearchHandlerInfo.>>This is the development page for the HighlightSearch handler.::c::
For a better integration in your wiki, you will need to change only one line in textsearch.php action :---
old textsearch.php source code (line 50) :
new textsearch.php source code (line 50) :


Revision [15691]

Edited on 2006-11-25 20:16:09 by EmeraldIsland [Modified links pointing to docs server]
Additions:
RolandStens did [[SearchHighlighter]] based on Javascript. Here is my contribution in PHP. The work is based on show.php handler and a small part of textsearchexpanded.php action. You can see this new handler in action [[http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight here]].
For a better integration in your wiki, you will need to change only one line in textsearch.php action :---
Deletions:
RolandStens did [[SearchHighlighter]] based on Javascript. Here is my contribution in PHP. The work is based on show.php handler and a small part of textsearchexpanded.php action.
You can see this new handler in action [[http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight here]].
For a better integration in your wiki, you will need to change only one line in textsearch.php action :


Revision [15690]

Edited on 2006-11-25 20:14:45 by EmeraldIsland [Modified links pointing to docs server]
Additions:
=====HighlightSearch Handler=====
>>==See also:==
Documentation: HighlightSearchHandlerInfo.>>This is the development page for the HighlightSearch handler.::c::
Deletions:
=====xxxxx Handler=====


Revision [15689]

Edited on 2006-11-25 20:13:02 by EmeraldIsland [Modified links pointing to docs server]
Additions:
=====xxxxx Handler=====
CategoryUserContributions - CategoryDevelopmentHandlers
Deletions:
CategoryUserContributions


Revision [15688]

Edited on 2006-11-25 20:10:51 by EmeraldIsland [Modified links pointing to docs server]
Additions:
You can see this new handler in action [[http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight here]].
Deletions:
You can see this new handler in action [http://emeraldisland.free.fr/wikka/wikka.php?wakka=HighlightSearch/highlightsearch&search=highlight here]].


Revision [15687]

The oldest known version of this page was created on 2006-11-25 20:10:13 by EmeraldIsland [Modified links pointing to docs server]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki