Author Topic: A better highlighting which excludes HTML  (Read 6295 times)

Offline pfschill

  • User
  • *
  • Posts: 1
    • View Profile
A better highlighting which excludes HTML
« on: August 06, 2008, 04:50:25 AM »
I wanted to embed quicktime movies in knowledgeroot content but found that the search marks up the HTML needed to include the movie.  After a few searches I found:

http://aidanlister.com/repos/v/function.str_highlight.php

The code is in the public domain.  I downloaded the file.  Included it in init.php then modified the class-knowledgeroot-content.php code to:

// adding colored highlighting
if(isset($_GET['highlight']) && $_GET['highlight'] != "") {
    $highlight = explode(",", $_GET['highlight']);
    foreach($highlight as $hkey => $hvalue) {
        $row['content'] = str_highlight($row['content'], $hvalue, null, '<span class="highlightword">\1</span>');
    }
}


Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: A better highlighting which excludes HTML
« Reply #1 on: August 07, 2008, 10:28:16 AM »
Hi,

thanks for your feedback. I have created a ticket for this:
http://trac.knowledgeroot.org/cgi-bin/trac.cgi/ticket/66

Offline admin

  • Administrator
  • User
  • *****
  • Posts: 694
    • View Profile
    • http://www.lordlamer.de
Re: A better highlighting which excludes HTML
« Reply #2 on: August 08, 2008, 02:17:37 PM »
i am working on version 0.9.8.6 and this will be fixed in this version