Icy Phoenix

     
 


Tags And Keywordsconversion, icy phoenix, phpbb, porting

Post new topic  Reply to topic 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post CONVERSION - How To Convert phpBB 3 Code To Icy Phoenix [NOT VALID FOR IP 2.0] 
 
Hi all,
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:
Code: [Download] [Hide] [Select]
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);


ADD AFTER:
Code: [Download] [Hide] [Select]
include(IP_ROOT_PATH . 'includes/functions_phpbb3_to_ip.' . PHP_EXT);



____________________________

CONVERSION GUIDE
____________________________






Files Header

FIND
Code: [Download] [Hide] [Select]
<?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
*
*/

/**
*/
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
?>





Global Var

FIND
Code: [Download] [Hide] [Select]
<?php
if (!defined('IN_PHPBB'))
{
    exit;
}
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
if (!defined('IN_ICYPHOENIX'))
{
    die(
'Hacking attempt');
}
?>





Global Page Startup

FIND
Code: [Download] [Hide] [Select]
<?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();
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?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
?>





Language Inclusion

FIND
Code: [Download] [Hide] [Select]
<?php
$user
->add_lang(array('YOUR_LANG_FILE'));
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
include(IP_ROOT_PATH . 'language/lang_' . $board_config['default_lang'] . '/YOUR_LANG_FILE.' . PHP_EXT);
?>





Some Vars

FIND
Code: [Download] [Hide] [Select]
<?php
$phpbb_root_path
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
IP_ROOT_PATH
?>



FIND
Code: [Download] [Hide] [Select]
<?php
$phpEx
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
PHP_EXT
?>



FIND
Code: [Download] [Hide] [Select]
<?php
"{$phpbb_root_path}index.$phpEx"
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
IP_ROOT_PATH
. 'index.' . PHP_EXT
?>



