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: [Solved]: Cpmfetch doesn't work, need help  (Read 6466 times)

0 Members and 1 Guest are viewing this topic.

Cove

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
[Solved]: Cpmfetch doesn't work, need help
« on: May 13, 2008, 09:54:31 pm »

Hi, everybody. I have the following trouble:
Code:
Code: [Select]
<?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.

« Last Edit: May 13, 2008, 10:41:03 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Cpmfetch doesn't work, need help
« Reply #1 on: May 13, 2008, 09:56:23 pm »

Use a path not an URL.
Logged

Cove

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: Cpmfetch doesn't work, need help
« Reply #2 on: May 13, 2008, 10:10:15 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  :'(
Logged

Nibbler

  • Guest
Re: Cpmfetch doesn't work, need help
« Reply #3 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.
Logged

Cove

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: Cpmfetch doesn't work, need help
« Reply #4 on: May 13, 2008, 10:42: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
Code: [Select]
<?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
Logged

Nibbler

  • Guest
Re: [Solved]: Cpmfetch doesn't work, need help
« Reply #5 on: May 13, 2008, 10:50:08 pm »

Change all the question marks to quotes, ie.

Code: [Select]
<?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.
Logged

Cove

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: [Solved]: Cpmfetch doesn't work, need help
« Reply #6 on: May 14, 2008, 07:46:02 am »

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!
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 16 queries.