Firefox PHP

subject search, other search enhancements (flex_search module)

Posted by Jeff Teeters 
All files from this thread

File Name File Size   Posted by Date  
flex_search-v2.zip 25 KB open | download Jeff Teeters 12/22/2007 Read message
subject search, other search enhancements (flex_search module)
December 21, 2007 04:09PM
This module implements search by subject and some other features not in the standard Phorum search. I called it "flex_search" because the search form is flexible (can be customized) using the admin settings page. This version of the module works only with Phorum 5.125; a version for 5.2 is planned.

From the README.txt file, features include:
* Subject only search
* Author search with different fields (real name, author, username or email).
* Since / Until time range (e.g. from Jan 11 2003, to mar 13, 2003 11:10AM).
* Forum select (from a list of forums - as in 5.2)
* Threads / messages (as in 5.2)
* Display time of search
* Display SQL used to execute search and mysql explain of code.
* Option to remove wait page (page saying "Search is running. Please be patient").

Searches can be done using indexes on the messages table or the search table (an admin option). If using only the messages table, the search table is not needed. This can reduce the storage required for the forum by about half.

Installation instructions are in file README.txt.

Update 12/22/07: Based on feedback from a tester, I made some changes and uploaded a new version (v2). Any feedback is appreciated and will be used to improve this and the upcoming 5.2 version.



Edited 4 time(s). Last edit at 12/22/2007 09:23PM by jefft.
Attachments:
open | download - flex_search-v2.zip (25 KB)
Re: subject search, other search enhancements (flex_search module)
March 27, 2008 08:46AM
Wonderful Module!

However, I came upon a problem with the ashec module (http://www.phorum.org/phorum5/read.php?16,115169).
When both modules are activated, I get the following error:

Quote

Notice: Undefined variable: body in /$path/mods/ashec/ashec.php on line 20

Warning: Cannot modify header information - headers already sent by (output started at /$path/mods/ashec/ashec.php:20) in /tmp/tpl-faltboot_07-header-toplevel_stage2-e38173a1aabedcfd4e3c04458ccbf78d.php on line 6

Once I deactivate the Ashec Module, all is fine.

Line 20 in ashec.php says
     $data[$message_id]["body"] = $body;

All ashec.php:

<?php

if(!defined("PHORUM")) return;

// Allow Special Html-Encoded Characters - Phorum Mod
// This Mod is basically just a heavily stipped down html-mod
// 6. August 2006 pat

function phorum_ashec($data)
{
$PHORUM = $GLOBALS["PHORUM"];
foreach($data as $message_id => $message)
  {
     if(isset($message["body"]))
        {
            $body = $message["body"];
            // restore escaped &
            $body = str_replace("&amp;", "&", $body);
        }
     $data[$message_id]["body"] = $body;

     if(isset($message["subject"]))
        {
            $body = $message["subject"];
            // restore escaped &
            $body = str_replace("&amp;", "&", $body);
        }
     $data[$message_id]["subject"] = $body;
  }
return $data;
}

?>

For now, I deactived the flex-search Module but would love to use it.

Some more information:
My phorum-Version: 5.1.25.
In the admin/modules/Flex-Search-Settings, it says for the "subject only search":
Index "flex_search_subject_index" does not exist. So method 2 is NOT available.
and for the 'Subject and Body' search method:
Phorum mysql_use_ft option is OFF. So method 1 is NOT available.

Index "flex_search_subject_body_index" does not exist. So method 2 is NOT available.


Cheers,
Marian
Sorry, only registered users may post in this forum.

Click here to login