Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Help with inserting the PHP code...  (Read 5627 times)

0 Members and 1 Guest are viewing this topic.

Naif

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Help with inserting the PHP code...
« 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
« Last Edit: April 03, 2007, 02:47:43 am by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Help with inserting the PHP code...
« Reply #1 on: March 31, 2007, 12:40:18 am »

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.



Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Help with inserting the PHP code...
« Reply #2 on: March 31, 2007, 03:43:56 pm »

Thanks, it works very well now!  :D
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 19 queries.