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
-
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
-
Ive made mine work with the mini thumbs
Open the file cpmfetch.php
find
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
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
function cpm_setMediaPrefixes( $_thumb, $_intermediate, $_large = "") {
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}
replace with
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
<?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();
?>
-
Thank you. It finally worked out!
-
Ive made mine work with the mini thumbs
Open the file cpmfetch.php
find
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
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
function cpm_setMediaPrefixes( $_thumb, $_intermediate, $_large = "") {
$this->cfg['thumb_pfx'] = $_thumb;
$this->cfg['normal_pfx'] = $_intermediate;
}
replace with
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
<?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
-
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