CoC wrote:Just a question is it possible to use language files outside of the forum directory?
The problem is that the languages are relative to language/{lang}/. You could overwrite $user->lang_path, but only do so if you know what you're doing

CoC wrote:Just a question is it possible to use language files outside of the forum directory?


<?php in your 404error.php file.<?php)




/www/www/phpBB3/www/common.php<?php
/**
*
* @author David Lewis ( http://startrekguide.com ) Highway of Life
* @package STG
* @version $Id: common.php 165 2007-12-23 05:21:41Z Highway of Life $
* @copyright (c) 2007 Star Trek Guide Group
*
*/
if (!defined('IN_PHPBB') || !defined('ROOT_PATH'))
{
exit;
}
/**
* @ignore
*/
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . 'phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include(ROOT_PATH . 'includes/functions_website.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
// void setup ([ $lang_set = false], [ $style = false])
// language and style setup, we?ll use $style = 1 (prosilver)
$user->setup(false, 1);
// set your custom template path
// void set_custom_template ( $template_path, $template_name)
$template->set_custom_template(ROOT_PATH . 'template', 'website');
// Set some basic (global) template variables
$template->assign_vars(array(
'U_WEBSITE_STYLESHEET' => ROOT_PATH . 'theme/stylesheet.css',
'U_HOME' => append_sid(ROOT_PATH),
'U_FORUM' => append_sid($phpbb_root_path),
));
?>/www/includes/functions_website.php<?php
/**
*
* @package STG
* @version $Id: functions_website.php 240 2008-01-04 01:35:39Z Highway of Life $
* @copyright (c) 2007 Star Trek Guide Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Log Error
* Error types are standard HTTP error codes (404, 403, 500 etc)
*
* @param int $error_type
*/
function log_error($error_type = 500)
{
global $user, $phpbb_root_path;
$error_timestamp = date('d-M-Y H:i:s Z');
$user_ip = $user->ip;
$user_page = $user->page['page'];
$referer = (isset($_SERVER['HTTP_REFERER'])) ? ' [Referer ' . $_SERVER['HTTP_REFERER'] . ']' : '';
error_log("[$error_timestamp] [$error_type Error] [Client $user_ip] [File $user_page]$referer \n", 3, $phpbb_root_path . 'store/http_error.log');
}
?>/www/theme/stylesheet.css/**
*
* @package STG
* @version $Id$
* @copyright (c) 2007 Star Trek Guide Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/* Some CSS styles for your website (specifically) */
/www/errordocs/500error.php<?php
/**
*
* @package phpBB3
* @version $Id: 404error.php 295 2008-01-14 15:28:34Z Highway of Life $
* @copyright (c) 2007 Star Trek Guide Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
define('ROOT_PATH', './../');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include(ROOT_PATH . 'common.' . $phpEx);
// since we?re only using one language (en), I?ll just hardcode this...
// void page_header ([ $page_title = ''], [ $display_online_list = true])
page_header('500 Error - Internal server error', false);
// this template file will be located in the custom templates directory
$template->set_filenames(array(
'body' => 'errordocs/500_error.html'
));
// log the error
// void log_error ([ $error_type = 500])
log_error(500);
// void page_footer ([ $run_cron = true])
page_footer(false);
?>/www/template/errordocs/500_error.html<!-- INCLUDE overall_header.html -->
<ul class="linklist navlinks">
<li><a href="{U_HOME}">Home</a></li>
</ul>
<div id="main">
<h2 class="imgrep error500">Error 500: Internal server error</h2>
<h3>The Page you have requested was destroyed.</h3>
<p>Our internal server have went to picnic with his family. Hell be back at 5 am.</p>
</div>
<!-- INCLUDE overall_footer.html --> /www/.htaccess (assuming one does not already exist)ErrorDocument 500 /errordocs/500error.php

define('ROOT_PATH', './../'); 

define('ROOT_PATH', './'); define('ROOT_PATH', './../'); define('ROOT_PATH', './../../'); define('ROOT_PATH', './../../../'); 

if (!defined('IN_PHPBB') || !define('ROOT_PATH'))
{
exit;
}
/**
* @ignore
*/
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . 'forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include(ROOT_PATH . 'include/functions_website.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . 'phpBB3/';$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . 'forum/';// Start session management
$user->session_begin();
$auth->acl($user->data);
// void setup ([ $lang_set = false], [ $style = false])
// language and style setup, we?ll use $style = 1 (prosilver)
//$user->setup(false, 1);
// set your custom template path
// void set_custom_template ( $template_path, $template_name)
//$template->set_custom_template(ROOT_PATH . 'template', 'website');
// Set some basic (global) template variables
//$template->assign_vars(array(
// 'U_WEBSITE_STYLESHEET' => ROOT_PATH . 'theme/stylesheet.css',
// 'U_HOME' => append_sid(ROOT_PATH),
// 'U_FORUM' => append_sid($phpbb_root_path),
//));
?>



Return to Tutorials and How-Tos
Users browsing this forum: No registered users and 6 guests