coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: tinorebel on September 24, 2009, 09:04:49 PM

Title: Using a variable "keyword" in cpgfetch
Post by: tinorebel on September 24, 2009, 09:04:49 PM
Hallo.
I'm using cpgfetch to display random and last images from my gallery.
Everything works fine.

I suppose it's possible to create a text field on a page which recovers the keyword and send it to a page displaying the pictures matching the keyword.
I coud not find any help in the forum, my knowledge of php is very little, I would appreciate a little help from someone.
I tryed to do it myself but after many hours without resoults I gave up.

I suppose shoudl be something like


$USER['search'] = array('search' => $_GET['search']);
$objCpm->cpm_viewRandomMediaFrom("keyword=$_GET['search']", 2,4, $options);


Thanks for any help on this ;)
Title: Re: Using a variable "keyword" in cpgfetch
Post by: freesouljah on September 25, 2009, 02:06:50 AM
look for query string url:

http://whn.vdhri.net/2005/10/how_to_use_the_query_string_in_php.html

;)
Title: Re: Using a variable "keyword" in cpgfetch
Post by: tinorebel on September 25, 2009, 06:23:05 PM
Thanks freesouljah , it's right what i was looking for....  ;D ;D ;D

I did it this way:
Created a new page called "searchextra.php" and filled it with the following code:

  <form id="form1" name="form1" method="get" action="searchextra.php">
        <label>
        <div align="left">
          <input type="text" name="word" id="word" />
        </div>
        </label>
        <label>
        <div align="left">
          <input type="submit" name="ok" id="ok" value="Enviar" />
        </div>
        </label>
                              <label>
                              <div align="left">Imagesize:
                                <select name="size" id="size">
                                  <option value="thumb">thumb</option>
                                  <option value="orig">full</option>
                                  <option value="mini">mini</option>
                                </select>
                              </div>
                              </label>
      </form>
      <div align="center" class="style1">
        <p align="center">
         


I created a dropdown menu with opion to display thumbs or fullsize resoults.
So now we have a page to make a search with posibility to choose to see resoults in thumb or original size.
(I alsaw added minithumbs, because I have stramm mod, but to do this you have to modifye cpgfetch.php and cpgfetch_dao.php before.