coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: MarkP on November 03, 2006, 05:15:45 PM

Title: Stumped
Post by: MarkP on November 03, 2006, 05:15:45 PM
I am trying to resize the size of the thumbnails displayed on my front page. My site: http://www.opshots.net

The code I am trying to use:
<?php 
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_formatStats("%<b>Our galleries hold %f photos in %c categories & %a albums having served %v views<br></b>");
print 
"Last photos uploaded:";
$styleguide = array("imagestyle" => "test1""linkstyle" => "test1","imagewidth" => "200","imageheight" => "200");
$objCpm->cpm_viewLastAddedMediaFromAlbum (1,3"cat=1,7,11,14,$styleguide");
print 
"Some Random photos:";
$objCpm->cpm_viewRandomMediaFromAlbum (1,3"cat=1,7,11,14,$styleguide");
$objCpm->cpm_close();
?>


Now everything works good except it does not set the size of the thumbnail at all. I must be missing something obvious
Title: Re: Stumped
Post by: vuud on November 03, 2006, 08:02:36 PM
Quote from: MarkP on November 03, 2006, 05:15:45 PM
I am trying to resize the size of the thumbnails displayed on my front page. My site: http://www.opshots.net

The code I am trying to use:
<?php 
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_formatStats("%<b>Our galleries hold %f photos in %c categories & %a albums having served %v views<br></b>");
print 
"Last photos uploaded:";
$styleguide = array("imagestyle" => "test1""linkstyle" => "test1","imagewidth" => "200","imageheight" => "200");
$objCpm->cpm_viewLastAddedMediaFromAlbum (1,3"cat=1,7,11,14,$styleguide");
print 
"Some Random photos:";
$objCpm->cpm_viewRandomMediaFromAlbum (1,3"cat=1,7,11,14,$styleguide");
$objCpm->cpm_close();
?>


Now everything works good except it does not set the size of the thumbnail at all. I must be missing something obvious


Take a close look at your function call... especially the part starting with "cat= .... through the ");

Hint: your attempting to combine two parameters into one... Your styleguide is being ignored.

Also, careful with forcing height AND width... if they are not perfectly square to start with, they will be distorted.  I'd choose one and not do the other...

Vuud

Title: Re: Stumped
Post by: MarkP on November 03, 2006, 11:03:11 PM
Thanks for pointing me to the right area....may I post the code that worked? If so here it is:

<?php 
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_formatStats("%<b>Our galleries hold %f photos in %c categories & %a albums having served %v views<br></b>");
print 
"Last photos uploaded:";
$options = array( 'imagewidth' => '120');
$objCpm->cpm_viewLastAddedMediafrom (1,3,"cat=1,7,11,14",$options);
$objCpm->cpm_close();
?>
Title: Re: Stumped
Post by: vuud on November 04, 2006, 01:45:35 AM
Quote from: MarkP on November 03, 2006, 11:03:11 PM
Thanks for pointing me to the right area....may I post the code that worked? If so here it is:

<?php 
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_formatStats("%<b>Our galleries hold %f photos in %c categories & %a albums having served %v views<br></b>");
print 
"Last photos uploaded:";
$options = array( 'imagewidth' => '120');
$objCpm->cpm_viewLastAddedMediafrom (1,3,"cat=1,7,11,14",$options);
$objCpm->cpm_close();
?>


Excellent!