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
Sorry. did not knew that bold doesnt work in code, could you fix this please. thanks.
Done.
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.
;)
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.
Oh thanks fangweile, I thought random from category does not work. Very good!
Sorry, I use 2.0.0 and there this code works:
$objCpm-> cpm_viewRandomMediaFrom ("cat=4", 1, 2, $options);