Advanced search  

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

Pages: [1]   Go Down

Author Topic: custom header include  (Read 4947 times)

0 Members and 1 Guest are viewing this topic.

Drewskie

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
custom header include
« on: April 05, 2007, 01:27:41 am »

Hi

I've set up my header in the path to custom header include, however it only shows up on the index page, it doesn't carry across to the other pages, like albums, ect.

here is my header.php

Code: [Select]
<?php

if ($_SERVER['PHP_SELF'] == 'index.php' && empty($_GET['cat'])){

?>


<div align="center">
<table border="0" width="980" bgcolor="#FFFFFF" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="8">
<p align="center">
<img border="0" src="images/logo.jpg" width="980" height="150"></td>
</tr>
<tr>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<p align="center"><b><font color="#FFFFFF">
<a href="forum/usercp.php">UserCP</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/search.php?do=getnew">
New Posts</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="gallery/">Gallery</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/faq.php">FAQ</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/calendar.php">
Calendar</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/forumdisplay.php?f=39">
Newsletter</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/memberlist.php">
Members List</a></font></b></td>
<td bordercolor="#FFFFFF" bgcolor="#B4CDCD" align="center">
<b><font color="#FFFFFF">
<a href="forum/login.php?do=logout&logouthash=19fdea16b5d883e000f4b999c4d60f87">
Log Out</a></font></b></td>
</tr>
<tr>
<td colspan="8">

</tr>
</table>

</table>
</div>

<?php
}


Any ideas how to fix this?

Thanks so much!

T.
« Last Edit: April 05, 2007, 08:25:28 am by GauGau »
Logged

Nibbler

  • Guest
Re: custom header include
« Reply #1 on: April 05, 2007, 02:57:35 am »

Remove the php code then.
Logged

Drewskie

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: custom header include
« Reply #2 on: April 05, 2007, 07:21:03 am »

THANKS!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: custom header include
« Reply #3 on: April 05, 2007, 08:27:31 am »

I can see no point in adding static HTML into the custom header - why don't you just add the HTML code into themes/yourtheme/template.html?

Joachim

P.S. Your HTML code is not valid. I suggest validating it. If you don't want to do that, make sure to have disabled the vanity block.
Logged

Timbli

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • GoFreeBording.com
Re: custom header include
« Reply #4 on: April 11, 2007, 07:14:22 am »

Well isn't the point of putting static code in headers and footers is because you dont wanna change multiple files if you change one little bit of the header, so this way it carries on?

My question is I got a header.php and footer.php and they are correctly defined in the config menu. However I have an include for a poll on my footer.php and it doesn't come up on the gallery. Just says cannot connect to database.

How can I fix this?

Cheers
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: custom header include
« Reply #5 on: April 11, 2007, 08:47:54 am »

The include probably open another mysql connection, closing the one opened by coppermine. Impossible to say without knowing the code. Not related though - as suggested, you can't do everything with the custom header/footer include. Opening mysql db connections is one of the things you can't do.
Logged

Timbli

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • GoFreeBording.com
Re: custom header include
« Reply #6 on: April 11, 2007, 10:38:52 am »

yeeh could be why

hopefully the code can be changed? at the moment it is

Code: [Select]
<?php require '/home/freebord/public_html/poll/booth.php';
  
newest_booth(); ?>

hope you can help

cheers
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: custom header include
« Reply #7 on: April 11, 2007, 02:17:33 pm »

hope you can help
No, I can't, as I have no idea what happens in the file you include. Additionally, I'm reluctant to look into this - as suggested, it's your business to figure out what can be done using the custom header/footer and what can't be done. I'm not willing to look into third-party code.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.