here is a small guide on how to adapt some phpBB 3 code to Icy Phoenix.
This how to doesn't include all possible code and combination, but it is just a small reference on the core vars and functions you are likely to find on almost every phpBB 3 page.
This guide may also result useful when trying to port phpBB 3 MODs to Icy Phoenix.
I have also added a file that could help you into the converting process, by automatically converting some basic phpBB 3 vars, functions and classes into Icy Phoenix ones. This file will be included in standard package of Icy Phoenix for the benefit of all who want to use it.
How to use the file?
Put it into includes folder and include it where needed:
FIND:
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
ADD AFTER:
include(IP_ROOT_PATH . 'includes/functions_phpbb3_to_ip.' . PHP_EXT);
____________________________
CONVERSION GUIDE
____________________________
Files Header
FIND
<?php
/**
*
* @package phpBB3
* @version $Id: index.php 8987 2008-10-09 14:17:02Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
/**
*/
?>
/**
*
* @package phpBB3
* @version $Id: index.php 8987 2008-10-09 14:17:02Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
/**
*/
?>
REPLACE WITH
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
?>
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
?>
Global Var
FIND
REPLACE WITH
Global Page Startup
FIND
<?php
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);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
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);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
REPLACE WITH
<?php
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// End session management
?>
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// End session management
?>
Language Inclusion
FIND
REPLACE WITH
<?php
include(IP_ROOT_PATH . 'language/lang_' . $board_config['default_lang'] . '/YOUR_LANG_FILE.' . PHP_EXT);
?>
include(IP_ROOT_PATH . 'language/lang_' . $board_config['default_lang'] . '/YOUR_LANG_FILE.' . PHP_EXT);
?>
Some Vars
FIND
REPLACE WITH
FIND
REPLACE WITH
FIND
REPLACE WITH
FIND (SIMILAR)
REPLACE WITH (SIMILAR)
FIND (SIMILAR)
REPLACE WITH (SIMILAR)
FIND (SIMILAR)
REPLACE WITH (SIMILAR)
FIND (SIMILAR)
REPLACE WITH (SIMILAR)
Page Header
FIND
REPLACE WITH
<?php
$page_title = $l_title;
$meta_description = '';
$meta_keywords = '';
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
?>
$page_title = $l_title;
$meta_description = '';
$meta_keywords = '';
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
?>
Page Body
FIND
REPLACE WITH
<?php
$template->set_filenames(array('body' => 'foo_body.tpl'));
$template->pparse('body');
?>
$template->set_filenames(array('body' => 'foo_body.tpl'));
$template->pparse('body');
?>
Page Footer
FIND
REPLACE WITH
Die Message
Please note that trigger_error has been implemented also in Icy Phoenix so you don't necessarily need to replace this.
FIND
REPLACE WITH
<?php
message_die(GENERAL_MESSAGE, $lang['LANG_VAR_MESSAGE'], $lang['LANG_VAR_TITLE'], __LINE__, __FILE__)
?>
message_die(GENERAL_MESSAGE, $lang['LANG_VAR_MESSAGE'], $lang['LANG_VAR_TITLE'], __LINE__, __FILE__)
?>
Basic SQL Query
FIND
REPLACE WITH
<?php
$result = $db->sql_query($sql);
if(!$result)
{
message_die(...);
}
?>
$result = $db->sql_query($sql);
if(!$result)
{
message_die(...);
}
?>
Login
FIND
<?php
login_box("foo.$phpEx?var=my_var", $user->lang['LOGIN_FOO']);
?>
login_box("foo.$phpEx?var=my_var", $user->lang['LOGIN_FOO']);
?>
REPLACE WITH
<?php
redirect(append_sid(LOGIN_MG . '?redirect=foo.' . PHP_EXT . '&var=my_var', true))
?>
redirect(append_sid(LOGIN_MG . '?redirect=foo.' . PHP_EXT . '&var=my_var', true))
?>
AUTH
FIND
REPLACE WITH
<?php
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if($is_auth['auth_reply'])
{
//do something
}
?>
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if($is_auth['auth_reply'])
{
//do something
}
?>
FIND
REPLACE WITH
Dates
FIND
REPLACE WITH
<?php
create_date_ip($board_config['default_dateformat'], $your_timestamp, $board_config['board_timezone']);
?>
create_date_ip($board_config['default_dateformat'], $your_timestamp, $board_config['board_timezone']);
?>
functions_phpbb3_to_ip.zip | ||
Description: | Function to convert some basics phpBB 3 vars, function and classes into Icy Phoenix ones. It is not perfect and / or complete... but it can be useful. | Download |
Filename: | functions_phpbb3_to_ip.zip | |
Filesize: | 2.51 KB | |
Downloaded: | 577 Time(s) |