coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: debragrant on April 08, 2007, 12:52:57 AM

Title: php for page
Post by: debragrant on April 08, 2007, 12:52:57 AM
I have installed and tested cftest.php and all is working fine.
What is the php code I need to add to the actual web page?

Title: Re: php for page
Post by: vuud on April 08, 2007, 06:15:58 AM
Quote from: debragrant on April 08, 2007, 12:52:57 AM
I have installed and tested cftest.php and all is working fine.
What is the php code I need to add to the actual web page?

Good question!  Have you checked the documentation?

Or this thread.
http://forum.coppermine-gallery.net/index.php?topic=39817.0
Title: Re: php for page
Post by: debragrant on April 08, 2007, 10:24:00 AM
so i added

<?php 
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


to a file i named images.php

i then uploaded it to gallery/cpmfetch

I added

<!--#include virtual="/gallery/cpmfetch/images.php" -->

to my html page is that right?

I don't get any images showing
Title: Re: php for page
Post by: vuud on April 09, 2007, 12:33:14 AM
Quote from: debragrant on April 08, 2007, 10:24:00 AM
so i added

<?php 
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


to a file i named images.php

i then uploaded it to gallery/cpmfetch

I added

<!--#include virtual="/gallery/cpmfetch/images.php" -->

to my html page is that right?

I don't get any images showing

First, try running your images.php file and make sure it returns some images (does not matter if its not wrapped in HTML, you will get something).


If you do get images, then you need to make sure:

#1) Your html file processing server side includes

#2) Your virtual path is correct... you may need a . in front of the first slash.






Title: Re: php for page
Post by: debragrant on April 10, 2007, 09:46:02 AM
I get this error

Warning: main(./gallery/cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Warning: main(./gallery/cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Warning: main() [function.include]: Failed opening './gallery/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Fatal error: Cannot instantiate non-existent class: cpm in /.../helendallimore/gallery/cpmfetch/images.php on line 3
Title: Re: php for page
Post by: vuud on April 10, 2007, 03:54:52 PM
Quote from: debragrant on April 10, 2007, 09:46:02 AM
I get this error

Warning: main(./gallery/cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Warning: main(./gallery/cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Warning: main() [function.include]: Failed opening './gallery/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /.../helendallimore/gallery/cpmfetch/images.php on line 2

Fatal error: Cannot instantiate non-existent class: cpm in /.../helendallimore/gallery/cpmfetch/images.php on line 3



Your include statement for including cpmfetch.php does not have the correct path.

images.php  needs to be able to get to it from where it is.
Title: Re: php for page
Post by: debragrant on April 10, 2007, 03:56:10 PM
images.php need to be in the cmpfetch folder?
Title: Re: php for page
Post by: vuud on April 10, 2007, 11:06:51 PM
Quote from: debragrant on April 10, 2007, 03:56:10 PM
images.php need to be in the cmpfetch folder?

No it does not.  But if it is...

Change the include statement to be:

include "./cpmfetch.php";