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
-
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:
<?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?
-
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:
<?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
-
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
-
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
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);
}
-
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
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?
-
Your right, sorry :-[
This is the errorcode:
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
-
Your right, sorry :-[
This is the errorcode:
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:
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...
-
Your right, sorry :-[
This is the errorcode:
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
-
Your right, sorry :-[
This is the errorcode:
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
-
Hi Vuud,
Changing:
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 ;)