Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: I can not get code to work  (Read 6402 times)

0 Members and 1 Guest are viewing this topic.

ThunderBucks

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
I can not get code to work
« 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
Code: [Select]
<?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.
Code: [Select]
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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: I can not get code to work
« Reply #1 on: May 24, 2007, 05:28:51 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
Code: [Select]
<?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.
Code: [Select]
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"?



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

ThunderBucks

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: I can not get code to work
« Reply #2 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.  :-\
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: I can not get code to work
« Reply #3 on: May 29, 2007, 07:27:47 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.

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

reas0n

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: I can not get code to work
« Reply #4 on: June 25, 2007, 11:36:15 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: I can not get code to work
« Reply #5 on: June 26, 2007, 05:09:10 am »

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?
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

reas0n

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: I can not get code to work
« Reply #6 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
Logged
Pages: [1]   Go Up
 

Page created in 0.035 seconds with 19 queries.