coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: ThunderBucks on May 19, 2007, 01:50:34 AM

Title: I can not get code to work
Post by: ThunderBucks on May 19, 2007, 01:50:34 AM
I have just installed the cpmfetch and all worked and I seen the pics and the php code. I copied the code and modified it to how it is on my server <?php
  
include ".cpg1410/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm(".cpg1410/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


And this is all that displays on the page. cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>
I do not have a lot of programing and coding knowledge so can someone please help me out on what I need to do to get this to work?? My server does support php I do know that, but just can't understand why this won't show up for me.
Title: Re: I can not get code to work
Post by: vuud on May 24, 2007, 05:28:51 AM
Quote from: ThunderBucks on May 19, 2007, 01:50:34 AM
I have just installed the cpmfetch and all worked and I seen the pics and the php code. I copied the code and modified it to how it is on my server <?php
  
include ".cpg1410/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm(".cpg1410/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


And this is all that displays on the page. cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>
I do not have a lot of programing and coding knowledge so can someone please help me out on what I need to do to get this to work?? My server does support php I do know that, but just can't understand why this won't show up for me.


Do you have that code in a file whos name ends with ".php"?



Title: Re: I can not get code to work
Post by: ThunderBucks on May 26, 2007, 05:37:53 PM
I added it to a file called fetch.php and uploaded it to the cpmfetch directory but now how do I call it up on my webpage? Sorry I am not getting this and really appriciate your help and patients with me here.  :-\
Title: Re: I can not get code to work
Post by: vuud on May 29, 2007, 07:27:47 PM
Quote from: ThunderBucks on May 26, 2007, 05:37:53 PM
I added it to a file called fetch.php and uploaded it to the cpmfetch directory but now how do I call it up on my webpage? Sorry I am not getting this and really appriciate your help and patients with me here.  :-\

That code should go right in the page you want to display it on.  It should be a php page.  If you are trying to include it into an HTML page, you have a slightly rough road ahead of you.

Title: Re: I can not get code to work
Post by: reas0n on June 25, 2007, 11:36:15 PM
Quote from: vuud on May 29, 2007, 07:27:47 PM
That code should go right in the page you want to display it on.  It should be a php page.  If you are trying to include it into an HTML page, you have a slightly rough road ahead of you.



can you explain how to get it onto an html page because thats where im trying to put it and i get the same error
Title: Re: I can not get code to work
Post by: vuud on June 26, 2007, 05:09:10 AM
Quote from: reas0n on June 25, 2007, 11:36:15 PM
can you explain how to get it onto an html page because thats where im trying to put it and i get the same error

You have a few options

1.  Cfimageget.php - this is the easiest but is geared toward one image really

2.  HTML Server side include - if it works with your server, milage varies depending on your host.  If it does work, you can do all your cpmfetch stuff in that other file and include it.

3.  The javascript thing remdex did for cpmfetch - while slightly limited for now, it may be the best way to do it as SSI fades away.

4.  The by far, easiest way is to rename all your pages to php and just insert the code.  If you have 100's of pages this may not be the best, but if you only have a dozen or so pages, it may be worth the effort.  PHP gives you lots of cool stuff.

Am I forgetting anything?
Title: Re: I can not get code to work
Post by: reas0n on June 27, 2007, 01:37:07 AM
problem solved on my end....i changed something on my server so that it reads html pages through the php engine