coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: ondi on June 03, 2008, 12:17:41 PM

Title: Fatal error when trying to use random image
Post by: ondi on June 03, 2008, 12:17:41 PM
I get this error: Fatal error: Class 'cpm' not found in /home/fhlinux222/w/walthamforest-fc.co.uk/user/htdocs/photogallery/cpmfetch/random.php on line 3

here is the code in my random.php

<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


Anyone got any ideas?
Title: Re: Fatal error when trying to use random image
Post by: fangweile on June 03, 2008, 01:36:46 PM
Your code is just right. I used it also in my site.

Dunno what is wrong but have you tried to reupload the cpmfetch package and install it again. I think it will solved your error.
Title: Re: Fatal error when trying to use random image
Post by: ondi on June 03, 2008, 02:42:51 PM
Yeh, tried repeatedly ???!
Title: Re: Fatal error when trying to use random image
Post by: capecodgal on June 11, 2008, 12:22:42 AM
Quote
I get this error: Fatal error: Class 'cpm' not found in /home/fhlinux222/w/walthamforest-fc.co.uk/user/htdocs/photogallery/cpmfetch/random.php on line 3



so that means that the random.php file is located inside of your cpmfetch folder which is inside of your photogallery folder, correct? And that file has the code that you posted within it?

Try this instead:


<?php
  
include "cpmfetch.php";
  
$objCpm = new cpm("cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>