Pravda v očích.cz

Navigace:Pravda v očích.czPHP ⇒ 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…
phpbb own styles, the sims2 plná verze, karikatury pres internet, phpbb pages, ceske kabelove programi ke stahnutiu zdarma cz, how create your forum, the gta place, forum deredes, original setup on gta san andreas, the sims2 save soubor,

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();
?>


First, we call all the necessary functions and methods that phpBB calls for the establishment of sessions and styles. After only find the variable p for create from the name of the template, which require. If not p variable exists or has zero value, is returned header 404 (Not found) and redirected back to the main page forum.

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....


To view this page you will then only be sufficient to call a set page.php, in this case as follows:

http://adress_of_your_forum.com/page.php?p=mypage

autor Jakub Dvořák | cal 2.7.2008 | Vše o PHP - seriály, tipy a triky.... PHP |

Kometáře


Zatim tu nejsou žádný (schválené) kometáře.
Nové kometáře nejsou povolené.

Související články

NX7600GT T2D256E 256MB PCI E cena cheaty na playstation 2 the sims 2 online filmy tlusty albert mozila se zasekává mixazni pult ke staženi zdarma virtual pult přeindexování databáze mysql motivy na firevox dj virtual downoland stahování z firefox

Pravda v očích

© 2012 Copyright Pravdavocich.cz Jakub Dvořák Zásady ochrany osobních údajů. Stránka generována 08.02. 2012, 16:40:53 za 0,0883s