forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Naif on March 30, 2007, 10:53:47 pm
-
Hello
I have been trying to add the Example shown in the tutorial to a html page in my website, but I get some error messages when that page is loaded. I have made some research and tried to figure out what is wrong in the php code, but I'm still clueless... I did the Cpmtest and that was okay.
Here the php script I wrote:
<?php
include "/galeria/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galeria');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);
$objCpm->cpm_close();
?>
And these are the errors I receive: Warning: include(/galeria/cpmfetch/cpmfetch.php) [function.include]: failed to open stream: No such file or directory in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46
Warning: include() [function.include]: Failed opening '/galeria/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46
Fatal error: Class 'cpm' not found in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 47
My Coppermine gallery is installed in www.theothersize.com/galeria
-
Hello
I have been trying to add the Example shown in the tutorial to a html page in my website, but I get some error messages when that page is loaded. I have made some research and tried to figure out what is wrong in the php code, but I'm still clueless... I did the Cpmtest and that was okay.
Here the php script I wrote:
<?php
include "/galeria/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galeria');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);
$objCpm->cpm_close();
?>
And these are the errors I receive: Warning: include(/galeria/cpmfetch/cpmfetch.php) [function.include]: failed to open stream: No such file or directory in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46
Warning: include() [function.include]: Failed opening '/galeria/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46
Fatal error: Class 'cpm' not found in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 47
My Coppermine gallery is installed in www.theothersize.com/galeria
the path for the include statement is a relative path from where the script is. So if your test page is in the root of your web site it would be:
include "./galeria/cpmfetch/cpmfetch.php";
The dot means "this directory" - without it, it means the top of the file system structure.
Do not change the new cpm though - that one seems right.
-
Thanks, it works very well now! :D