View Full Version : Integrated header and navigation across website
3pixelchicks
05-10-2008, 01:06 AM
I have a php logo and nav that I want to incorporate across the entire site - including in the forums. I'm very new at this and pretty clueless, but I do have the header.php file that seems to work ok: www.3pixelchicks.com/header.php
I've searched the forums, and I think I need to add to add this code to a global start plugin:
ob_start();
include('home/www3pix/public_html/header.php');
$includedphp = ob_get_contents();
ob_end_clean();
I've activated the plugins, but now I'm stuck. I tried adding: $includedphp in the header template, but I'm not sure if that's right. It gives me an error message in the forum. Here's the error:
Warning: include() [function.include]: Failed opening 'home/www3pix/public_html/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/global.php(383) : eval()'d code on line 2
If someone could let me know what I'm doing wrong, and which template (header? header includes? something else altogether??) I need to add $includedphp in, I would very much appreciate it! I apologize for being a total newbie here - it seems like the more I learn, the less I know. :rolleyes:
Dismounted
05-10-2008, 05:02 AM
ob_start();
include('/home/www3pix/public_html/header.php');
$includedphp = ob_get_contents();
ob_end_clean();
3pixelchicks
05-10-2008, 11:37 AM
Thanks Dismounted - I think that's the exact code I already added into the global start plug in. But I don't know what to do next! Putting $includedphp in the header template gives me an error in the forums: www.3pixelchicks.com/henhouse . I don't know if I'm putting it in the right place in the header (or if you can put it anywhere), or if it maybe belongs somewhere else, of if there is something else in the admin cp I need to do. Thanks for any help!
Dismounted
05-10-2008, 11:49 AM
Look closely ;).
3pixelchicks
05-10-2008, 11:53 AM
Dang - that little slash! I copied and pasted your code and now it works!!!! YAY!!! Thank you sooo much. Now off to see if the the photopost gallery is integrated too... You rock! :D
--------------- Added 1210424934 at 1210424934 ---------------
Ok - I knew it was too good to be true! It worked once, and now when I refresh, I ONLY see the header - no vbulletin content!! Any clue what I've done wrong now???
Dismounted
05-10-2008, 12:36 PM
Try using this:
ob_start();
include('/home/www3pix/public_html/header.php');
$includedheader = ob_get_contents();
ob_end_clean();
And using $includedheader in the template.
3pixelchicks
05-10-2008, 01:39 PM
That works the same way - still nothing after the header. I think there must be something wrong with my header.php file...what I can't figure out is how I got it to work right once, and now - nothing! :confused:
Dismounted
05-10-2008, 01:46 PM
Can you post that file?
3pixelchicks
05-10-2008, 01:55 PM
Here you go:
<?php include("headernav.html");
?>
And the headernav.html code:
<html>
<head>
<title>3 Pixel Chicks</title>
<script src="http://www.3pixelchicks.com/rollover.js" type="text/javascript"></script>
<link href="http://www.3pixelchicks.com/headerstyle.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="tplHeadWrapper">
<div id="tplHeadContent">
<div id="tplHeadTitle">
<div id="tplHeadNavbar">
<a href="http://www.3pixelchicks.com/zencart/index.php"><img src="/images/market.jpg" border="0" alt="Store" class="imgover"/></a>
<img src="/images/dot.jpg" />
<a href="http://www.3pixelchicks.com/henhouse/index.php"><img src="/images/henhouse.jpg" border="0" alt="Forum" class="imgover"/></a>
<img src="/images/dot.jpg" />
<a href="http://www.3pixelchicks.com/coop/index.php"><img src="/images/coop.jpg" border="0" alt="Gallery" class="imgover" /></a>
<img src="/images/dot.jpg" />
<a href="http://www.3pixelchicks.com/blog/index.php"><img src="/images/chickenfeed.jpg" border="0" alt="Blog" class="imgover"/></a>
<img src="/images/dot.jpg" />
<a href="http://www.3pixelchicks.com/freebies/index.php"><img src="/images/freerange.jpg" border="0" alt="Freebies" class="imgover"/></a>
</body>
</html>
And headerstyle.css (just in case that's what's messing everything up...)
#tplHeadWrapper { background: url('/images/header_center.jpg'); height: 230px; overflow: hidden; margin: 0; }
#tplHeadContent { background: url('/images/header_left.jpg') top left no-repeat; height: 215px; margin: 0; text-align: right; }
#tplHeadTitle { background: url('/images/header_right.jpg') top right no-repeat; height: 218px; margin: 0; text-align: right; }
#tplHeadNavbar { text-align: center; padding: 180px 20px 0 0; }
Dismounted
05-10-2008, 02:05 PM
Where are you putting the variable?
3pixelchicks
05-10-2008, 02:20 PM
The $includedheader is in the header template (in vbulletin admin cp). Is that the variable you're talking about, or do I need one in the header.php file? I might be going about this all wrong!! :o
Dismounted
05-11-2008, 05:46 AM
Show me your header template.
3pixelchicks
05-13-2008, 01:38 AM
I figured it out - it's working now! I just left out a few </div>.Thanks so much! :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.