Welcome, Guest. Please Login or Register.
November 01, 2024, 05:28:44 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.2] Search Enhance « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Beta 1.5.2] Search Enhance  (Read 2315 times)
A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
[Beta 1.5.2] Search Enhance
« on: May 21, 2003, 08:34:30 AM »
Reply with quote

What is it:
This mod will enhance the search capability for displaying accurate results. Now you can search for strings in Subject only or in Message only or in both of them.

Download:
H E R E

Manual:
open Search.php and search for:
     if ($userkind == 1 && $userspec == '')
        $where = "($boardsWhere m.ID_MSG=t.ID_FIRST_MSG && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 1 && $userspec != '')
        $where = "($boardsWhere m.ID_MSG=t.ID_FIRST_MSG && m.posterName='$userspec' && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 2 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 2 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.posterName='$userspec' && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 3 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 3 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && m.posterName='$userspec' && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 4 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER=-1 && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 4 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER=-1 && m.posterName='$userspec' && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && (INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";

replace it with:
 if ($searchsubject == 'on' && $searchmessage == 'on')
    $searchcrit = "(INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query'))";
 else if ($searchsubject == 'on')
    $searchcrit = "(INSTR(LOWER(m.subject),'$query'))";
 else if ($searchmessage == 'on')
    $searchcrit = "(INSTR(LOWER(m.body),'$query'))";
 else
    $searchcrit = "(INSTR(LOWER(m.subject),'$query') || INSTR(LOWER(m.body),'$query'))";

     if ($userkind == 1 && $userspec == '')
        $where = "($boardsWhere m.ID_MSG=t.ID_FIRST_MSG && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 1 && $userspec != '')
        $where = "($boardsWhere m.ID_MSG=t.ID_FIRST_MSG && m.posterName='$userspec' && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 2 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 2 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.posterName='$userspec' && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 3 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 3 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && m.posterName='$userspec' && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 4 && $userspec == '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER=-1 && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else if ($userkind == 4 && $userspec != '')
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER=-1 && m.posterName='$userspec' && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";
     else
        $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && $searchcrit && m.posterTime <= $mintime && m.posterTime > $maxtime)";

not much  :) .. but it took me a while to figure out the best method.

cheer
Logged

Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:[Beta 1.5.2] Search Enhance
« Reply #1 on: June 11, 2003, 03:09:13 PM »
Reply with quote

Any chance of making this able to search by user?  Right now you can search by user but you must provide a search string..  I want to be able to search, for instance, for all threads started by a user.  Any idea how to do that?

Thanks for the mod by the way.  Great work.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
Zulu
Full Member
***
Posts: 104


I'm no longer a llama, I'm a Monkey

WWW
Re:[Beta 1.5.2] Search Enhance
« Reply #2 on: June 11, 2003, 08:20:04 PM »
Reply with quote

Quote from: Shadow's Pawn on June 11, 2003, 03:09:13 PM
Any chance of making this able to search by user?  Right now you can search by user but you must provide a search string..  I want to be able to search, for instance, for all threads started by a user.  Any idea how to do that?

Thanks for the mod by the way.  Great work.

go to their profile, and select if you want to see 10.25,50 or all of their posts.
Logged

Webby @ RFI
Formerly known as PtPazuzu
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:[Beta 1.5.2] Search Enhance
« Reply #3 on: June 12, 2003, 01:05:42 AM »
Reply with quote

I know that, but I want to search for only those threads *started* by that user.. not all posts by the user.  Essentially what I want is to create a "user archive" using the search option.  If I get enough spare time to learn php, I might tackle this myself.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
shy hamster
Noobie
*
Posts: 16


I'm a llama!

Re:[Beta 1.5.2] Search Enhance
« Reply #4 on: June 15, 2003, 05:39:05 PM »
Reply with quote

Quote from: A.M.A. on May 21, 2003, 08:34:30 AM
What is it:
This mod will enhance the search capability for displaying accurate results. Now you can search for strings in Subject only or in Message only or in both of them.

Hello A.M.A.

I have been having trouble getting YaBBSE search function to retrieve relevant results - e.g. if I search for "ion", I will get "ignition", "lion" etc. In short, the search function does not "match whole words only".

Does your mod solve this problem?

Thanks.

Shy Hamster
Logged
A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.2] Search Enhance
« Reply #5 on: June 15, 2003, 06:55:31 PM »
Reply with quote

The search will return both words "ion" and "ignition".
« Last Edit: June 15, 2003, 06:58:24 PM by A.M.A. » Logged

Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[Beta 1.5.2] Search Enhance
« Reply #6 on: July 11, 2003, 04:10:51 PM »
Reply with quote

i thought i gave u the code already, shy hamster
search match whole word

i want to make a better version of it when i have the time
probably using pattern matching like: '^ion %' and '% ion(.|!|?|,| )%' (note the spaces)
so it can also check if ion is in the beginning of a sentence, or at the end
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.2] Search Enhance « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.068 seconds with 21 queries.