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: Stumped  (Read 4295 times)

0 Members and 1 Guest are viewing this topic.

MarkP

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Stumped
« 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:
Code: [Select]
<?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
« Last Edit: November 03, 2006, 08:02:48 pm by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Stumped
« Reply #1 on: November 03, 2006, 08:02:36 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:
Code: [Select]
<?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

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

MarkP

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Stumped
« Reply #2 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:

Code: [Select]
<?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();
?>
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Stumped
« Reply #3 on: November 04, 2006, 01:45:35 am »

Thanks for pointing me to the right area....may I post the code that worked? If so here it is:

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

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up
 

Page created in 0.04 seconds with 16 queries.