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: Suggestion for Add a custom header/footer to Coppermine  (Read 3122 times)

0 Members and 1 Guest are viewing this topic.

xplicit

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 214
Suggestion for Add a custom header/footer to Coppermine
« on: October 24, 2005, 11:24:36 pm »

As a site developer I just stumbled into a thing I just want to share for those who perhaps have the same sort of behaviours.

In my test/develop environment I'm using:

Internet Explorer
Firefox
Netscape
Opera

And for developing php I'm using the ZEND  studio

And allthough generating correct outputs when using the suggested code for implementing the custom headers in the FAQ and forum like
(allthough I'm not using static)

Code: [Select]
   if(empty($custom_header)){
      include('/path/your_file.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }

I got two warnings from ZEND studio like:

Cannot modify header information - headers allready sent by (output started at bla bla bla bla .php:1106)

(This was at the test server at localhost so no headers from third parties or something involved)

The file and line it mentioned was not generating the fault but what solved the warnings was including:

Code: [Select]
ob_start(); just before the include statement.

Allthough I don't think a lot of people will use php debuggers and will probably never see such output I just want to share this little code.
Logged
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Suggestion for Add a custom header/footer to Coppermine
« Reply #1 on: October 25, 2005, 01:55:29 am »

I think that's the correct way of doing the output buffering.  Thanks for the tip.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.