xoops forums

wcrwcr

Home away from home
Posted on: 2005/5/29 4:03
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#1

Wordbook v1.15 beta - Search results

Hi all

First of all i?d like to thanks hsalazar and mondarse for continuing the development of such great module

I?ve found a typo when trying to seach for terms and definitions using the XOOPS search feature.

I can?t get any results besides the term.
It seems that it can?t search on the definitions field.

Searching with the own wordbooks? search engine I can find the results that are expected with a nice yellow highlight(great feature ) but, I can?t see an image I?m using on the definition?s field. Even with html tags and XOOPS codes unabled.

Another point I got a kind of wierd html tag, like that:

<forbiddenforbidden>some definition?s text<forbidden/forbiddenbforbidden>

in the place where is supposed to be a < b > tag.

i guess the problem/solution is in the "include/cleantags.php" file but on line 6 I found:
$allowedTags '<h1><b><i><a><ul><li><pre><hr><blockquote>';


Also tried to put the < img > tag on that line But I only got a lot of <forbiddenforbidden> and a really messed layout.

I?m pretty lost

Any tip or quick fix?

Thanks

wcrwcr

Home away from home
Posted on: 2005/5/29 19:17
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#2

Re: Wordbook v1.15 beta - Search results

Hi

A little bump

Thanks

wcrwcr

Home away from home
Posted on: 2005/5/30 16:42
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#3

Re: Wordbook v1.15 beta - Search results

To the admins
I moved this thread to:
https://xoops.org/modules/news/article ... flat&com_order=0&start=20

Please, if you like erase the above posts, since I can?t do It.
PLease, don?t consider It as a cross posting, I just got the feeling of posting in a wrong place.

Thanks & maybe sorry

hsalazar

Just popping in
Posted on: 2005/6/4 4:05
hsalazar
hsalazar (Show more)
Just popping in
Posts: 78
Since: 2003/2/6 1
#4

Re: Wordbook v1.15 beta - Search results

wcrwcr:

Here's a quick fix for the search problem.

Open file include/search.inc.php. Look for line 27; it includes a query string, but it has a bug. Wher it says:
OR definition LIKE OR ref LIKE

it should really say
OR definition LIKE '%$queryarray[0]%' OR ref LIKE


Then go for line 31. Likewise, it says
OR definition OR ref LIKE

and it should say
OR definition LIKE '%$queryarray[$i]%' OR ref LIKE


I'll be back with the other matter...

Cheers.

wcrwcr

Home away from home
Posted on: 2005/6/4 17:03
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#5

Re: Wordbook v1.15 beta - Search results

Hey hsalazar

Thank you to point me that
However after the modifications sugested I still can?t obtain the results expected.

After looking the code I guess that a '%$queryarray[0]%' right after the OR ref LIKE was missing. And of course at the line 31, too.

So I did it and now we can search through XOOPS search function too

From line 22 to line 33 now we have:

// because count() returns 1 even if a supplied variable
    // is not an array, we must check if $querryarray is really an array
    
$count count$queryarray );
    if ( 
$count && is_array$queryarray ) )
        {
        
$sql .= "AND ((term LIKE '%$queryarray[0]%' OR definition LIKE '%$queryarray[0]%' OR ref LIKE '%$queryarray[0]%')";
        for ( 
$i 1$i $count$i++ )
            {
            
$sql .= $andor ";
            
$sql .= "(term LIKE '%$queryarray[$i]%' OR definition LIKE '%$queryarray[$i]%' OR ref LIKE '%$queryarray[$i]%')";
            } 
        
$sql .= ") ";


BTW >As my avatar sugests I?m a curious monkey and not a coder so in order to get the results I did a look in other module that uses the same kind of function and used the same logic

Thanks a lot to point me that. Without your tip I guess I?ll search for a whole year

Now lets find the image and <forbidden> tag troubles.

Saludos de Brasil

wcrwcr

Home away from home
Posted on: 2005/6/8 18:22
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#6

Re: Wordbook v1.15 beta - Search results

Hola Salazar

Quote:


I'll be back with the other matter...

Cheers.


Still waiting for you

Thanks

wcrwcr

Home away from home
Posted on: 2005/6/13 14:40
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#7

Re: Wordbook v1.15 beta - Search results

Just A little bump

wcrwcr

Home away from home
Posted on: 2005/6/15 20:37
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#8

Re: Wordbook v1.15 beta - Search results

Horacio

Where have you been?
Don?t let us like orphans

Thank you

wcrwcr

Home away from home
Posted on: 2005/6/19 18:20
wcrwcr
wcrwcr (Show more)
Home away from home
Posts: 1114
Since: 2003/12/12
#9

Re: Wordbook v1.15 beta - Search results

HI
Another really little bump

hsalazar

Just popping in
Posted on: 2005/6/19 18:31
hsalazar
hsalazar (Show more)
Just popping in
Posts: 78
Since: 2003/2/6 1
#10

Re: Wordbook v1.15 beta - Search results

wcrwcr:

Sorry for the absence. I've taken a look to the whole mess about that cleantags matter. This was supposed to filter the output so that only selected HTML tags would be used. What for? I decided when building the index interface that images wouldn't be allowed, because having no control over their size, they'd break the carefully arranged blocks by altering the width of the random term block.

What I mean with this is at first I didn't remember all this, so I thought it would be easy to get rid of the problem. It's not. I think I'll use a different filtering scheme, so I'll have to delve deeper into the code. It'll take some more time.

Cheers.