I just tried this and it works fine...
Here are some assumptions I use in this document, you can change them of course, but this will help you figure out which parts you can change. You do not have to use these paths, please change them to whatever you want, just be consistent
Coppermine is installed into
/cpgCpmFetch has been installed into
/cpmfetchYour HTML page is in the root of the web site
/You create the new file in
/cpmfetchHere are the steps I went through:1. Get cpmfetch installedA normal install, follow the directions.
2. Make sure the cpmtest.php file is workingThis is part of the directions, but thought it would be worth mentioning anyway
3. Create a new file named randomimages.php file The filename can be whatever you want, but must be .php
4. Edit "randomimages.php" and add in the following code:
<?php
include "./coppermine.php";
$objCpm = new cpm('/cpg');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();
?>
The cpm_viewLastAddedMedia can be altered to any of the function calls. This is just my example.
Note: The first and second lines will need to be edited to your specific installation. The /cpg would be the same value you used to get cftest.php working. The include is the path to where you installed the cpmfetch program.5. Edit your HTML fileInclude the following line (Apache users) where you want the HTML table to be inserted.
<!--#include virtual="/cpmfetch/ssitest.php" -->
6. Tell the server its okay to execute SSI commandsNow you need to tell the server it is okay to execute commands inside the HTML. This can be done a few ways.
* You can use .shtml on some servers instead of .html
* You can add a file named ".htaccess" with "XBitHack On" on it and change the permissions to execute (chmod 755)
Apache documentation for SSI can be found here:
http://httpd.apache.org/docs/howto/ssi.html7. Check it with your web browser...
It should work.
If not, view the source... if you see <!--#include virtual="/cpmfetch/ssitest.php" --> in there still, then it means that your web server is not noticing it can execute. Review step 6 and the apache documentation.
If the #include is missing, then it means that your server is okay, your just not getting any pictures back. Try executing the PHP file directly.
Please post comments or corrections... and if any IIS user wants to step up and note how to do it on IIS, that would be great!
Hope this helps
Vuud