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: Using a variable "keyword" in cpgfetch  (Read 3550 times)

0 Members and 1 Guest are viewing this topic.

tinorebel

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 87
  • live long and prosper!
    • www.tripodart.net
Using a variable "keyword" in cpgfetch
« 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

Code: [Select]

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

Thanks for any help on this ;)
Logged
Live long and prosper!
www.tripodart.net

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Using a variable "keyword" in cpgfetch
« Reply #1 on: September 25, 2009, 02:06:50 am »

tinorebel

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 87
  • live long and prosper!
    • www.tripodart.net
Re: Using a variable "keyword" in cpgfetch
« Reply #2 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:

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

Logged
Live long and prosper!
www.tripodart.net
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.