I just finished my new redesign of my website. It works fine in the /redesign folder. I have tested it for a full week... no errors. I've hyped the opening too long to pull out now. I upload it... and damn. "Headers already sent" error.
I hope you guys can help me, because I'm up a dead end.
Here is all of my program pertaining to the problem. I would like to point out that I have tested the site in its live enviroment for a while now, and it is only occuring in index.php.
Index.php:
Code: Select all
<?php
define('IN_PHPBB', true);
$Section = 'index';
$Title = 'true';
$template = 'header';
include('includes/template.php');
/********************************************
* - Welcome to Index.php Version 1.0.
* - This script will display several things:
- The News
- The Tomb of Info
- Account (Currently, Favorite Pages)
* - Let's get started.
********************************************/
/********************************************
* - Check to see if The Index is required.
* - If the user wants The Index,
* - Print the random Welcome Message
* - Print the last 5 News Articles
********************************************/
if(!$SubSection) {
$errorcheck = 'false';
?>
<!--- Welcome Message --->
<img src="http://images.yolegoman.com/main/monkey.gif" align="right" valign="middle" hspace="5" vspace="5" />
<p class="welcomeMessage">
<?=$welcomeMessage;?>
</p>
<br clear="right" />
<hr align="center" noshade />
<br />
<!--- Latest News --->
<div class="subheader"> The News:</div>
<?PHP
// Include The News
include('includes/library/index/TheNews.php');
?>
<div align="center" class="subheader">
<a href="index.php?SubSection=TheNews">
The Archives
</a>
</div>
<?PHP
} else if($SubSection && !$Page) {
include('includes/library/generator/subsection.php');
} else if($Page) {
include('includes/library/generator/page.php');
}
$template = 'footer';
include('includes/template.php');
exit();
?>Code: Select all
<?php
/********************************************
* - Welcome to Template.php Version 1.0.
*
* - This script will take our variables and output the final result.
*
* - Let's get started.
********************************************/
if($template == 'header') {
define('IN_PHPBB', true);
include('includes/session.php');
include('includes/config.php');
include('includes/queries.php');
$header = file('includes/library/global/header.php');
foreach($header as $header) {
$code = array(
'{title}',
'{redirect}',
'{l_tombofinfo}',
'{menu}',
'{datacenter}',
);
$code_replace = array(
$title,
$redirect,
$l_tombofinfo,
$menu,
$datacenter,
);
$header = str_replace($code, $code_replace, $header);
echo $header;
}
} // End if template = header.
if($template == 'window') {
$window = file('includes/library/global/window.php');
foreach($window as $window) {
$code = array(
'{redirect}',
);
$code_replace = array(
$redirect,
);
$window = str_replace($code, $code_replace, $window);
echo $window;
}
}
if($template == 'footer') {
// If there is no correct SubSection, then include the error message
if($errorcheck != 'false') {
$error = '404';
include('includes/error.php');
}
$footer = file('includes/library/global/footer.php');
foreach($footer as $footer) {
$code = array(
'{randQuote}',
);
$code_replace = array(
$randQuote,
);
$footer = str_replace($code, $code_replace, $footer);
echo $footer;
}
mysql_close();
} // End the Footer
?>Code: Select all
<?php
define('IN_PHPBB', true);
$site_root_path = '/home/yolegoma/public_html/';
$phpbb_root_path2 = '/monkeyslair/';
$phpbb_root_path = $site_root_path . $phpbb_root_path2;
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php');
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// Name our phpBB related variables
$loggedin = $userdata['session_logged_in'];
$username = $userdata['username'];
$uservisit = $userdata['user_lastvisit'];
$userid = $userdata['user_id'];
// Determine if user is the administrator/ nonsense administrator
$admin = 'false';
$nonsenseadmin = 'false';
if($username == 'Yolegoman') {
$admin = 'true';
}
if($username == 'Motfilms') {
$nonsenseadmin = 'true';
}
// Determine how many new posts since last visit
// $new_post = the number of posts since last visit
$new_post = '0';
$result = queryDB("SELECT * FROM monkey_posts WHERE post_time >= $uservisit");
while($row = mysql_fetch_array($result)) {
$new_post = $new_post + 1;
}
?>Code: Select all
<?php
<?PHP
/********************************************
- Welcome to queries.php Version 1.0.
- This script will query our database for us.
********************************************/
//***** ----- The SELECT Queries ----- *****\\
// The Title query.
$titleResult = queryDB("SELECT * FROM site_random WHERE random_type = 'title' ORDER BY RAND() LIMIT 1");
$titleRow = mysql_fetch_array($titleResult);
$randTitle = $titleRow['random_text'];
if($Section == 'index' && !$SubSection) {
$title = 'Welcome to Yolegoman.com :: ' .$randTitle;
} else {
if(!$SubSection) {
$title = $Name;
} else if($Page) {
$title = $Page;
} else {
$title = $SubSection;
}
$title = 'Yolegoman.com :: ' .$title;
}
// The Welcome Message Query
$welcomeResult = queryDB("SELECT * FROM site_random WHERE random_type = 'welcome' ORDER BY RAND() LIMIT 1");
$welcomeRow = mysql_fetch_array($welcomeResult);
$welcomeMessage = $welcomeRow['random_text'];
// The Random Quote Query
$quoteResult = queryDB("SELECT * FROM site_random WHERE random_type = 'quote' ORDER BY RAND() LIMIT 1");
$quoteRow = mysql_fetch_array($quoteResult);
$randQuote = $quoteRow['random_text'];
//*** If/Else statements ***\\
// The Logo_TombofInfo link
if($SubSection == 'TombofInfo' && !$Page) {
$l_tombofinfo = 'About Yolegoman.com :: The Tomb of Info';
} else {
$l_tombofinfo = '<a href="index.php?SubSection=TombofInfo">';
$l_tombofinfo .= 'About Yolegoman.com :: The Tomb of Info';
$l_tombofinfo .= '</a>';
}
//*** Include Files ***\\
// The Menu
ob_start();
include('includes/library/global/menu.php');
$menu = ob_get_contents();
ob_end_clean();
// The Data center
ob_start();
include('includes/library/global/datacenter.php');
$datacenter = ob_get_contents();
ob_end_clean();
?>Code: Select all
<html>
<head>
<title>{title}</title>
<!--- The Meta Tags --->
<meta name="description" content="Yolegoman.com has Lego, Brickfilms and Nonsense by Nathaniel Jones" />
<meta name="keywords" content="Lego, Brickfilms, Monkey Studios, Geeky Nonsense, Yolegoman" />
{redirect}
<!--- The Javascript --->
<!--- The Style Sheet --->
<style type="text/css">
<!---
BODY { scrollbar-base-color: #996633; scrollbar-track-color: #996633; scrollbar-face-color: tan; scrollbar-highlight-color: #D1BA9A; scrollbar-3dlight-color: #C4A57B; scrollbar-darkshadow-color: #BB9868; scrollbar-shadow-color: #000000; scrollbar-arrow-color: #996633;
}
A:link, A:visited { COLOR:#996633; TEXT-DECORATION: NONE; font-style: normal }
A:hover, A:active { COLOR:#663300; TEXT-DECORATION: NONE; font-style: normal}
.header { font-size: 19pt; font-family: "j.d."; line-height:7pt; padding-top: 8px; }
.subheader { font-size:14pt; font-family: "j.d."; font-color: #663300;}
.menu { font-size: 12pt; font-family: "j.d."; margin-top: 6pt; margin-bottom: 6pt;}
.submenu { font-size: 11pt; font-family: "helvetica"; line-height: 14pt; margin-left: 3px;}
.pagemenu { font-size: 8pt; font-family: "helvetica"; line-height: 16pt; margin-left: 13px}
.footer { font-size: 8pt; font-family: "helvetica"; line-height: 11pt; font-style: italic }
.content { font-size: 9pt; font-family: "helvetica"; }
.logoLink { font-size: 8pt; font-family: "helvetica"; padding-top: 8px; }
.welcomeMessage { font-size: 11pt; font-family: "helvetica"; margin-left: 18px; padding-top: 4px;}
.lists { COLOR: #63300; font-size: 10pt; font-family: "helvetica"; padding-top: 10px; }
.font5pt { font-size: 5pt; font-family: "helvetica"; }
.font6pt { font-size: 6pt; font-family: "helvetica"; }
.font7pt { font-size: 7pt; font-family: "helvetica"; }
.font8pt { font-size: 8pt; font-family: "helvetica"; }
.font9pt { font-size: 9pt; font-family: "helvetica"; }
.font10pt { font-size: 10pt; font-family: "helvetica"; }
.font11pt { font-size: 11pt; font-family: "helvetica"; }
.font12pt { font-size: 12pt; font-family: "helvetica"; }
.tinyhr { color: #996633; background-color: tan; height: 3px; width: 95%; }
hr {
color: #996633;
background-color: tan;
height: 4px;
width: 95%;
}
--->
</style>
<script language="JavaScript" type="text/javascript">
<!---
function open_win(what_link,the_x,the_y,toolbar,addressbar,directories,statusbar,menubar,scrollbar,resize,history,pos,wname){
var the_url = what_link;
the_x -= 0;
the_y -= 0;
var how_wide = screen.availWidth;
var how_high = screen.availHeight;
if(toolbar == "0"){var the_toolbar = "no";}else{var the_toolbar = "yes";}
if(addressbar == "0"){var the_addressbar = "no";}else{var the_addressbar = "yes";}
if(directories == "0"){var the_directories = "no";}else{var the_directories = "yes";}
if(statusbar == "0"){var the_statusbar = "no";}else{var the_statusbar = "yes";}
if(menubar == "0"){var the_menubar = "no";}else{var the_menubar = "yes";}
if(scrollbar == "0"){var the_scrollbars = "no";}else{var the_scrollbars = "yes";}
if(resize == "0"){var the_do_resize = "no";}else{var the_do_resize = "yes";}
if(history == "0"){var the_copy_history = "no";}else{var the_copy_history = "yes";}
if(pos == 1){top_pos=0;left_pos=0;}
if(pos == 2){top_pos = 0;left_pos = (how_wide/2) - (the_x/2);}
if(pos == 3){top_pos = 0;left_pos = how_wide - the_x;}
if(pos == 4){top_pos = (how_high/2) - (the_y/2);left_pos = 0;}
if(pos == 5){top_pos = (how_high/2) - (the_y/2);left_pos = (how_wide/2) - (the_x/2);}
if(pos == 6){top_pos = (how_high/2) - (the_y/2);left_pos = how_wide - the_x;}
if(pos == 7){top_pos = how_high - the_y;left_pos = 0;}
if(pos == 8){top_pos = how_high - the_y;left_pos = (how_wide/2) - (the_x/2);}
if(pos == 9){top_pos = how_high - the_y;left_pos = how_wide - the_x;}
if (window.outerWidth ){
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
wname=window.open(the_url, wname, option);
wname.focus();
}
else
{
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
if (!wname.closed && wname.location){
wname.location.href=the_url;
}
else
{
wname=window.open(the_url, wname, option);
//wname.resizeTo(the_x,the_y);
wname.focus();
wname.location.href=the_url;
}
}
}
// -->
</script>
</head>
<body text="#663300" link="#996633" vlink="#996633" alink="#663300"
bgcolor="#C7A363" background="http://images.yolegoman.com/global/background.jpg">
<a name="top"></a>
<br />
<!--- The Logo Program --->
<table border="5" align="center" cellspacing="0" cellpadding="0" bgcolor="#99633"
background="http://images.yolegoman.com/global/tablebg.jpg" bordercolor="tan">
<tr>
<td>
<!--- The Top of the Logo --->
<table border="0" align="left" cellspacing="0" cellpadding="0"
background="http://images.yolegoman.com/global/logo_top.jpg" height="69" width="500">
<tr>
<td>
<map name="logo">
<area shape=rect coords="0,0 130,70" href="http://www.yolegoman.com/index.php"
title="Yolegoman.com | All Your Nonsense Are Belong To Us" alt="Yolegoman.com | All Your Nonsense Are Belong To Us">
<area shape=rect coords="230,37 490,67" href="http://www.yolegoman.com/index.php"
title="Yolegoman.com | All Your Nonsense Are Belong To Us" alt="Yolegoman.com | All Your Nonsense Are Belong To Us ">
</map>
<img src="http://images.yolegoman.com/blank.gif" border="0" height="60" width="500" ISMAP USEMAP="#logo">
</td>
</tr>
</table>
<!--- The Bottom of the Logo --->
<br clear="left">
<table border="0" align="left" cellspacing="0" cellpadding="0"
background="http://images.yolegoman.com/global/logo_bottom.jpg" height="30" width="500">
<tr>
<td align="right" class="logoLink">
<a href="http://monkeyslair.yolegoman.com">Monkey's Lair</a> &nbsp;|&nbsp; {l_tombofinfo}&nbsp;&nbsp;&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
<br clear="left" />
<br />
<br />
<!-- The Menu Program --->
<table align="left" border="0" width="16%" cellpadding="0">
<tr>
<td>
<table align="left" border="5" bgcolor="tan" bordercolor="tan"
background="http://images.yolegoman.com/global/tablebg.jpg" cellpadding="5" width="100%">
<tr>
<td class="menu" nowrap>
<hr class="tiny" noshade />
{menu}
<hr class="tiny" noshade />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<br />
<br />
{datacenter}
</td>
</tr>
</table>
<!--- The Spacer Table --->
<table align="left" width="8%" border="0">
<tr><td> </td></tr>
</table>
<!--- The Content Table --->
<table align="left" width="60%" border="5" bgcolor="tan" bordercolor="tan" background="http://images.yolegoman.com/global/tablebg.jpg" cellpadding="10">
<tr>
<td class="content">Warning: Cannot modify header information - headers already sent by (output started at /home/yolegoma/public_html/index.php:1) in /home/yolegoma/public_html/monkeyslair/includes/sessions.php on line 182
Warning: Cannot modify header information - headers already sent by (output started at /home/yolegoma/public_html/index.php:1) in /home/yolegoma/public_html/monkeyslair/includes/sessions.php on line 183
What do I do now? I'm running an unmodded phpBB2 script.
- The Monkey