[Solved]: Embedded call to PHP from template [Solved]: Embedded call to PHP from 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

[Solved]: Embedded call to PHP from template

Started by steveeh131047, March 17, 2008, 01:02:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steveeh131047

Hi,

I just upgraded to 1.14.6 and was reminded what a superb, flexible script, Coppermine is.

I'm now trying to integrate it better into the "look and feel" of a web site with some significant changes to the theme files. Everything works well, except that if I include a call in the theme.html template file for some PHP to generate content dynamically (e.g. <? require("../naviagation_links.php"); ?>) it seems to get ingored.

I don't think it's a path issue because I've tried many different combinations. I also have the right .htaccess entries to allow a .html file to be parsed for php.

Am I missing something? Perhaps I can't include a php call within a template?

Steve



Nibbler

Exactly, you can't. This is explained in the documentation. Use the custom header/footer features instead.

Quote from: Steveeh on March 17, 2008, 01:02:42 PM
I also have the right .htaccess entries to allow a .html file to be parsed for php.

Apache never sees template.html - it's handled within Coppermine.

steveeh131047

Nibbler,

Thanks for that. I'll look for another way to generate the content. Even if I can't, I can get pretty close to the appearance I want just by modifying style.css and theme.php.

Thanks for your help.

Steve

Nibbler

Use the custom header feature. Put {CUSTOM_HEADER} where your require() is and enter the path to the file in config as the custom header path.

steveeh131047

Nibbler,

Great - just tried it and it works beautifully.

Thanks,
Steve