• [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+ 5 0 5 1
Currently:  

Author Topic: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+  (Read 196151 times)

0 Members and 1 Guest are viewing this topic.

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
[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
  • 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 &copy; 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>&nbsp;|&nbsp;<a href="<?php echo $site_sess->url(ROOT_PATH."admin/index.php?logout=1"); ?>" target="_top"><?php echo $lang['logout']; ?></a>&nbsp;&nbsp;</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>&nbsp;|&nbsp;<a href="<?php echo $url_logout?>" target="_top"><?php echo $lang['logout']; ?></a>&nbsp;&nbsp;</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/
« Last Edit: November 10, 2010, 10:51:08 AM by denisnovikov »
check

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #1 on: October 13, 2009, 02:22:23 PM »
Did anyone implemented this integration?
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #2 on: October 16, 2009, 02:24:40 AM »
Updated the first post with link to demo.
check

Offline tramfahrer

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Straßenbahn-, Bus- und Eisenbahnbilder
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #3 on: October 19, 2009, 03:36:51 PM »
Hallo,

scheint ja wirklich zu funktionieren, wie ist es aber wenn man bereits 4 Images und phpbb3 zu laufen hat, und jeweils unterschiedliche User in beiden Userdatenbanken vorhanden sind??

gehen evtl welche verloren?? müssen sich einige User neuregistrieren die jetz nur in der Galerie sind, aber nicht im Forum und umgekehrt??

gibt es da schon Erfahrungswerte?

Viele Grüße

Tobias

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #4 on: October 19, 2009, 03:57:08 PM »
Hallo,

scheint ja wirklich zu funktionieren, wie ist es aber wenn man bereits 4 Images und phpbb3 zu laufen hat, und jeweils unterschiedliche User in beiden Userdatenbanken vorhanden sind??

gehen evtl welche verloren?? müssen sich einige User neuregistrieren die jetz nur in der Galerie sind, aber nicht im Forum und umgekehrt??

gibt es da schon Erfahrungswerte?

Привет,

Если у тебя были пользователи в phpBB и ты ставишь 4images "с нуля", то ничего делать не надо, пользователи перенесутся автоматически в 4images. Если у тебя уже есть 4images и ты хочешь добавить phpBB, то тебе стоит подождать немного, у меня есть в планах разработка скрипта похожего на vBulletin user export ( http://www.4homepages.de/forum/index.php?topic=23892.0 ).

 8O
check

Offline wingnut

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #5 on: October 25, 2009, 02:56:09 PM »
Denis, thanks for implementing this great mod! (if I could get it to work!)

It seems that when I turn on the bridge in config.php, when I go to my 4images folder all I get is a blank page. I first manually edited each file according to your instructions, and when that failed, thinking I made a typo somewhere, I uploaded the modded files you provided. I still get the same thing. I log into phpbb, then try to go into 4images and the page is blank. Has anyone reported this behavior yet?

Thanks again, as I believe 4images is the all-around open source gallery component available.

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #6 on: October 25, 2009, 03:04:53 PM »
Denis, thanks for implementing this great mod! (if I could get it to work!)

It seems that when I turn on the bridge in config.php, when I go to my 4images folder all I get is a blank page. I first manually edited each file according to your instructions, and when that failed, thinking I made a typo somewhere, I uploaded the modded files you provided. I still get the same thing. I log into phpbb, then try to go into 4images and the page is blank. Has anyone reported this behavior yet?

Thanks again, as I believe 4images is the all-around open source gallery component available.


Hi, could you try:
1. Turn error reporting and see what exactly happens when you going to 4images.
2. Install fresh and clean version of the 4images and see if the same thing happens with blank page.
check

Offline wingnut

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #7 on: October 25, 2009, 03:52:34 PM »
I turned on error reporting and got nothing...just a blank page. Nothing in error log either.

I just did ftp up your complete package of modded and non-modded files and edited config.php with my info. Still just a blank page. If I turn off PHPBB3_BRIDGE in config.php, then 4images works as expected.

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #8 on: October 25, 2009, 03:56:59 PM »
I turned on error reporting and got nothing...just a blank page. Nothing in error log either.

I just did ftp up your complete package of modded and non-modded files and edited config.php with my info. Still just a blank page. If I turn off PHPBB3_BRIDGE in config.php, then 4images works as expected.

Hit me up via PM with details I'll look by myself.
check

Offline WWTNET

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #9 on: October 30, 2009, 09:52:36 PM »
Hello everyone,

Denis, first of all I'd like to thank you for the great modes you worked on (this bridge and the one for vbulletin) I'm sure many of 4images users were waiting for something like this.

Even if I haven;t installed yet your mode for phpbb, I have few questions:

1. does it work with 1.7.6 ?
2. you say it does login from the phpbb database... how does it works ? if user is connected to the gallery page and he tries to login, hitting login button will call a file from the phpscript? or he has to first access the forum sistem and them do login ?
3. is it possible to use 4images DB for login? after logout to be redirected to gallery page?
4. what about existing users ? are they lost ?
5. both sistems share the same session ?
6. what about for registration ? calling the registration form from gallery or forum is the same ?

that's it for the moment... hope is not too much :P

Thanks again
A.

Offline dorin

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #10 on: November 09, 2009, 08:51:03 PM »
I turned on error reporting and got nothing...just a blank page. Nothing in error log either.

I just did ftp up your complete package of modded and non-modded files and edited config.php with my info. Still just a blank page. If I turn off PHPBB3_BRIDGE in config.php, then 4images works as expected.

Hit me up via PM with details I'll look by myself.

I have the same type of error. You found the cause of this error? If so, can it be publicly exposed? Thanks!

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #11 on: November 09, 2009, 11:28:50 PM »
I have the same type of error. You found the cause of this error? If so, can it be publicly exposed? Thanks!
wignut, had a problems with additional bridge he was using integration mod between Joomla and phpBB. If you refer to the first post you will see the update in it about this issue.

1. does it work with 1.7.6 ?
It should work, however I recommend you update to 1.7.7 as it includes some important fixes and updates.

2. you say it does login from the phpbb database... how does it works ? if user is connected to the gallery page and he tries to login, hitting login button will call a file from the phpscript? or he has to first access the forum sistem and them do login ?
After user click on the button 'Login' he will be forwarded to the phpBB login page and will be logged in by phpBB application using data user inputed into the form on the gallery page.

3. is it possible to use 4images DB for login? after logout to be redirected to gallery page?
4images will use it's own database and tables for everything it was using it before.

4. what about existing users ? are they lost ?
No they will not in both applications. Existing users into phpBB application will be able to login to both application after mod installation. 4images will not be able to login into any of applications. I have in my task list create a user export from 4images to phpBB, but can't give you any estimate at the moment. And of course do backups before playing with not only this one mod but any modifications you do with any application.

5. both sistems share the same session ?
Yes.

6. what about for registration ? calling the registration form from gallery or forum is the same ?
Registration link from 4images leads to the phpBB registration page.
check

Offline dorin

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #12 on: November 10, 2009, 06:42:13 PM »
I made a mistake in config.php, now everything is ok. Thanks!  :wink:

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #13 on: November 30, 2009, 01:19:25 PM »
I made a mistake in config.php, now everything is ok. Thanks!  :wink:

I have the same.. blank page... although I used 3.0.6...

where was your mistake?

this is my part of config.php... PLEASE HELP!

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', '/home/user/public_html/site/forum/');
define('PHPBB3_URL', 'http://site.com/forum');

And also found your Modded files, and installed 3.0.5 with no success... blank screen.... :(
« Last Edit: November 30, 2009, 03:40:53 PM by alekseyn1 »

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #14 on: November 30, 2009, 05:25:28 PM »
I made a mistake in config.php, now everything is ok. Thanks!  :wink:

I have the same.. blank page... although I used 3.0.6...

where was your mistake?

this is my part of config.php... PLEASE HELP!

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', '/home/user/public_html/site/forum/');
define('PHPBB3_URL', 'http://site.com/forum');

And also found your Modded files, and installed 3.0.5 with no success... blank screen.... :(

Just updated phpBB on bridge.boxup.us to version 3.0.6 everything seems working just fine.

Usual mistake in config file is emtpy lines or any other symbols after "?>" symbols at the end of file. Handy would be turning error reporting on and see what exactly produces error, blank screen means you got an error but you picked an option to not show any errors on output, or just check your php logs.

Update on problem
Bridge seems 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';Thanks to alekseyn1 for finding.
« Last Edit: November 30, 2009, 10:45:13 PM by denisnovikov »
check