Welcome, Guest. Please Login or Register.
May 13, 2025, 06:07:39 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Search by Subject or Message « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Search by Subject or Message  (Read 560 times)
A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Search by Subject or Message
« on: May 18, 2003, 11:20:24 PM »
Reply with quote

Is this the best way to make "search" do a specific search by subject,  message or both of them:
Quoteelse if ($userkind == 3 && $userspec == '' && $searchsubject == 'on' && $searchmessage == 'on')
  $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 != '' && $searchsubject == 'on' && $searchmessage == 'on')
  $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 == 3 && $userspec == '' && $searchsubject == 'on')
  $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && (INSTR(LOWER(m.subject),'$query') ) && m.posterTime <= $mintime && m.posterTime > $maxtime)";

else if ($userkind == 3 && $userspec == '' && $searchmessage == 'on')
  $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && (INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";


else if ($userkind == 3 && $userspec != '' && $searchsubject == 'on')
  $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && m.posterName='$userspec' && (INSTR(LOWER(m.subject),'$query') ) && m.posterTime <= $mintime && m.posterTime > $maxtime)";

else if ($userkind == 3 && $userspec != '' && $searchmessage == 'on')
  $where = "($boardsWhere m.ID_TOPIC=t.ID_TOPIC && m.ID_MEMBER != -1 && m.posterName='$userspec' && (INSTR(LOWER(m.body),'$query')) && m.posterTime <= $mintime && m.posterTime > $maxtime)";
or there is a better way for reducing those IF statements!

cheer
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Search by Subject or Message
« Reply #1 on: May 18, 2003, 11:58:10 PM »
Reply with quote

HAHA!  Yes, I've redone that hole mess....

-[Unknown]
Logged
A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:Search by Subject or Message
« Reply #2 on: May 19, 2003, 12:07:00 AM »
Reply with quote

Quote from: [Unknown] on May 18, 2003, 11:58:10 PM
HAHA!  Yes, I've redone that hole mess....

-[Unknown]
You mean in your SP ... am planning on releasing a mod to make search functions better, but I still think this is not the right way  :-\

cheer
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:Search by Subject or Message
« Reply #3 on: May 20, 2003, 11:16:38 AM »
Reply with quote

may be if I make the fields as a variable , will be better.


cheer
Logged

Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:Search by Subject or Message
« Reply #4 on: May 21, 2003, 06:11:45 PM »
Reply with quote

you mean adding the option of searching in subject and/or message? isn't that option in Advanced Search already?

or you mean the way the script does it is not very good and it can be better?
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Search by Subject or Message « 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.059 seconds with 21 queries.