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: php code not working from the gallery template  (Read 3981 times)

0 Members and 1 Guest are viewing this topic.

leslie1970

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
php code not working from the gallery template
« on: May 24, 2007, 10:54:17 pm »

I have installed and linked the code to my main site and it is working but when I use the same code on my gallery template the code doesn't work.  I have looked through the documentation and what I have looks right but I can't figure out what I am missing.

This is the php code i am using:

                                  <?php
                                    include "./gallery/cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
                                    $objCpm->cpm_viewRandomMediaFrom ("album=6,7,8",1,1);
                                    $objCpm->cpm_close();
                                  ?>


Like I said it works from my main site index but not in the gallery. I have tried several different paths to the cpmfetch.php file but I just can't seem to find the right path.

Any help would be greatly appreciated.  I am sure it is just some silly little thing I am missing!
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: php code not working from the gallery template
« Reply #1 on: May 29, 2007, 07:33:12 pm »

I have installed and linked the code to my main site and it is working but when I use the same code on my gallery template the code doesn't work.  I have looked through the documentation and what I have looks right but I can't figure out what I am missing.

This is the php code i am using:

                                  <?php
                                    include "./gallery/cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
                                    $objCpm->cpm_viewRandomMediaFrom ("album=6,7,8",1,1);
                                    $objCpm->cpm_close();
                                  ?>


Like I said it works from my main site index but not in the gallery. I have tried several different paths to the cpmfetch.php file but I just can't seem to find the right path.

Any help would be greatly appreciated.  I am sure it is just some silly little thing I am missing!

what gallery are you using?

Does its templates execute php?

What are the paths in question?

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

leslie1970

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: php code not working from the gallery template
« Reply #2 on: May 30, 2007, 12:48:06 am »

I am not sure what you mean by what gallery am I using but I assume you mean the version of coppermine?  I am using  (1.4.10).

I edited the classic template's style sheets and template.html.  I would hope that it will execute php.

The paths I have tried are:

                                    include "./gallery/cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");

                                    include "./cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("./cpmfetch/cpmfetch_config.php");

                                    include "/home/thekat5/public_html/gallery/cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("/home/thekat5/public_html/gallery/cpmfetch/cpmfetch_config.php");

                                    include "/cpmfetch/cpmfetch.php";
                                    $objCpm = new cpm("/cpmfetch/cpmfetch_config.php");

and pretty much every variation I could possibly think of.  Nothing works. I even tried using the html code I found in a thread here that only displayed one image (since that is all I want to display) and it did not work either.

I hope I answered everything correctly.  I am not a programmer by any means so I am trying my best to understand everything.
Logged

leslie1970

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: php code not working from the gallery template
« Reply #3 on: June 08, 2007, 08:57:55 pm »

I'm still interested in any help I could get on this.  Thanks!
Logged

Nibbler

  • Guest
Re: php code not working from the gallery template
« Reply #4 on: June 08, 2007, 10:48:58 pm »

A link to your gallery and to where you are using this code would probably help. You can't use php in the stylesheet or in template.html; you can only use php in php files.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.