forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Tilbo on December 16, 2006, 08:16:55 pm

Title: Limit categories?
Post by: Tilbo on December 16, 2006, 08:16:55 pm
I've made a small module to show some images from a specific categorie, cat=10

I'm using cpmfetch (1.9.4) on a joomlaportal. The module looks like this:
Code: [Select]
<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
include_once 
"./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('path_to/gallery/cpmfetch/cpmfetch_config.php');
$objCpm->cpm_viewRandomMediaFromCategory(1,2,10);
//$objCpm->cpm_close(); 
?>
The problem is that all the categories till cat=10 returning images but cat 10 and up not!! It's strange!
I've tryed to look what's causing this but it's weird and frustrating!
Who has a clue?


Title: Re: Limit categories?
Post by: vuud on December 18, 2006, 08:40:41 pm
I've made a small module to show some images from a specific categorie, cat=10

I'm using cpmfetch (1.9.4) on a joomlaportal. The module looks like this:
Code: [Select]
<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
include_once 
"./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('path_to/gallery/cpmfetch/cpmfetch_config.php');
$objCpm->cpm_viewRandomMediaFromCategory(1,2,10);
//$objCpm->cpm_close(); 
?>
The problem is that all the categories till cat=10 returning images but cat 10 and up not!! It's strange!
I've tryed to look what's causing this but it's weird and frustrating!
Who has a clue?

So you get nothing back when you do the above call?

Please post a link to your forum also


Title: Re: Limit categories?
Post by: Tilbo on December 19, 2006, 06:43:07 pm
Nope, I ve edit the parameter yet to cat=6! But I want only to show images from cat=10. If I change it to cat=10 nothing turns up!
http://www.tilbo.com/index.php?option=com_content&task=blogsection&id=6&Itemid=119
Title: Re: Limit categories?
Post by: Tilbo on December 29, 2006, 12:00:07 pm
Installed 1.95 dev
All cat's work fine until cat 9, 10 and up give an error on line 903 in cpmfetch_dao.php

Code: [Select]
function addPathInfo($data) {

if (array_key_exists('pFilename',$data[0])) {
$newdata = array();
foreach ($data as $row) {
$row['fullPathToThumb']  = $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,$this->cfg['thumb_pfx']);
$row['fullPathToNormal'] =  $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,$this->cfg['normal_pfx']);
$row['fullPathToFull']   = $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,"");
array_push($newdata,$row);
}
} else {
$newdata = $data;
}

return($newdata);
}

Title: Re: Limit categories?
Post by: vuud on December 30, 2006, 06:13:07 am
Installed 1.95 dev
All cat's work fine until cat 9, 10 and up give an error on line 903 in cpmfetch_dao.php

Code: [Select]
function addPathInfo($data) {

if (array_key_exists('pFilename',$data[0])) {
$newdata = array();
foreach ($data as $row) {
$row['fullPathToThumb']  = $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,$this->cfg['thumb_pfx']);
$row['fullPathToNormal'] =  $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,$this->cfg['normal_pfx']);
$row['fullPathToFull']   = $this->getImageToUse($row['pFilepath'], $row['pFilename'] ,"");
array_push($newdata,$row);
}
} else {
$newdata = $data;
}

return($newdata);
}



And the error was?  Please paste the exact code.

This is like calling an auto mechanic and saying my engine makes a wierd noise, how do I fix it?



Title: Re: Limit categories?
Post by: Tilbo on December 30, 2006, 09:07:25 am
Your right, sorry  :-[
This is the errorcode:
Code: [Select]
Warning: array_key_exists(): The second argument should be either an array or an object in /****/****/*****/****.***/public_html/gallery/cpmfetch/cpmfetch_dao.php on line 903
Title: Re: Limit categories?
Post by: vuud on December 30, 2006, 05:07:48 pm
Your right, sorry  :-[
This is the errorcode:
Code: [Select]
Warning: array_key_exists(): The second argument should be either an array or an object in /****/****/*****/****.***/public_html/gallery/cpmfetch/cpmfetch_dao.php on line 903


Change line 903 to this:

Code: [Select]
if (is_array($data) && array_key_exists('pFilename',$data[0])) {
For some reason, the cat=10 is not returning any results...  The change will make the error go away - but I am not sure why you are not getting any data back...





Title: Re: Limit categories?
Post by: vuud on December 30, 2006, 05:10:21 pm
Your right, sorry  :-[
This is the errorcode:
Code: [Select]
Warning: array_key_exists(): The second argument should be either an array or an object in /****/****/*****/****.***/public_html/gallery/cpmfetch/cpmfetch_dao.php on line 903



Wait... Your bridged eh...

In your cpmfetch.inc.php file find the line that says:

'cfBridgedTo' => false

and change it to

'cfBridgedTo' => true



Title: Re: Limit categories?
Post by: vuud on December 30, 2006, 06:30:15 pm
Your right, sorry  :-[
This is the errorcode:
Code: [Select]
Warning: array_key_exists(): The second argument should be either an array or an object in /****/****/*****/****.***/public_html/gallery/cpmfetch/cpmfetch_dao.php on line 903



Can you please let me know if my other suggestions worked?

I tested it here against 1.4.10 and the category 10 works fine...

Vuud
Title: Re: Limit categories?
Post by: Tilbo on December 30, 2006, 07:14:35 pm
Hi Vuud,

Changing:
Code: [Select]
In your cpmfetch.inc.php file find the line that says:

'cfBridgedTo' => false

and change it to

'cfBridgedTo' => true

Is working perfect  ;D

Happy new year and thanks for your support  ;)