coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Drewskie on April 05, 2007, 01:27:41 AM

Title: custom header include
Post by: Drewskie 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

<?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.
Title: Re: custom header include
Post by: Nibbler on April 05, 2007, 02:57:35 AM
Remove the php code then.
Title: Re: custom header include
Post by: Drewskie on April 05, 2007, 07:21:03 AM
THANKS!
Title: Re: custom header include
Post by: Joachim Müller 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.
Title: Re: custom header include
Post by: Timbli 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
Title: Re: custom header include
Post by: Joachim Müller 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.
Title: Re: custom header include
Post by: Timbli on April 11, 2007, 10:38:52 AM
yeeh could be why

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

<?php require '/home/freebord/public_html/poll/booth.php';
  
newest_booth(); ?>


hope you can help

cheers
Title: Re: custom header include
Post by: Joachim Müller on April 11, 2007, 02:17:33 PM
Quote from: Timbli on April 11, 2007, 10:38:52 AM
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.