Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: adding a search again under search results page  (Read 6495 times)

0 Members and 1 Guest are viewing this topic.

adeibiza

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
adding a search again under search results page
« on: March 03, 2011, 02:19:31 pm »

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)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: adding a search again under search results page
« Reply #1 on: March 03, 2011, 02:22:19 pm »

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

adeibiza

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: adding a search again under search results page
« Reply #2 on: March 03, 2011, 02:27:56 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: adding a search again under search results page
« Reply #3 on: March 03, 2011, 02:39:48 pm »

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

adeibiza

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: adding a search again under search results page
« Reply #4 on: March 03, 2011, 02:45:45 pm »

fantastic - perfecto :)

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: adding a search again under search results page
« Reply #5 on: March 03, 2011, 02:55:02 pm »

you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: adding a search again under search results page
« Reply #6 on: March 21, 2011, 04:13:49 am »

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:

Code: [Select]
<!-- 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
Code: [Select]
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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: adding a search again under search results page
« Reply #7 on: March 21, 2011, 09:22:52 am »

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
Code: [Select]
echo <<<EOTand
Code: [Select]
EOT;
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: adding a search again under search results page
« Reply #8 on: March 21, 2011, 10:11:08 am »

Hey Andre

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

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

Code: [Select]
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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: adding a search again under search results page
« Reply #9 on: March 21, 2011, 10:39:46 am »

Change
Code: [Select]
EOT;to
Code: [Select]
EOT;
It's important that there's no white-space before the closing tag.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: adding a search again under search results page
« Reply #10 on: March 21, 2011, 08:15:46 pm »

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
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: adding a search again under search results page
« Reply #11 on: March 23, 2011, 09:17:05 am »

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
Code: [Select]
// 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:
Code: [Select]
{
    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
Logged
Pages: [1]   Go Up
 

Page created in 0.073 seconds with 19 queries.