coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Sin on March 27, 2008, 10:16:05 PM

Title: [Solved]: PHP include
Post by: Sin on March 27, 2008, 10:16:05 PM
I'm not PHP savvy, i can look at the code and kind of tell what it does, but i cant write it myself.

I got the PHP include from the Installation screen:


<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>



Copied and pasted it into my content space on my site, heres the errors im getting:

http://gfxdashboard.lasglade.com/gallery.php

I'm not sure if its not finding the files or the images themselves, or if im just doing the include path correctly.

My serber goes as such:

gfxdashboard
-cpg1416 (coppermine)
--albums
--bridge
--cpmfetch
Other CPG Folders

(Main site files, still in the gfxdashboard index)
-forum.php
-gallery.php (where im trying to get the php  include to work)
-index.php
-links.php

Am i just not getting the path right? it seems like thats what it is, but im not sure.

i understand how an include works, but something about this isnt clicking with me.
Title: Re: PHP include
Post by: Sin on March 27, 2008, 10:18:50 PM
I couldnt find an Edit button... sorry for the double post..

Heres the link to my Coppermine gallery if you need that:

http://gfxdashboard.lasglade.com/cpg1416/
Title: Re: PHP include
Post by: formulx on March 27, 2008, 10:21:31 PM
Try this:

<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>



Your path was wrong. Also this was the wrong section. http://forum.coppermine-gallery.net/index.php/board,87.0.html is the board you needed to post it in.
Title: Re: PHP include
Post by: formulx on March 27, 2008, 10:29:23 PM
Whoops my mistake forgot to change the path here too:
<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("cpg1416/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>
Title: Re: PHP include
Post by: Sin on March 28, 2008, 05:55:30 AM
Quote from: formulx on March 27, 2008, 10:29:23 PM
Whoops my mistake forgot to change the path here too:
<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("cpg1416/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


thanks for the help mate, worked like a charm.