Navigace:Pravda v očích.cz ⇒ PHP ⇒ How to create your own page in phpBB 3
How to create your own page in phpBB 3
This is the English translation of the original article Jak vytvořit vlastní stránku v phpBB 3. Each operator of forum on phpBB 3 (and earlier versions) sometimes put a question on how to create your own "static" page, where could place the necessary contact information or sponsorship of the…This is the English translation of the original article Jak vytvořit vlastní stránku v phpBB 3.
Each operator of forum on phpBB 3 (and earlier versions) sometimes put a question on how to create your own "static" page, where could place the necessary contact information or sponsorship of the forum. Today I have need it to Poradna pro hrace and so I wrote a small universal script, which is transmitted GET variable of name of the page that call. Code then creates structure of phpBB style and entered into by the variable page template, which we have imposed in the styles / (name of style) / template. Such own page may look like this.
Code of page.php
# Universal script for calls static pages
# Used methods phpBB 3 - Copyright 2000-2008 phpbb.com
# Created by Jakub Dvorak - http://pravdavocich.cz, http://www.pravdavocich.cz
# Copyright 2008 Jakub Dvorak, phpBB
# This code is free under GNUGPL
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup('common');
page_header("Forum");
$zadame = $_GET['p'];
$volame = "extra_" . $zadame . ".html";
if (! $_GET['p']) {
header("HTTP/1.1 404 Not Found");
header("Location: http://yourforum.com");
header("Connection: close");
}
$template->set_filenames(array(
'body' => $volame
));
// parse page:
page_footer();
?>
Example
Create in a directory of styles / (the name of the style that you are using) / template file called extra_mypage.html. In her appearance will be stored static pages, for example, that:
my page
etc etc etc....
Kometáře
Související články
- How to create your own page in phpBB 3
- phpBB - přefórováno?
- Finální phpBB 3 už příští týden!
- Finální verze phpBB 3 vyšla!
- Jak vytvořit vlastní stránku v phpBB 3
Jakub Dvořák |
2.7.2008 |