ok so I'm trying to incorporate these things but now nothing shows up at all, and the Error is still present.
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /home/thegif15/public_html/xo/home2.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /home/thegif15/public_html/xo/home2.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /home/thegif15/public_html/xo/home2.php:6)
edit: I've also noticed that If I am logged into the forums, The error does not appear, but if I am not logged in to the forums it appears again.
http://www.xo-gaming.com/home2.php I am using home2.php to test things before I update it to
http://www.xo-gaming.com/home.php
I am putting the php code, right in the Div on my website as I dont know anywhere else to put it or implement it, Should I be keeping the php seperate from my main site code and bringing it in a different way? I'm thinking I really dont need any css sent by phpbb, The rest of the site needs different css for the div's and such that I don't want phpbb controlling. I just need the text objects sent, as the forum on my site looks different than the news page looks. The full code looks like this, the php portion is at the bottom:
Code: Select all
<html>
<head>
<title>Team xO Gaming - Hug's N Kisses!!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Save for Web Styles (xoweb.psd) -->
<style type="text/css">
<!--
#thing {
position:relative;
height:100%;
width="1000";
}
#Table_01 {
position: absolute;
left: 50%;
width: 1000px;
margin-left: -500px;
margin-top:0px;
height:800px;
}
#xoweb-01 {
position:absolute;
left:0px;
top:0px;
width:1000px;
height:63px;
}
#xoweb-02 {
position:absolute;
left:0px;
top:63px;
width:210px;
height:81px;
}
#xoweb-03 {
position:absolute;
left:210px;
top:63px;
width:62px;
height:33px;
}
#xoweb-04 {
position:absolute;
left:272px;
top:63px;
width:80px;
height:33px;
}
#xoweb-05 {
position:absolute;
left:352px;
top:63px;
width:76px;
height:33px;
}
#xoweb-06 {
position:absolute;
left:428px;
top:63px;
width:164px;
height:81px;
}
#xoweb-07 {
position:absolute;
left:592px;
top:63px;
width:95px;
height:33px;
}
#xoweb-08 {
position:absolute;
left:687px;
top:63px;
width:60px;
height:33px;
}
#xoweb-09 {
position:absolute;
left:747px;
top:63px;
width:61px;
height:33px;
}
#xoweb-10 {
position:absolute;
left:808px;
top:63px;
width:192px;
height:81px;
}
#xoweb-11 {
position:absolute;
left:210px;
top:96px;
width:218px;
height:48px;
}
#xoweb-12 {
position:absolute;
left:592px;
top:96px;
width:216px;
height:48px;
}
#xoweb-13 {
position:absolute;
left:0px;
top:144px;
width:1000px;
height:656px;
background-image: url(images/xoweb_13.png);
background-repeat:repeat-x;
}
#foot {
{position: absolute; bottom: 0; left: 0; width: 1000px; height: 30px; background-color:#333;}
}
body {
background-color: #000;
background-image: url(xowebbg.png);
background-repeat: repeat-x;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a:link {
color: #F00;
}
a:visited {
color: #C00;
}
a:hover {
color: #900;
}
a:active {
color: #CCC;
}
body,td,th {
font-family: Verdana, Geneva, sans-serif;
color: #666;
font-size: 12px;
}
-->
</style>
<!-- End Save for Web Styles -->
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body style="background-color:#000000; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;" onLoad="MM_preloadImages('images/xoweb_over_03.png','images/xoweb_over_04.png','images/xoweb_over_05.png','images/xoweb_over_07.png','images/xoweb_over_08.png','images/xoweb_over_09.png')">
<center>
<div id="Table_01">
<div id="xoweb-01">
<img src="images/xoweb_01.png" width="1000" height="63" alt="">
</div>
<div id="xoweb-02">
<img src="images/xoweb_02.png" width="210" height="81" alt="">
</div>
<div id="xoweb-03"> <a href="#news" target="_self"><img src="images/xoweb_03.png" alt="" width="62" height="33" border="0" id="Image1" onMouseOver="MM_swapImage('Image1','','images/xoweb_over_03.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-04"> <a href="roster.php" target="_self"><img src="images/xoweb_04.png" alt="" width="80" height="33" border="0" id="Image2" onMouseOver="MM_swapImage('Image2','','images/xoweb_over_04.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-05"> <a href="http://www.xo-gaming.com/forum/" target="_new"><img src="images/xoweb_05.png" alt="" width="76" height="33" border="0" id="Image3" onMouseOver="MM_swapImage('Image3','','images/xoweb_over_05.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-06">
<img src="images/xoweb_06.png" width="164" height="81" alt="">
</div>
<div id="xoweb-07"> <a href="#" target="_self"><img src="images/xoweb_07.png" alt="" width="95" height="33" border="0" id="Image4" onMouseOver="MM_swapImage('Image4','','images/xoweb_over_07.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-08"> <a href="#" target="_self"><img src="images/xoweb_08.png" alt="" width="60" height="33" border="0" id="Image5" onMouseOver="MM_swapImage('Image5','','images/xoweb_over_08.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-09"> <a href="http://www.xo-gaming.com/forum/viewforum.php?f=8" target="_self"><img src="images/xoweb_09.png" alt="" width="61" height="33" border="0" id="Image6" onMouseOver="MM_swapImage('Image6','','images/xoweb_over_09.png',1)" onMouseOut="MM_swapImgRestore()"></a>
</div>
<div id="xoweb-10">
<img src="images/xoweb_10.png" width="192" height="81" alt="">
</div>
<div id="xoweb-11">
<img src="images/xoweb_11.png" width="218" height="48" alt="">
</div>
<div id="xoweb-12">
<img src="images/xoweb_12.png" width="216" height="48" alt="">
</div>
<div id="xoweb-13" align="left" >
<br><?php
/*
* home.php
* Description: example file for displaying latest posts and topics
* by battye (for phpBB.com MOD Team)
* September 29, 2009
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
/* create_where_clauses( int[] gen_id, String type )
* This function outputs an SQL WHERE statement for use when grabbing
* posts and topics */
function create_where_clauses($gen_id, $type)
{
global $db, $auth;
$size_gen_id = sizeof($gen_id);
switch($type)
{
case 'forum':
$type = 'forum_id';
break;
case 'topic':
$type = 'topic_id';
break;
default:
trigger_error('No type defined');
}
// Set $out_where to nothing, this will be used of the gen_id
// size is empty, in other words "grab from anywhere" with
// no restrictions
$out_where = '';
if( $size_gen_id > 0 )
{
// Get a list of all forums the user has permissions to read
$auth_f_read = array_keys($auth->acl_getf('f_read', true));
if( $type == 'topic_id' )
{
$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $gen_id) . '
AND ' . $db->sql_in_set('forum_id', $auth_f_read);
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
// Create an array with all acceptable topic ids
$topic_id_list[] = $row['topic_id'];
}
unset($gen_id);
$gen_id = $topic_id_list;
$size_gen_id = sizeof($gen_id);
}
$j = 0;
for( $i = 0; $i < $size_gen_id; $i++ )
{
$id_check = (int) $gen_id[$i];
// If the type is topic, all checks have been made and the query can start to be built
if( $type == 'topic_id' )
{
$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
}
// If the type is forum, do the check to make sure the user has read permissions
else if( $type == 'forum_id' && $auth->acl_get('f_read', $id_check) )
{
$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
}
$j++;
}
}
if( $out_where == '' && $size_gen_id > 0 )
{
trigger_error('A list of topics/forums has not been created');
}
return $out_where;
}
$search_limit = 5;
$forum_id = array(17);
$forum_id_where = create_where_clauses($forum_id, 'forum');
$topic_id = array();
$topic_id_where = create_where_clauses($topic_id, 'topic');
$posts_ary = array(
'SELECT' => 'p.*, t.*',
'FROM' => array(
POSTS_TABLE => 'p',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(TOPICS_TABLE => 't'),
'ON' => 't.topic_first_post_id = p.post_id'
)
),
'WHERE' => str_replace( array('WHERE ', 'forum_id'), array('', 't.forum_id'), $forum_id_where) . '
AND t.topic_status <> ' . ITEM_MOVED . '
AND t.topic_approved = 1',
'ORDER_BY' => 'p.post_id DESC',
);
$posts = $db->sql_build_query('SELECT', $posts_ary);
$posts_result = $db->sql_query_limit($posts, $search_limit);
while( $posts_row = $db->sql_fetchrow($posts_result) )
{
$topic_title = $posts_row['topic_title'];
$topic_author = get_username_string('full', $posts_row['topic_poster'], $posts_row['topic_first_poster_name'], $posts_row['topic_first_poster_colour']);
$post_date = $user->format_date($posts_row['post_time']);
$post_link = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $posts_row['post_id'] . "#p" . $posts_row['post_id']);
$post_text = nl2br($posts_row['post_text']);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
$bbcode->bbcode_second_pass($post_text, $posts_row['bbcode_uid'], $posts_row['bbcode_bitfield']);
$post_text = smiley_text($post_text);
$template->assign_block_vars('announcements', array(
'TOPIC_TITLE' => censor_text($topic_title),
'POST_AUTHOR' => $post_author,
'POST_DATE' => $post_date,
'POST_LINK' => $post_link,
'POST_TEXT' => censor_text($post_text),
));
}
$template->set_filenames(array(
'body' => 'external_body.html'
));
?>
<center>© 2011 <a href="http://www.xo-gaming.com/">Team xO,</a> <a href="http://www.thegiftedape.com">TheGiftedApe llc.</a></center></div>
</center>
</body>
</html>
Php only portion:
Code: Select all
<?php
/*
* home.php
* Description: example file for displaying latest posts and topics
* by battye (for phpBB.com MOD Team)
* September 29, 2009
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
/* create_where_clauses( int[] gen_id, String type )
* This function outputs an SQL WHERE statement for use when grabbing
* posts and topics */
function create_where_clauses($gen_id, $type)
{
global $db, $auth;
$size_gen_id = sizeof($gen_id);
switch($type)
{
case 'forum':
$type = 'forum_id';
break;
case 'topic':
$type = 'topic_id';
break;
default:
trigger_error('No type defined');
}
// Set $out_where to nothing, this will be used of the gen_id
// size is empty, in other words "grab from anywhere" with
// no restrictions
$out_where = '';
if( $size_gen_id > 0 )
{
// Get a list of all forums the user has permissions to read
$auth_f_read = array_keys($auth->acl_getf('f_read', true));
if( $type == 'topic_id' )
{
$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $gen_id) . '
AND ' . $db->sql_in_set('forum_id', $auth_f_read);
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
// Create an array with all acceptable topic ids
$topic_id_list[] = $row['topic_id'];
}
unset($gen_id);
$gen_id = $topic_id_list;
$size_gen_id = sizeof($gen_id);
}
$j = 0;
for( $i = 0; $i < $size_gen_id; $i++ )
{
$id_check = (int) $gen_id[$i];
// If the type is topic, all checks have been made and the query can start to be built
if( $type == 'topic_id' )
{
$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
}
// If the type is forum, do the check to make sure the user has read permissions
else if( $type == 'forum_id' && $auth->acl_get('f_read', $id_check) )
{
$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
}
$j++;
}
}
if( $out_where == '' && $size_gen_id > 0 )
{
trigger_error('A list of topics/forums has not been created');
}
return $out_where;
}
$search_limit = 5;
$forum_id = array(17);
$forum_id_where = create_where_clauses($forum_id, 'forum');
$topic_id = array();
$topic_id_where = create_where_clauses($topic_id, 'topic');
$posts_ary = array(
'SELECT' => 'p.*, t.*',
'FROM' => array(
POSTS_TABLE => 'p',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(TOPICS_TABLE => 't'),
'ON' => 't.topic_first_post_id = p.post_id'
)
),
'WHERE' => str_replace( array('WHERE ', 'forum_id'), array('', 't.forum_id'), $forum_id_where) . '
AND t.topic_status <> ' . ITEM_MOVED . '
AND t.topic_approved = 1',
'ORDER_BY' => 'p.post_id DESC',
);
$posts = $db->sql_build_query('SELECT', $posts_ary);
$posts_result = $db->sql_query_limit($posts, $search_limit);
while( $posts_row = $db->sql_fetchrow($posts_result) )
{
$topic_title = $posts_row['topic_title'];
$topic_author = get_username_string('full', $posts_row['topic_poster'], $posts_row['topic_first_poster_name'], $posts_row['topic_first_poster_colour']);
$post_date = $user->format_date($posts_row['post_time']);
$post_link = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $posts_row['post_id'] . "#p" . $posts_row['post_id']);
$post_text = nl2br($posts_row['post_text']);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
$bbcode->bbcode_second_pass($post_text, $posts_row['bbcode_uid'], $posts_row['bbcode_bitfield']);
$post_text = smiley_text($post_text);
$template->assign_block_vars('announcements', array(
'TOPIC_TITLE' => censor_text($topic_title),
'POST_AUTHOR' => $post_author,
'POST_DATE' => $post_date,
'POST_LINK' => $post_link,
'POST_TEXT' => censor_text($post_text),
));
}
$template->set_filenames(array(
'body' => 'external_body.html'
));
?>
Get back to me whenever you can, I really appreciate everything I am learning a lot of things that will help me down the road that I can apply to other sites I work on, thx thx thx!
another edit: I have tried Placing all the css in a seperate stylesheet and linking it, and using ?php include=news.php and putting the php in the news.php file, still get the error. I've tried putting all the css on the external_body file and still error, AHHHHH!!!

.
If I use this code: it displays(still with error)
Code: Select all
$template->set_filenames(array(
'body' => 'external_body.html'
));
page_footer();
If I just use this code, nothing displays at all except the error.
Code: Select all
$template->set_filenames(array(
'body' => 'external_body.html'
));