php code not working from the gallery template php code not working from the gallery template
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

php code not working from the gallery template

Started by leslie1970, May 24, 2007, 10:54:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

leslie1970

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!

vuud

Quote from: leslie1970 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!

what gallery are you using?

Does its templates execute php?

What are the paths in question?

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

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.

leslie1970

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

Nibbler

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.