7 responses to “Search-Highlight Plugin (bug and fix)”

  1. dot-totally.co.uk

    [...] [...]

  2. moi-carine.com » Wordpress 1.2 Plugins

    [...] [...]

  3. ScottHeavner

    I don’t see any way to fix the third without touching code outside the plugin. But I’m not going to let that stop me. So unfortunately it becomes a plugin with a hack.

    Near the bottom of wp-blog-header.h, I’m appending “&olds=$” to the url before we bounce. You might need a ? instead of & depending on your permalink setup.

     if ($s && empty($paged)) { // If they were doing a search and got one result
         if (!strstr($_SERVER['PHP_SELF'], 'wp-admin')) // And not in admin section
           header('Location: ' . get_permalink($posts[0]->I
    D) . "&olds=$s" );
    

    Then I’m throwing out all the referer junk in the plugin’s get_search_query_terms() and testing for olds= in the query. I don’t think the relevant information will ever be in the referer for the wordpress search (it will be when coming from google/yahoo/...), any info in the referer is stale, from the last successful search.

            case 'wordpress':
                    if ( !empty( $_GET['olds'] ) ) {
                            $query_array = array( $_GET['olds'] ) ;
                            break;
                    } else if (!empty($s)) {
                            $query_array = array($s);
                            break;
                    }
            }
    
  4. Kenzo

    Nice plugin, thank you

  5. a-giA?u

    Making the (Google) Search-Highlight Plugin work with non-space-delimited scripts

    The Search-Highlight Plugin for WordPress assumes the blog is written in a script that uses space (and other regular expression \b characters) to mark [[en:Word|word boundary]] (orthographically speaking). For users of Chinese, Japanese kana, among ma…

  6. Beginner Millionaire » The WordPress Plug-In List for Niche Bloggers

    [...] Search Hilite – Search Hilite highlights the keyphrases people searched for when they come to your site via Google, Yahoo, etc., as well as highlighting search keyphrases when people search your blog with WordPress’ built-in search functionality. I’ve found it doesn’t work wtih some themes, likely a CSS issue, but it’s worth uploading and activating as it does help readers navigate your site and find exactly what they were looking for. See it working here. [...]

  7. xnxx

    Great Plugin,thks. I have some modifications for you that will allow this to work with the new Widgets Plugin.