coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: davec on September 05, 2006, 06:13:16 PM

Title: Simple Search Box
Post by: davec on September 05, 2006, 06:13:16 PM
I have a client who would just like the simple search facility as in earleir versions of Coppermine. I have tried to find a solution on the forum but to no avail. Any suggestions appreciated. I am on 1.48 by the way.

Dave  ???
Title: Re: Simple Search Box
Post by: Joachim Müller on September 05, 2006, 07:19:47 PM
You're welcome to edit the search page and hide the additional input fields and checkboxes. Change them from "text" or "checkbox" to "hidden". Remove the surplus descriptive text and you're fine. Another option would be hiding the "surplus" fields using CSS attributes. Edit search.php, find        <tr>
            <td class="tableb" align="center" >
                <input type="text" style="width: 80%" name="search" maxlength="255" value="" class="textinput" />
                <input type="submit" value="{$lang_search_php['submit_search']}" class="button" />
                <input type="hidden" name="album" value="search" />
            </td>
        </tr>
and add after it (into a new line)<div style="display:none">
Then find                                        </tr>
                                                $customs
                                                $ip
                                </table>
                        </td>
                </tr>
and after it (into a new line)</div>

Haven't tested this, but should work as expected. Please report.
Title: Re: Simple Search Box
Post by: davec on September 06, 2006, 12:11:34 PM
Thanks for your help. The first part I put in as below

<input type="text" style="width: 80%" name="search" maxlength="255" value="" class="textinput" />
                <input type="submit" value="{$lang_search_php['submit_search']}" class="button" />
                <input type="hidden" name="album" value="search" />

            </td>
        </tr>
                <tr>
                        <td class="tableb"> <div style="display:none">
                                <table align="center" width="60%">

then the closing tag was placed as below. All seems to work well

</tr>
                                                $customs
                                                $ip
                                </table>
</div>
                        </td>

                </tr>

Dave  ;D
Title: Re: Simple Search Box
Post by: davec on September 06, 2006, 05:21:46 PM
Manged to modify the page as above thanks. Now have a second issue. On the site when a specific word is entered ie red, a host on non related images are also displayed. Client informs me that it didn't used to happen in the earler version they were using. It is only since we upgraded to 1.48. Any suggestions

Dave  :-\
Title: Re: Simple Search Box
Post by: Nibbler on September 06, 2006, 05:26:43 PM
include/search.inc.php, review the default search fields


if (!isset($USER['search']['params'])){
        $USER['search']['params']['title'] = $USER['search']['params']['caption'] = $USER['search']['params']['keywords'] = $USER['search']['params']['filename'] = 1;
}


Default is to search by title, caption, keywords, filename. Remove any that you do not wish to search by.
Title: Re: Simple Search Box
Post by: davec on September 06, 2006, 08:11:23 PM
Thanks for that I will give it a go. What was the search parammeter in earlier versions by the way?

Dave  :)
Title: Re: Simple Search Box
Post by: Nibbler on September 06, 2006, 08:15:09 PM
I think filename is new. Depends what previous version you were running.
Title: Re: Simple Search Box
Post by: davec on September 07, 2006, 09:05:50 AM
Originally started with 1.31 I believe and then did two upgrades over time. I will add and delete the various parameters and see what happens! Will keep you posted.

Dave  :)
Title: Re: Simple Search Box
Post by: davec on September 07, 2006, 09:26:28 AM
Had a play with the parameters and doesn't seem to make any difference.  If you go to http://www.weddingflowersonline.co.uk/gallery/index.php (http://www.weddingflowersonline.co.uk/gallery/index.php) and type in red for instance it brings up pages which have no reference to that colour anywhere. Any ideas ?  ???

Dave
Title: Re: Simple Search Box
Post by: Nibbler on September 07, 2006, 12:11:34 PM
Brings up wired, obscured, pictured, ... all of which contain the word red. If you want exact word searches then try seaching the board.