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: [Solved]: Embedded call to PHP from template  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
[Solved]: Embedded call to PHP from template
« on: March 17, 2008, 01:02:42 pm »

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


« Last Edit: March 17, 2008, 02:14:52 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Embedded call to PHP from template
« Reply #1 on: March 17, 2008, 01:05:31 pm »

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

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.
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Embedded call to PHP from template
« Reply #2 on: March 17, 2008, 01:17:51 pm »

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
Logged

Nibbler

  • Guest
Re: Embedded call to PHP from template
« Reply #3 on: March 17, 2008, 01:25:15 pm »

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.
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Embedded call to PHP from template
« Reply #4 on: March 17, 2008, 02:04:51 pm »

Nibbler,

Great - just tried it and it works beautifully.

Thanks,
Steve
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 15 queries.