1
Mods & Plugins (Releases & Support) / [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« on: October 07, 2009, 03:00:33 PM »
IMPORTANT NOTICE: create backups BEFORE applying this mod to your applications!
Index
Introduction
This mod allows to use both 4images and phpBB application transparently for users as they are one application. Registration and login are handling by the phpBB app, users are creating into 4images database “on-the-fly”, on first request of any of the 4images pages by logged in user.
Demo
http://bridge.boxup.us/
4images (ver. 1.7.7) + phpBB (ver. 3.0.7) updated on 4th March 2010
List of changed files
New files:
includes/phpbb.php
includes/phpbb_sessions.php
Modified:
config.php
includes/sessions.php
includes/page_header.php
admin/admin_global.php
admin/index.php
templates/default/user_loginform.html
Installation
Step 1. New files
Download new files and place them:
a) phpbb.php into includes directory;
b) phpbb_sessions.php into includes directory.
Step 2. config.php
Add at the end of the file, before “?>” symbols:
Where:
<phpbb_root> is relative path from the 4images’ root to phpBB root. For example, if you have installed both apps at the same directory on your server and your phpBB is located into ‘phpBB’ directory, type there: “/../phpBB/” (without quotes). Note, on some servers small and caps letters are differ, so put it exactly as it named.
<phpbb_url> is your phpBB installation relative to the root of server url, as users type it’s address in their web-browsers.
Step 3. includes/sessions.php
Locate somewhere around line 178:
Replace with:
Locate somewhere around line 191:
Replace with:
Locate somewhere around line 418:
Add following code after:
Step 4. includes/page_header.php
Locate:
Add following code right after:
Step 5. admin/admin_global.php
Locate:
Add following code before:
Locate:
Replace with:
Locate:
Replace with:
Step 6. admin/index.php
Locate (at around lines 60-70):
Add following code right between “if ($action == "head") {“ and “?>”:
Locate:
Replace with:
Step 7. templates/default/user_loginform.html
Locate:
Replace with:
Locate:
Replace with:
Locate:
Replace with:
Notes
Please make sure when installing applications you have admin account on both with the same user name and password.
Make sure you checked the topic http://www.4homepages.de/forum/index.php?topic=23892 for the vBulletin bridge, since both bridges are using the same way to work with 4images some questions may be already answered there.
Known issues
Known not to be working if phpBB configured to use mysql driver. Use mysqli instead (http://php.net/manual/en/mysqli.overview.php).
phpBB_installation_path/config.php
When switching bridge off users can’t login to 4images anymore from the native 4images form. However they still exist in 4images database and could request for new password.
After logging off user will be returned to the main page of the forum installation instead of page he was browsing previously.
Version history
0.1 - initial release
0.2 - fixes issue with emptying email address (http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497)
0.3 - fixes issue with wrong register date
0.4 - attempt to fix "blank page" issue (4 Mar 2010)
Extras
Downloadable already modded 4images archive.
Downloadable this instruction in printer friendly pdf.
If you wish to integrate Joomla 1.5, phpBB 3.0 and 4images -- use RokBridge between Joomla and phpBB as known works altogether just fine. Thanks to wingnut for finding it out.
Extending 4images comments with avatars from phpBB from alexeyn1: http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497
Known to work without any issues with Wordpress 3.0.1 (http://www.wp-united.com/get-wp-united/) plugin. Thanks to Benny for finding (http://www.4homepages.de/forum/index.php?topic=26013.msg152103#msg152103).
For downloads please refer to the original post on forum at http://www.4homepages.de/forum/
Index
- Introduction
- Demo
- List of changed files
- Installation
- Notes
- Known issues
- Version history
- Extras
Introduction
This mod allows to use both 4images and phpBB application transparently for users as they are one application. Registration and login are handling by the phpBB app, users are creating into 4images database “on-the-fly”, on first request of any of the 4images pages by logged in user.
Demo
http://bridge.boxup.us/
4images (ver. 1.7.7) + phpBB (ver. 3.0.7) updated on 4th March 2010
List of changed files
New files:
includes/phpbb.php
includes/phpbb_sessions.php
Modified:
config.php
includes/sessions.php
includes/page_header.php
admin/admin_global.php
admin/index.php
templates/default/user_loginform.html
Installation
Step 1. New files
Download new files and place them:
a) phpbb.php into includes directory;
b) phpbb_sessions.php into includes directory.
Step 2. config.php
Add at the end of the file, before “?>” symbols:
Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'<phpbb_root>').'/');
define('PHPBB3_URL', '<phpbb_url>');
Where:
<phpbb_root> is relative path from the 4images’ root to phpBB root. For example, if you have installed both apps at the same directory on your server and your phpBB is located into ‘phpBB’ directory, type there: “/../phpBB/” (without quotes). Note, on some servers small and caps letters are differ, so put it exactly as it named.
<phpbb_url> is your phpBB installation relative to the root of server url, as users type it’s address in their web-browsers.
Step 3. includes/sessions.php
Locate somewhere around line 178:
Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
Replace with:
Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1, $do_md5 = true) {
Locate somewhere around line 191:
Code: [Select]
$user_password = md5($user_password);
Replace with:
Code: [Select]
if($do_md5 == true) $user_password = md5($user_password);
Locate somewhere around line 418:
Code: [Select]
// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();
Add following code after:
Code: [Select]
include_once(realpath(dirname(__FILE__)).'/phpbb.php');
Step 4. includes/page_header.php
Locate:
Code: [Select]
Copyright © 2002-'.date('Y').' <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</p>
',
Add following code right after:
Code: [Select]
"login_user_name_form_field" => (!empty($login_user_name_form_field)) ? $login_user_name_form_field : 'user_name',
"login_user_password_form_field" => (!empty($login_user_password_form_field)) ? $login_user_password_form_field : 'user_password',
"login_auto_form_field" => (!empty($login_auto_form_field)) ? $login_auto_form_field : 'auto_login',
"login_additional_form_fields" => (!empty($login_additional_form_fields)) ? $login_additional_form_fields : '',
Step 5. admin/admin_global.php
Locate:
Code: [Select]
// Include default languages
Add following code before:
Code: [Select]
// Default form
$login_admin_form_action = $site_sess->url(ROOT_PATH."admin/index.php");;
$login_admin_name_form_field = 'loginusername';
$login_admin_password_form_field = 'loginpassword';
$login_admin_additional_form_fields = '';
// Overwrite form if necessary
if(defined('PHPBB3_BRIDGE_ON') && PHPBB3_BRIDGE_ON === true){
$login_admin_form_action = $site_sess->url(PHPBB3_URL."ucp.php?mode=login");
$login_admin_name_form_field = 'username';
$login_admin_password_form_field = 'password';
$login_admin_additional_form_fields = '<input type="hidden" name="redirect" value="'.$_SERVER['REQUEST_URI'].'" /><input type="hidden" name="login" value="Login" />';
}
Locate:
Code: [Select]
<form action="<?php echo $site_sess->url(ROOT_PATH."admin/index.php"); ?>" method="post">
Replace with:
Code: [Select]
<form action="<?php echo $login_admin_form_action; ?>" method="post">
<?php echo $login_admin_additional_form_fields; ?>
Locate:
Code: [Select]
<td><input type="text" name="loginusername" size="<?php echo $textinput_size2; ?>"></td>
<td><input type="password" name="loginpassword" size="<?php echo $textinput_size2; ?>"></td>
Replace with:
Code: [Select]
<td><input type="text" name="<?php echo $login_admin_name_form_field; ?>" size="<?php echo $textinput_size2; ?>"></td>
<td><input type="password" name="<?php echo $login_admin_password_form_field; ?>" size="<?php echo $textinput_size2; ?>"></td>
Step 6. admin/index.php
Locate (at around lines 60-70):
Code: [Select]
if ($action == "head") {
?>
<html dir="<?php echo $lang['direction']; ?>">
Add following code right between “if ($action == "head") {“ and “?>”:
Code: [Select]
// switch back admin logout url if no integration
if(!defined('PHPBB3_BRIDGE_ON') || PHPBB3_BRIDGE_ON !== true){
$url_logout = $site_sess->url(ROOT_PATH."admin/index.php?logout=1");
}
Locate:
Code: [Select]
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a> | <a href="<?php echo $site_sess->url(ROOT_PATH."admin/index.php?logout=1"); ?>" target="_top"><?php echo $lang['logout']; ?></a> </b></TD>
Replace with:
Code: [Select]
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a> | <a href="<?php echo $url_logout; ?>" target="_top"><?php echo $lang['logout']; ?></a> </b></TD>
Step 7. templates/default/user_loginform.html
Locate:
Code: [Select]
<input type="text" size="10" name="user_name" class="logininput" />
Replace with:
Code: [Select]
<input type="text" size="10" name="{login_user_name_form_field}" class="logininput" />
Locate:
Code: [Select]
<input type="password" size="10" name="user_password" class="logininput" />
Replace with:
Code: [Select]
<input type="password" size="10" name="{login_user_password_form_field}" class="logininput" />
{login_additional_form_fields}
Locate:
Code: [Select]
<td><input type="checkbox" name="auto_login" value="1" /></td>
Replace with:
Code: [Select]
<td><input type="checkbox" name="{login_auto_form_field}" value="1" /></td>
Notes
Please make sure when installing applications you have admin account on both with the same user name and password.
Make sure you checked the topic http://www.4homepages.de/forum/index.php?topic=23892 for the vBulletin bridge, since both bridges are using the same way to work with 4images some questions may be already answered there.
Known issues
Known not to be working if phpBB configured to use mysql driver. Use mysqli instead (http://php.net/manual/en/mysqli.overview.php).
phpBB_installation_path/config.php
Code: [Select]
$dbms = 'mysqli';
When switching bridge off users can’t login to 4images anymore from the native 4images form. However they still exist in 4images database and could request for new password.
After logging off user will be returned to the main page of the forum installation instead of page he was browsing previously.
Version history
0.1 - initial release
0.2 - fixes issue with emptying email address (http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497)
0.3 - fixes issue with wrong register date
0.4 - attempt to fix "blank page" issue (4 Mar 2010)
Extras
Downloadable already modded 4images archive.
Downloadable this instruction in printer friendly pdf.
If you wish to integrate Joomla 1.5, phpBB 3.0 and 4images -- use RokBridge between Joomla and phpBB as known works altogether just fine. Thanks to wingnut for finding it out.
Extending 4images comments with avatars from phpBB from alexeyn1: http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497
Known to work without any issues with Wordpress 3.0.1 (http://www.wp-united.com/get-wp-united/) plugin. Thanks to Benny for finding (http://www.4homepages.de/forum/index.php?topic=26013.msg152103#msg152103).
For downloads please refer to the original post on forum at http://www.4homepages.de/forum/