Mini thumbs from stramm as dislay pictures Mini thumbs from stramm as dislay pictures
 

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]

Main Menu

Mini thumbs from stramm as dislay pictures

Started by Linosa, April 08, 2010, 09:47:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Linosa

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

SolidSnake2003

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();
?>


Linosa


nowordneeded

Quote from: SolidSnake2003 on April 08, 2010, 05:22:09 PM
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
Sometimes my musings are too confusing for someone not inside my head.

nowordneeded

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
Sometimes my musings are too confusing for someone not inside my head.