Making the style load outside of phpbb but with no header

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
Psychoparot
Registered User
Posts: 2
Joined: Fri Nov 04, 2005 4:53 pm

Making the style load outside of phpbb but with no header

Post by Psychoparot »

I'm not entirely sure if this constitutes asking for support. Sorry if I was wrong to ask.

I made a simple php script and it's template file that had just a single table in it with some jibberish written into the cells. I have the php file (index.php) outside of the main phpbb directory (since at some stage when phpbb3 is out and I am devloping a site using it, i want to keep the board completely seperate from the rest of the site, but I still want to use the same style across the site).

I got the style to load outside of phpbb easily enough, Was just a case of altering the route path in the define in phpbb section of code in the file. However upon loading, it loads the great big header with the massive phpbb logo and all the forum links. I had simple 'borrowed' code from the index.php of the actual board, so I inspected it and figured if I just remove the output page code where it says header and footer, it'll be alright.

It wasn't. Without the header line the page failed to load at all (just came up blank). Did I do something wrong?

Incidentally will their be a much more in-depth styling guid made when phpbb3 get's released? the 'simple' guide psoTFX made is a bit too simple (either that or I'm too simple to understand it).

Tullamore
Registered User
Posts: 112
Joined: Wed Mar 24, 2004 6:56 am

Re: Making the style load outside of phpbb but with no heade

Post by Tullamore »

Use the template files and the css instead of the php.
.

DoD
Registered User
Posts: 360
Joined: Sat Aug 30, 2003 11:32 am

Re: Making the style load outside of phpbb but with no heade

Post by DoD »

The template system no longer relies upon page_header to output the leader. It is all now within the template file, through includes. Just take a look at the template files you're using...

tiger2kn5
Registered User
Posts: 49
Joined: Tue Jul 10, 2001 2:59 am
Location: US of A

Re: Making the style load outside of phpbb but with no heade

Post by tiger2kn5 »

Its actually quite simple, I will post how its done when i get home, Im at work right now. I would post a link to my site which im doing this already, but apperently thats spaming.

Oh, i though ill tell you that the template filename needs to be inside the respective style's directory. There was a commit about a function that would allow u to change the directory of where to look for template but i haven't read into it. So if your make sure that the template file is in "subSilver/templates/" or whatever style you created.
Image

tiger2kn5
Registered User
Posts: 49
Joined: Tue Jul 10, 2001 2:59 am
Location: US of A

Re: Making the style load outside of phpbb but with no heade

Post by tiger2kn5 »

Ok this is how im doing it

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './phpBB/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();


// ... your code here


// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
    'body' => 'SITE_INDEX_TEMPLATE_FILE')
);

page_footer();

?>
So where it says SITE_INDEX_TEMPLATE_FILE thats would have the name of the template file that you are using on your page. And since you said you didn't want the header, name just take out the <!-- INCLUDE overall_header.html -->
Image

Psychoparot
Registered User
Posts: 2
Joined: Fri Nov 04, 2005 4:53 pm

Re: Making the style load outside of phpbb but with no heade

Post by Psychoparot »

I understand now! My God, you're right it's so simple, I can't believe I was that dumb. By the way I would have replied a lot sooner but I've had Internet trouble, ie, no Internet access for what seems like months.

Anyway, yes, thank you very much all of you, you certainly helped. :)

--- Edit: Okay sorry for being a pain here, but now the template doesn't load at all.

As I said before I have just a simple table with a bit of gibberish in it, and if I have include overall_header in the template file, that table is shown with the subsilver template, but as I now understand (thanks again), it also puts the massive phpbb header on the page. however, if I remove the include from the template file, the header is gone and the gibberish text appears but the table is no longer in the subsilver style, it just shows the text on a blank page. I thought about it and figured perhaps I'd left something else out of the template file, so I thought I'd test tha actual forum index page by doing the same thing (removing the include from index_body.html), and sure enough when you do that the header disappears but so does the rest of the styling leaving just text.

Does this mean I'll have to create a modified overall_header that doesn't have the actual phpbb header information, and put that in along with overall_header (so I'll duplicate it, remove some code then save it as portal_header or something, then link to it from the portal index file) or have I done something else wrong?

------Edit edit: oops, okay never mind I just did what I said and it works now.

I just duplicated overall_header.html, kept the bit upto </style> and deleted the rest, saved it as portal_header.html, then put in the portal_idex.html file <-- Include portal_header.html --> and popped the two in the subSilver/template/, upon loading the index page the table now loads with the style but without the header. Okay, I'm happy now, I feel like I've leant a whole lot of stuff ina miniscule ammount of time which is very unusual for me.

WOuldn't have been able to do it without your help. Thanks yet again!

Post Reply