1
hdimantas
mxdirectory search
  • 2005/11/21 12:35

  • hdimantas

  • Just popping in

  • Posts: 9

  • Since: 2005/5/5 2


I installed the mxdirectory module and I realised that the search engine doesn't scan the module at all. only the title. Is it a bug? or a bad configuration?

[]s
hdhd

2
jfmoore
Re: mxdirectory search
  • 2005/11/21 18:02

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Quote:

hdimantas wrote:
I installed the mxdirectory module and I realised that the search engine doesn't scan the module at all. only the title. Is it a bug? or a bad configuration?


In my installation, it seems to search the title field but not the description field, and it is in the latter that you would put key words, etc. I asked a question somewhere about how to get it to search the description field, but I don't remember where. Wherever it was, it never got answered. Perhaps you will have better luck. IMO a search function which does not search the description field is nearly as useful as it should be.

Jere
...

3
gestroud
Re: mxdirectory search
  • 2005/11/21 19:03

  • gestroud

  • Home away from home

  • Posts: 1538

  • Since: 2004/12/22


Will the XOOGLE module work?

4
hdimantas
Re: mxdirectory search
  • 2005/11/22 11:50

  • hdimantas

  • Just popping in

  • Posts: 9

  • Since: 2005/5/5 2


probably is a bug 'cause the search feature works properly on the xdirectory module

[]s
hdhd

5
jfmoore
Re: mxdirectory search
  • 2005/11/22 15:46

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Quote:

hdimantas wrote:
probably is a bug 'cause the search feature works properly on the xdirectory module


That's good news, then, as someone should know how to fix it. Tripmon, perhaps. Maybe he, or someone else, will pitch in as to how. Or at least let us know that it's too hard to fix right now, and we'll have to wait for the next version.

Maybe Tripmon has been so quiet lately because he has been working on the next version. How about it, Tripmon? Should we expect a little something in our Christmas stockings this year?

Jere
...

6
hdimantas
Re: mxdirectory search
  • 2005/11/23 17:01

  • hdimantas

  • Just popping in

  • Posts: 9

  • Since: 2005/5/5 2


I have changed the /includes/search.inc.php and it works

"function xdir_search($queryarray, $andor, $limit, $offset, $userid){
global $xoopsDB;
$sql = "SELECT l.lid,l.cid,l.title,l.zip,l.address,l.address2,l.city,l.phone,l.email,l.submitter,l.date,t.description FROM ".$xoopsDB->prefix("xdir_links")." l LEFT JOIN ".$xoopsDB->prefix("xdir_text")." t ON t.lid=l.lid WHERE status>0";
if ( $userid != 0 ) {
$sql .= " AND l.submitter=".$userid." ";
}
// because count() returns 1 even if a supplied variable
// is not an array, we must check if $querryarray is really an array
if ( is_array($queryarray) && $count = count($queryarray) ) {
$sql .= " AND ((l.title LIKE '%$queryarray[0]%' OR l.address LIKE '%$queryarray[0]%' OR l.address2 LIKE '%$queryarray[0]%' OR l.zip LIKE '%$queryarray[0]%' OR l.city LIKE '%$queryarray[0]%' OR l.phone LIKE '%$queryarray[0]%' OR l.email LIKE '%$queryarray[0]%' OR t.description LIKE '%$queryarray[0]%')";
for($i=1;$i<$count;$i++){
$sql .= " $andor ";
$sql .= "(l.title LIKE '%$queryarray[$i]%' OR t.description LIKE '%$queryarray[$i]%')";
}
$sql .= ") ";
}
$sql .= "ORDER BY l.date DESC";
$result = $xoopsDB->query($sql,$limit,$offset);
$ret = array();
$i = 0;
while($myrow = $xoopsDB->fetchArray($result)){
$ret[$i]['image'] = "images/home.gif";
$ret[$i]['link'] = "singlelink.php?cid=".$myrow['cid']."&lid=".$myrow['lid']."";
$ret[$i]['title'] = $myrow['title'];
$ret[$i]['time'] = $myrow['date'];
$ret[$i]['uid'] = $myrow['submitter'];
$i++;
}
return $ret;
}
?>"

7
jfmoore
Re: mxdirectory search
  • 2005/11/23 19:27

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Quote:

hdimantas wrote:
I have changed the /includes/search.inc.php and it works


Great! Thanks for sharing.

Jere
...

Login

Who's Online

417 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 417


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits