forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Linosa on April 08, 2010, 09:47:06 am

Title: Mini thumbs from stramm as dislay pictures
Post by: Linosa on April 08, 2010, 09:47:06 am
Hi,

I've tried to get this work, but I can't figure out how.

I'm using cpmfetch and I wanna use my mini thumbs (from modpack stramm) as display pictures.
What shall I change to get this working?

Thanks // Lina
Title: Re: Mini thumbs from stramm as dislay pictures
Post by: SolidSnake2003 on April 08, 2010, 05:22:09 pm
Ive made mine work with the mini thumbs

Open the file cpmfetch.php

find
Code: [Select]
function getPrefixToUse() {

//$fileprefix=$this->defaultimagesize;
$fileprefix = "";

if (array_key_exists('imagesize',$this->optionHash)) {
if ($this->optionHash['imagesize'] == 'thumb') {
$fileprefix = $this->cfg['thumb_pfx'];
} elseif ($this->optionHash['imagesize'] =='int') {
$fileprefix = $this->cfg['normal_pfx'];
} elseif ($this->optionHash['imagesize'] == 'large') {
$fileprefix="";
}
}
elseif ($this->cfg['cfDefaultImageSize'] == "thumb") {
$fileprefix = $this->cfg['thumb_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "normal") {
$fileprefix = $this->cfg['normal_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "large") {
$fileprefix="";
}

return $fileprefix;
}

Replace with

Code: [Select]
function getPrefixToUse() {

//$fileprefix=$this->defaultimagesize;
$fileprefix = "";

if (array_key_exists('imagesize',$this->optionHash)) {
if ($this->optionHash['imagesize'] == 'mini') {
$fileprefix = $this->cfg['mini_pfx'];
} elseif ($this->optionHash['imagesize'] == 'thumb') {
$fileprefix = $this->cfg['thumb_pfx'];
} elseif ($this->optionHash['imagesize'] =='int') {
$fileprefix = $this->cfg['normal_pfx'];
} elseif ($this->optionHash['imagesize'] == 'large') {
$fileprefix="";
}
}
elseif ($this->cfg['cfDefaultImageSize'] == "mini") {
$fileprefix = $this->cfg['mini_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "thumb") {
$fileprefix = $this->cfg['thumb_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "normal") {
$fileprefix = $this->cfg['normal_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "large") {
$fileprefix="";
}

return $fileprefix;
}

Open the file cpmfetch_dao.php

find
Code: [Select]
function cpm_setMediaPrefixes( $_thumb, $_intermediate, $_large = "") {
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}

replace with
Code: [Select]
function cpm_setMediaPrefixes( $_mini, $_thumb, $_intermediate, $_large = "") {
$this->cfg['mini_pfx'] = $_mini;
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}

upload the changed files

Here is my include code

Code: [Select]
<?php
  
include "./gallery/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(2,4,array( "imagesize" => "mini" "imagestyle" => "gallery_home")); 
  
$objCpm->cpm_close();
?>
Title: Re: Mini thumbs from stramm as dislay pictures
Post by: Linosa on April 09, 2010, 03:58:28 pm
Thank you. It finally worked out!
Title: Re: Mini thumbs from stramm as dislay pictures
Post by: nowordneeded on June 23, 2010, 02:45:15 pm
Ive made mine work with the mini thumbs

Open the file cpmfetch.php

find
Code: [Select]
function getPrefixToUse() {

//$fileprefix=$this->defaultimagesize;
$fileprefix = "";

if (array_key_exists('imagesize',$this->optionHash)) {
if ($this->optionHash['imagesize'] == 'thumb') {
$fileprefix = $this->cfg['thumb_pfx'];
} elseif ($this->optionHash['imagesize'] =='int') {
$fileprefix = $this->cfg['normal_pfx'];
} elseif ($this->optionHash['imagesize'] == 'large') {
$fileprefix="";
}
}
elseif ($this->cfg['cfDefaultImageSize'] == "thumb") {
$fileprefix = $this->cfg['thumb_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "normal") {
$fileprefix = $this->cfg['normal_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "large") {
$fileprefix="";
}

return $fileprefix;
}

Replace with

Code: [Select]
function getPrefixToUse() {

//$fileprefix=$this->defaultimagesize;
$fileprefix = "";

if (array_key_exists('imagesize',$this->optionHash)) {
if ($this->optionHash['imagesize'] == 'mini') {
$fileprefix = $this->cfg['mini_pfx'];
} elseif ($this->optionHash['imagesize'] == 'thumb') {
$fileprefix = $this->cfg['thumb_pfx'];
} elseif ($this->optionHash['imagesize'] =='int') {
$fileprefix = $this->cfg['normal_pfx'];
} elseif ($this->optionHash['imagesize'] == 'large') {
$fileprefix="";
}
}
elseif ($this->cfg['cfDefaultImageSize'] == "mini") {
$fileprefix = $this->cfg['mini_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "thumb") {
$fileprefix = $this->cfg['thumb_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "normal") {
$fileprefix = $this->cfg['normal_pfx'];
}
elseif ($this->cfg['cfDefaultImageSize'] == "large") {
$fileprefix="";
}

return $fileprefix;
}

Open the file cpmfetch_dao.php

find
Code: [Select]
function cpm_setMediaPrefixes( $_thumb, $_intermediate, $_large = "") {
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}

replace with
Code: [Select]
function cpm_setMediaPrefixes( $_mini, $_thumb, $_intermediate, $_large = "") {
$this->cfg['mini_pfx'] = $_mini;
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}

upload the changed files

Here is my include code

Code: [Select]
<?php
  
include "./gallery/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(2,4,array( "imagesize" => "mini" "imagestyle" => "gallery_home")); 
  
$objCpm->cpm_close();
?>


I tried this fix for my gallery, but all I get on my site's homepage is: CF-Error CF-Error CF-Error CF-Error , and blank rectangles where the photos should be.

Gallery URL: http://nickchinlund.org/gallery
Homepage where error is: http://nickchinlund.org

Could you perhaps tell me what I did wrong?

NWN
Title: Re: Mini thumbs from stramm as dislay pictures
Post by: nowordneeded on June 24, 2010, 03:21:04 pm
Just to let you know, I've changed the location of the Cpmfetch code to this page: http://nickchinlund.org/zfile.php

This is due the fact that the code I used as per the mod instructions above, was messing up my homepage and shunting my right hand content over too far off the screen.

NWN