News:

CPG Release 1.6.31
Minor maintenance release
Clean up remaining remnants of the .net CPG website
Improved installer_stub compatibility with various server configurations

Main Menu

Help with inserting the PHP code...

Started by Naif, March 30, 2007, 10:53:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Naif

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

vuud

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


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.



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

Naif