Diskussion om denna artikel går att föra - här.
Hur skapar man egna sidor för phpBB3
<forumrot>minsida.php
<forumrot>/styles/<stil>/template/minsida_1.html
<forumrot>/styles/<stil>/template/minsida_2.html
<forumrot>/language/en/minsida.php
<forumrot>/language/sv/minsida.php
_____________________
Spara som <forumrot>minsida.php
Kod: Markera allt
<?php
/**
*
* Din egen sida
*
* Kjell @ www.phpbb-se.com * 2007
*
* Länka som minsida.php?visa=#
* Exempel: minsida.php?visa=sida_1
*
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$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);
// Språkfiler /language/sv(och)en/minsida.php
$user->setup('minsida'); // <-- Kan ändras
switch($_GET['visa'])
{
case 'Sida_1': // <-- Ändra sida_1 till ett lämligt val
$file = 'minsida_1.html'; // <-- Ändra html filens namn.
break;
case 'whois':
$file = 'minsida_2.html';
break;
case 'info':
$file = 'minsida_3.html';
break;
default:
$file = 'minsida_1.html'; //<-- Det här är sidan öppnas utan att välja något.
break;
}
// Vad ska sidan heta i webb-läsaren A-Z 0-9
page_header('Min sida');
$template->set_filenames(array(
'body' => $file)
);
page_footer();
?>
och <forumrot>/language/en/minsida.php
Kod: Markera allt
<?php
/**
*
* yourpage [English]
*
* @package language
* @version $Id: yourpage.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* DO NOT CHANGE
*/
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
'TEXT_VAR' => 'say something special',
'ANOTHER_TEXT_VAR' => 'say something else special',
));
?>
I minsida_1.html kan du välja om du ska ha formaterad eller oformaterad html.
Spara som <forumrot>/styles/<stil>/template/minsida_1.html
Kod: Markera allt
<!-- INCLUDE overall_header.html -->
<div>{L_TEXT_VAR}</div>
<div>{L_ANOTHER_TEXT_VAR}</div>
<!-- INCLUDE overall_footer.html -->