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

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

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