adding a search again under search results page adding a search again under search results page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

adding a search again under search results page

Started by adeibiza, March 03, 2011, 02:19:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adeibiza

i know someone could simply go to the "search" link again but i'm always looking for ways to decrease user clicks

i cant find where i can could add in custom text/keyword tag cloud/search form etc or whatever in the search results page

this is especially useful if there are no results

(www.gig-ticket.com)

Αndré

Where do you want to display the new search form? What exactly should be displayed?

adeibiza

under the search results :)

i'm assuming if i can find the block that builds i (the results) i can put either custom text or ideally the search form again etc ?

for example if a search result returns a ton of results its not so bad but if its only  say one line then having the search form under would make it more likely for someone to search again rather than giving up

Αndré

Open thumbnails.php, find
display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
and below, add
    if ($album == 'search') {
        // copy code from search.php or your own search form to this location
    }

adeibiza

fantastic - perfecto :)

a week in and i'm starting to get the hang of this now - thx

Αndré

Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.

Walkinman

Hey André

I have a question relating exactly to this one; I hope it's not considered a separate question, if so, I can start a new thread. I want to do exactly this, as above, but place the search box at the top of the results table, in the right hand side. The code of my 'Quick Search' is:


<!-- BEGIN breadcrumb -->
        <tr>
            <td colspan="4" align="left" class="tableh1">
                <span class="statlink">{BREADCRUMB}</span>
            </td>

<td align="right" valign="middle" class="tableh1">
<form method="get" action="http://www.skolaiimages.com/stock/thumbnails.php" name="searchcpg" style="margin:0px;padding:0px">



            <input type="hidden" name="album" value="search" />



            <input type="hidden" name="type" value="full" />



            <input type="text" style="height:95%; border:2px #808080 outset; width: 140px" name="search" maxlength="255" value="" class="textinput" />



            <input style="height:95%; width:95px; border:2px #0c0c0c0 inset; font:12px Verdana,Arial; color:#000000; background:#FFFFFF" type="submit" value="Quick Search" />



          </form>


       


</td>

        </tr>
<!-- END breadcrumb -->


But I don't know how to place it here
if ($album == 'search') {
        // copy code from search.php or your own search form to this location
    }

without getting a syntax error. And that will place it at the bottom of the page, I suspect, no?

Here's a sample]=http://skolaiimages.com/stock_1.5/thumbnails.php?search=blackburn&submit=search&album=search&title=on&newer_than=&caption=on&older_than=&keywords=on&filename=on&type=AND]Here's a sample

the top of the table says "Image search results -"blackburn". Directly in alignment with that, but over to the right hand side of the page, I'd like to have the Quick Search button - I have it in the breadcrumb on most other Pages.

Is this possible?

Thank you.

Cheers

Carl

Αndré

If you want to print something, you have to use some command like echo or print. I assume your syntax error was something like 'unexpected string at line xyz', so put your code between
echo <<<EOT
and
EOT;

Walkinman

Hey Andre

Thank you for your patience. I still get a syntax error:

Parse error: syntax error, unexpected $end in
here's the code I put in to the thumbnail.php.


display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
if ($album == 'search') {
        // copy code from search.php or your own search form to this location

echo <<<EOT
<table>
<tr>
<td align="right" valign="middle" class="tableh1">
<form method="get" action="http://www.skolaiimages.com/stock/thumbnails.php" name="searchcpg" style="margin:0px;padding:0px">



            <input type="hidden" name="album" value="search" />



            <input type="hidden" name="type" value="full" />



            <input type="text" style="height:95%; border:2px #808080 outset; width: 140px" name="search" maxlength="255" value="" class="textinput" />



            <input style="height:95%; width:95px; border:2px #0c0c0c0 inset; font:12px Verdana,Arial; color:#000000; background:#FFFFFF" type="submit" value="Quick Search" />



          </form>


       


</td>
</tr>
</table>
EOT;
    }



I'm prolly doing something stupid. Thanks again for your help.

Cheers

Carl

Αndré

Change
EOT;
to
EOT;

It's important that there's no white-space before the closing tag.

Walkinman

Hey André

Ahh, thanks. That got rid of the error.

I hate to be too painful, but the search box is displayed under the thumbnails table. See it here;

Is it possible, without too much trouble, to display it inside the thumbnail table, on the upper right hand side? Where it says 'Image Search results  - "bears yukon", I'd like the search box to appear aligned with that, but on the right hand side of the page. Or, if that's too weird and complicated, just move it so the search results box appears before the thumbnails table.

Thanks so much, I appreciate your help.

Cheers

Carl

Walkinman

Hey André

Fixed it. Thanks, now I'm getting another error, but I'll start a new thread about that. For anyone else having this concern I just moved this code

// copy code from search.php or your own search form to this location

echo <<<EOT
<table>
<tr>
<td align="right" valign="middle" class="tableh1">
<form method="get" action="http://www.skolaiimages.com/stock/thumbnails.php" name="searchcpg" style="margin:0px;padding:0px">



            <input type="hidden" name="album" value="search" />



            <input type="hidden" name="type" value="full" />



            <input type="text" style="height:95%; border:2px #808080 outset; width: 140px" name="search" maxlength="255" value="" class="textinput" />



            <input style="height:95%; width:95px; border:2px #0c0c0c0 inset; font:12px Verdana,Arial; color:#000000; background:#FFFFFF" type="submit" value="Quick Search" />



          </form>


       


</td>
</tr>
</table>
EOT;
}


and moved it above this:

{
    display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);



}


The Quick Search section now appears above the thumbnails and I aligned it to the right side of the page. Not perfect (I wanted it inside the thumbnail table), but it's as close as it needs to be for mu purposes. Of course, now I can't get that search function to work with cpg 1.5.12.

Cheers

Carl