coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Cove on May 13, 2008, 09:54:31 PM

Title: [Solved]: Cpmfetch doesn't work, need help
Post by: Cove on May 13, 2008, 09:54:31 PM
Hi, everybody. I have the following trouble:
Code:
<?php
  
include "http://forum.hromov.net/photo/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("http://forum.hromov.net/photo/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>

Error:
Fatal error: Cannot instantiate non-existent class: cpm in /usr/home/cove/domains/hromov.net/public_html/forum/cpmfetch.php on line 3

All pathes are right. I really don't understand, what is the reason of this trouble. When i run cpmfetch install.php i see the images, located in my gallery and when i click them, i go to the right page. Can anybody help me to solve this problem?

System:
CPG - v1.4.18;
Copperminefetch - 2.0.0;
CPG Integration -  vBulletin 3.6.4;
Server -  FreeBSD 6.2 and Apache/1.3.34;
PHP -4.3.11;
MySQL - 4.1.14.

Title: Re: Cpmfetch doesn't work, need help
Post by: Nibbler on May 13, 2008, 09:56:23 PM
Use a path not an URL.
Title: Re: Cpmfetch doesn't work, need help
Post by: Cove on May 13, 2008, 10:10:15 PM
Quote from: Nibbler on May 13, 2008, 09:56:23 PM
Use a path not an URL.
Thanks's a lot, now all works perfect!
p.s. If it's to be fair, i don't understand why an URL doesn't work  :'(
Title: Re: Cpmfetch doesn't work, need help
Post by: Nibbler on May 13, 2008, 10:40:43 PM
If you use an URL PHP will see the same thing you see if you go to the URL with your browser; a blank page. You need PHP to load the source code of the file instead so you have to use a path.
Title: Re: Cpmfetch doesn't work, need help
Post by: Cove on May 13, 2008, 10:42:43 PM
Quote from: Nibbler on May 13, 2008, 10:40:43 PM
If you use an URL PHP will see the same thing you see if you go to the URL with your browser; a blank page. You need PHP to load the source code of the file instead so you have to use a path.
Ok, i understand, thanks.
But now i have another one trouble (all pathes are right at this time) with the code from Cpgfetch documentation, which makes a random images representation:
Code

<?php
  
include_once "photo/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("photo/cpmfetch/cpmfetch_config.php");
  
$options = array(?subtitle? => ?File name : {{pFilename}}?);
  
$objCpm->cpm_viewLastAddedMedia(14$options);
  
$objCpm->cpm_viewRandomMediaFrom(?cat=1?,14$options);
  
$objCpm->cpm_close();
?>


Error:
Parse error: parse error, unexpected '?', expecting ')' in /usr/home/cove/domains/hromov.net/public_html/forum/cpmfetch.php on line 18
Title: Re: [Solved]: Cpmfetch doesn't work, need help
Post by: Nibbler on May 13, 2008, 10:50:08 PM
Change all the question marks to quotes, ie.


<?php
  
include_once "photo/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("photo/cpmfetch/cpmfetch_config.php");
  
$options = array('subtitle' => 'File name : {{pFilename}}');
  
$objCpm->cpm_viewLastAddedMedia(14$options);
  
$objCpm->cpm_viewRandomMediaFrom('cat=1',14$options);
  
$objCpm->cpm_close();
?>



Please try to keep to one issue per thread; it's the rule.
Title: Re: [Solved]: Cpmfetch doesn't work, need help
Post by: Cove on May 14, 2008, 07:46:02 AM
Quote from: Nibbler on May 13, 2008, 10:50:08 PM
Please try to keep to one issue per thread; it's the rule.
Ok. It seems to me that i've solved all my problems now. Thank you very much!