Using a variable "keyword" in cpgfetch Using a variable "keyword" in cpgfetch
 

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]

Main Menu

Using a variable "keyword" in cpgfetch

Started by tinorebel, September 24, 2009, 09:04:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tinorebel

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 ;)
Live long and prosper!
www.tripodart.net


tinorebel

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.

Live long and prosper!
www.tripodart.net