FIND (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$user
->data['user_id']
?>


REPLACE WITH (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$userdata
['user_id']
?>



FIND (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$user
->data['is_registered']
?>


REPLACE WITH (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$userdata
['session_logged_in']
?>



FIND (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$config
['CONFIG_VAR']
?>


REPLACE WITH (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$board_config
['CONFIG_VAR']
?>



FIND (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$user
->lang['LANG_TEXT']
?>


REPLACE WITH (SIMILAR)
Code: [Download] [Hide] [Select]
<?php
$lang
['LANG_TEXT']
?>





Page Header

FIND
Code: [Download] [Hide] [Select]
<?php
page_header
($l_title);
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
$page_title
= $l_title;
$meta_description = '';
$meta_keywords = '';
include(
IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
?>





Page Body

FIND
Code: [Download] [Hide] [Select]
<?php
$template
->set_filenames(array('body' => 'foo_body.html'));
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
$template
->set_filenames(array('body' => 'foo_body.tpl'));
$template->pparse('body');
?>





Page Footer

FIND
Code: [Download] [Hide] [Select]
<?php
page_footer
();
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);
?>





Die Message

Please note that trigger_error has been implemented also in Icy Phoenix so you don't necessarily need to replace this.

FIND
Code: [Download] [Hide] [Select]
<?php
trigger_error
('LANG_VAR_MESSAGE');
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
message_die
(GENERAL_MESSAGE, $lang['LANG_VAR_MESSAGE'], $lang['LANG_VAR_TITLE'], __LINE__, __FILE__)
?>





Basic SQL Query

FIND
Code: [Download] [Hide] [Select]
<?php
$result
= $db->sql_query($sql);
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
$result
= $db->sql_query($sql);
if(!
$result)
{
    
message_die(...);
}
?>





Login

FIND
Code: [Download] [Hide] [Select]
<?php
login_box
("foo.$phpEx?var=my_var", $user->lang['LOGIN_FOO']);
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
redirect
(append_sid(LOGIN_MG . '?redirect=foo.' . PHP_EXT . '&var=my_var', true))
?>





AUTH

FIND
Code: [Download] [Hide] [Select]
<?php
if ($auth->acl_get('f_reply', $forum_id))
{
    
//do something
}
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
$is_auth
= array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if(
$is_auth['auth_reply'])
{
    
//do something
}
?>



FIND
Code: [Download] [Hide] [Select]
<?php
if ($auth->acl_get('a_foo'))
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
if($userdata['user_level'] == ADMIN)
?>






Dates

FIND
Code: [Download] [Hide] [Select]
<?php
$user
->format_date($your_timestamp);
?>


REPLACE WITH
Code: [Download] [Hide] [Select]
<?php
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: 531 Time(s)

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Edited by Mighty Gorgon, Sat 29 Aug, 2009 09:10: Attachment updated
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
Big thank´s for this useful Doc. MG

There´s some thing´s i could´nt solve in a mod i´m trying to port,
But with this i think i can solve it.

Thank´s again MG

Edit :

question: what to do with the html-files that use to come with PhpBB3 Mod´s.

Just rename them to tpl or what ?
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
spydie wrote: [View Post]


question: what to do with the html-files that use to come with PhpBB3 Mod´s.

Just rename them to tpl or what ?


yep without having tested thats what  i would do....


thanks MG a very useful topic... will save a lot of problems...

   
 




____________
Mods and themes for Icy Phoenix 1.3

IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
thank´s DWho.

FYI i´ve allready done it and it work´s
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
spydie wrote: [View Post]
thank´s DWho.

FYI i´ve allready done it and it work´s


cool

   
 




____________
Mods and themes for Icy Phoenix 1.3

IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert phpBB 3 Code To Icy Phoenix 
 
I've also added a file that you can use to convert some standard phpBB 3 vars, functions or classes... so if you forget to convert something, or don't know how to do that... with this class you may hopefully solve some problems.

If course... it would be better to manually convert what needed... but just in case you don't have the skill...

If someone uses it, please let me know...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
thank´s MG . I´ll give this a try, cause i´m still stuck with this countdown date stuff

Edit:

Got to do this because the server want let me post before another 6 hrs.

Hi MG

Gave your little function script a try on my local test enviorment.

something funny happend.

get 5  errors from common file

I took an original PHPBB3 script off the MOD i´m trying to port, just for testing your script.

Put the include in all necesary files, went to my local server, and called the page up .

result was :

Quote:
Warning: include(IP_ROOT_PATHctracker/engines/ct_security.PHP_EXT) [function.include]: failed to open stream: No such file or directory in H:\wamp\www\ip_1.3\common.php on line 153

Warning: include() [function.include]: Failed opening 'IP_ROOT_PATHctracker/engines/ct_security.PHP_EXT' for inclusion (include_path='.;C:\php5\pear') in H:\wamp\www\ip_1.3\common.php on line 153

Warning: include(IP_ROOT_PATHconfig.PHP_EXT) [function.include]: failed to open stream: No such file or directory in H:\wamp\www\ip_1.3\common.php on line 257

Warning: include() [function.include]: Failed opening 'IP_ROOT_PATHconfig.PHP_EXT' for inclusion (include_path='.;C:\php5\pear') in H:\wamp\www\ip_1.3\common.php on line 257

Warning: Cannot modify header information - headers already sent by (output started at H:\wamp\www\ip_1.3\common.php:153) in H:\wamp\www\ip_1.3\common.php on line 261

 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert PhpBB 3 Code To Icy Phoenix 
 
i gave that script thingy a try and i get
Code: [Download] [Hide] [Select]
Parse error: syntax error, unexpected ')' in public_html/forums/functions_phpbb3_to_ip.php on line 242


my problem is that i dont know enough about php to know why...  and because i dont know enough, is why i tried to use it.  (lets just say i know enough to have messed up my forums enough times to know why and how i break things, and can usually fix them)  I am trying to use this to get a phpbb3 mod working, but i will head over to the right forum to ask my questions about that.
 



 
glitchiesSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Convert phpBB 3 Code To Icy Phoenix 
 
I have updated the attachment... please try again.


spydie, you didn't define the constants in your file... check IP_ROOT_PATH and PHP_EXT.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert PhpBB 3 Code To Icy Phoenix 
 
outsch

thanks MG
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert PhpBB 3 Code To Icy Phoenix 
 
Silly question but isn't replacing the phpbb copyright or any copyright for that matter with your own as this how to guide shows a GPL violation?
 



 
sollordSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert PhpBB 3 Code To Icy Phoenix 
 
sollord wrote: [View Post]
Silly question but isn't replacing the phpbb copyright or any copyright for that matter with your own as this how to guide shows a GPL violation?


you are not replacing the phpbb copyright ... you are making a mod that is ported from phpbb... as phpbb.com "states you can remove our copyright notices form your forum but please do not ask for support..."

though that is totally irrelavant from porting a mod from phpbb to icyphoenix... as all icyphoenix sites have phpbb copyright in the footer on every page..

   
 




____________
Mods and themes for Icy Phoenix 1.3

IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert phpBB 3 Code To Icy Phoenix 
 
Please note that I have not removed phpBB copyright which is still printed in the footer, and that is the copyright that should not be removed.

The commented string is only for developmental purpose, and all edits in the header are just performed to have all file corrected identified by the SVN system.

Original phpBB copyright is untouched and is still in page footer where it has to be.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert PhpBB 3 Code To Icy Phoenix 
 
question MG

what to do with this salt thing in PhpBB3 mods?

I´ve tried just deleting that line but that does´nt work like i want it
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: CONVERSION - How To Convert phpBB 3 Code To Icy Phoenix 
 
Do you mean the form salt?

Open a new topic with an example and I'll help there.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron