Limit categories? Limit categories?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Limit categories?

Started by Tilbo, December 16, 2006, 08:16:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tilbo

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?



vuud

Quote from: 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?

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

Please post a link to your forum also


Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Tilbo

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

Tilbo

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);
}


vuud

Quote from: 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

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?



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Tilbo

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


vuud

#6
Quote from: Tilbo on December 30, 2006, 09:07:25 AM
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...





Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

Quote from: Tilbo on December 30, 2006, 09:07:25 AM
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



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

Quote from: Tilbo on December 30, 2006, 09:07:25 AM
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
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Tilbo

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