Fetch from category or album Fetch from category or album
 

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

Fetch from category or album

Started by dwo, June 25, 2008, 09:41:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dwo

Hello.

I really had a long time to figure this out. Mainly due to wrong description in the cpmfetch docs.
If you want to fetch from a album or category, you need to add "From"

$objCpm->cpm_viewLastAddedMediaFrom("cat=4", 2, 2, $options);  

Second, you need to write cat=4 or album=5 in " " Not in ?? like described in the docs.

reagrds, Dietmar

dwo

Sorry. did not knew that bold doesnt work in code, could you fix this please. thanks.

just_some_guy

Tambien, Hablo EspaƱol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

fangweile

I used this code to fetch images from certain album:

//cpmfetch code
echo "<CENTER>";
  include_once "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMediaFrom("album=55",2,6);
$objCpm->cpm_close();
echo "</CENTER>";


where 55 is album ID
2 no of rows of images to displays
6 no of columns of images to displays


For categories:

//cpmfetch code
echo "<CENTER>";
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");

  $objCpm-> cpm_viewRandomMediaFromCategory ( 1, 5, 3);
  $objCpm->cpm_close();
echo '</center>';


Where 1 is the category id.

;)
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

mauba

How can I do to display a pic from the three first album with their names above them.

The album must displayed in the horizotal position.

dwo

Oh thanks fangweile, I thought random from category does not work. Very good!

dwo

Sorry, I use 2.0.0 and there this code works:

$objCpm-> cpm_viewRandomMediaFrom ("cat=4", 1, 2, $options);