Help me finish borrowing my forum's header/footer template?

Discussion forum for MOD Writers regarding MOD Development.
Locked
schwim
Registered User
Posts: 120
Joined: Sat Jun 04, 2005 8:03 am

Help me finish borrowing my forum's header/footer template?

Post by schwim » Fri Nov 08, 2013 11:32 pm

Hi there everyone!

I've managed to make a blank page outside of the forum utiilizing my forum's theme.

Page: http://aircooledaddiction.com/portal.php
Forum: http://aircooledaddiction.com/forum

My code:

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/
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/functions_display.' . $phpEx);

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

// Output page
page_header();

$template->set_filenames(array(
	'body' => 'blank.html')
);

<I would like to place my own php/html code here!>

page_footer();

?>
If you look at the code above, you will see where I've marked "<I would like to place my own php/html code here!>". I would like to add my own code to this page at this spot, but when I try, it breaks the look of the page. For instance, I tried placing

Code: Select all

echo("this is a test.");
in the place of <I would like to place my own php/html code here!> but it caused this problem:

http://www.aircooledaddiction.com/portal2.php

It just broke the style and nothing showed up.

I know you are supposed to write mods for this type of thing, but could anyone tell me how I might simply make my own pages outside the forum using the header and footer, without adding additional files inside /forum?

Thanks for your time!
Last edited by Oyabun1 on Sat Nov 09, 2013 1:34 am, edited 1 time in total.
Reason: Moved from Support

Danielx64
Registered User
Posts: 1369
Joined: Wed Nov 04, 2009 5:51 am
Location: In a server room in Australia
Name: Daniel
Contact:

Re: Help me finish borrowing my forum's header/footer templa

Post by Danielx64 » Sat Nov 09, 2013 12:09 am

Inside your blank.html file, you need to include the header and footer from your style by including overall_header.html and overall_footer.html.

Also it best to start here: Add a New Custom Page to phpBB
Please note that I will not be porting any of my mods to phpBB 3.1. Sorry for the inconvenience this may cause.
Image

schwim
Registered User
Posts: 120
Joined: Sat Jun 04, 2005 8:03 am

Re: Help me finish borrowing my forum's header/footer templa

Post by schwim » Sat Nov 09, 2013 4:01 am

*Daniel wrote:Inside your blank.html file, you need to include the header and footer from your style by including overall_header.html and overall_footer.html.

Also it best to start here: Add a New Custom Page to phpBB
Thanks very much for the reply, but I've already got the header and footer included(see links). I've read the tutorial linked in your post, but I'm trying to add content directly to portal.php and not inside any files found in /forum. Is that possible?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66908
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Help me finish borrowing my forum's header/footer templa

Post by Lumpy Burgertushie » Sat Nov 09, 2013 5:52 am

anything is possible but why do it the hard way. if you are using phpbb code then go ahead and follow that article about how to create new phpbb pages with a simple php file that calls the template/html file and put all your html/css in that file.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: Help me finish borrowing my forum's header/footer templa

Post by John P » Sat Nov 09, 2013 6:00 am

It's not that difficult.
Replace <I would like to place my own php/html code here!> with:

Code: Select all

        $template->assign_vars(array(
            'TEXT'        => 'Here my text')
        );
Put it before // Output page

In your blank.html you display Here my tekst with the templatevariable {TEXT}
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

schwim
Registered User
Posts: 120
Joined: Sat Jun 04, 2005 8:03 am

Re: Help me finish borrowing my forum's header/footer templa

Post by schwim » Sat Nov 09, 2013 1:40 pm

Thanks everyone, for your help!
John P wrote:It's not that difficult.
Replace <I would like to place my own php/html code here!> with:

Code: Select all

        $template->assign_vars(array(
            'TEXT'        => 'Here my text')
        );
 
Put it before // Output page

In your blank.html you display Here my tekst with the templatevariable {TEXT}
I'm trying to use php however, and that is failing using the method you posted. That's the part I'm really failing at. I'll read the tutorial again and work on it some more this morning.

Thanks again for all your help.

User avatar
eeji
Jr. Style Validator
Posts: 1137
Joined: Fri Dec 12, 2008 9:08 pm
Location: Manchester, UK
Contact:

Re: Help me finish borrowing my forum's header/footer templa

Post by eeji » Mon Nov 25, 2013 11:38 pm

if you output stuff in the .php files (any html, echo, print, print_r etc etc) it will be parsed before the template and will appear above the overall_header.html output. You will find it will probably also break the template so things either won't display properly or not at all.
My phpBB styles: phpbbstyles.oo.gd
My board: iansvivarium.com

Locked

Return to “[3.0.x] MOD Writers Discussion”