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: Mini thumbs from stramm as dislay pictures  (Read 5417 times)

0 Members and 1 Guest are viewing this topic.

Linosa

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Mini thumbs from stramm as dislay pictures
« 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
Logged

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Re: Mini thumbs from stramm as dislay pictures
« Reply #1 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();
?>
Logged

Linosa

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Mini thumbs from stramm as dislay pictures
« Reply #2 on: April 09, 2010, 03:58:28 pm »

Thank you. It finally worked out!
Logged

nowordneeded

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 224
Re: Mini thumbs from stramm as dislay pictures
« Reply #3 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
Logged
Sometimes my musings are too confusing for someone not inside my head.

nowordneeded

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 224
Re: Mini thumbs from stramm as dislay pictures
« Reply #4 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
Logged
Sometimes my musings are too confusing for someone not inside my head.
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.