custom header include custom header include
 

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

custom header include

Started by Drewskie, April 05, 2007, 01:27:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Drewskie

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.

Nibbler


Drewskie


Joachim Müller

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.

Timbli

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

Joachim Müller

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.

Timbli

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

Joachim Müller

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.