PDA

View Full Version : Include Header


Laudez
04-11-2007, 07:05 PM
Heya,
First off let me say, I have only a brief clue every now and again of what I am doing. Now: I LOVE phpraid. We recently updated and now some of my script is NOT working - no matter how many snot bubbles I blow... was wondering if anyone had a clue ;)

So here is how it stands, to include some header files that make my page all pretty...

In page_header.php
// Includes for site header files
ob_start();
include '../header1.html';
$my_header = ob_get_contents();
ob_end_clean();

//include('../header1.html');

ob_start();
include '../headscript.html';
$my_headscript = ob_get_contents();
ob_end_clean();


Then in header.htm in my template file:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>{title_guild_name} of {title_guild_server} :: {title_guild_description}</title>
<script src="templates/SpiffyJr/scripts/cal2.js" language="javascript"></script>
<script src="templates/SpiffyJr/scripts/cal2_conf.js" language="javascript"></script>
<script src="templates/SpiffyJr/scripts/phpRaid.js" language="javascript"></script>
<link rel="stylesheet" type="text/css" href="templates/ninthcircle/style/calendar.css">
<link rel="stylesheet" type="text/css" href="/9thc.css">
{my_headscript}
</head>
<body>
<!-- DO NOT REMOVE OR YOU RISK BREAKING TOOLTIPS -->
<div id="dhtmltooltip"></div>
<script src="templates/SpiffyJr/scripts/tooltips.js" language="javascript"></script>
<!-- END TOOLTIP CODE -->
<div align="center">
{my_header}
<br>

This has always worked for us - keeping it all nice and neat and presenting our scripts/pages fluently with phpRaid. After the last patch, this just doesn't work and I have run outta ideas.

Thanks muchly to anyone who might have an idea of what has happened!
Cheers
Laudez.

Laudez
04-12-2007, 11:26 AM
Ok.... never mind me, got it figured out. However, should any one out there use phpraid and want to include their sites header files for intergration (that nice everything is together look):

In /includes/page_header.php add the following between the setup header variables and the time variables...
ob_start();
include '../yourheaderfilehere';
$my_header = ob_get_contents();
ob_end_clean();

THEN (this is where I was getting stuck) further down the page you will find a block like this:
$page->set_var(
array(
'header_link' => $phpraid_config['header_link'],
'title_guild_name'=>$phpraid_config['guild_name'],
'title_guild_server'=>$phpraid_config['guild_server'],
'title_guild_description'=>$phpraid_config['guild_description'],
'header_logo' => $phpraid_config['header_logo'],
'guild_time' => $guild_time,
'guild_date' => $guild_date,
'login_form_open' => $login_form_open,
'login_form_close' => $login_form_close,
'login_username' => $login_username,
'login_password' => $login_password,
'login_remember' => $login_remember,
'login_remember_hidden' => $login_remember_hidden,
'login_button' => $login_button,
'site_disabled_warning' => $site_disabled_warning
)
);

Add this to the end (remember your commas :))
'my_header => $my_header


Then go into /templates/yourtemplate/header.htm and put in {my_header} where it needs to be (depends on how you have written your files etc...)

And hey presto, your phpraid now looks like a part of your site!

Thanks for writing such a nifty little program
Cheers
Laudez ;D

p.s. If ya want to see it in action: The Ninth Circle (http://www.the9thcircle.com/phpraid)