4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: denisnovikov on October 07, 2009, 03:00:33 PM

Title: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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:

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/
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: kai on October 13, 2009, 02:22:23 PM
Did anyone implemented this integration?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on October 16, 2009, 02:24:40 AM
Updated the first post with link to demo.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: tramfahrer 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
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: wingnut 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: wingnut 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: WWTNET 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: dorin 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!
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: dorin on November 10, 2009, 06:42:13 PM
I made a mistake in config.php, now everything is ok. Thanks!  :wink:
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 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.... :(
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov 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.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 01, 2009, 02:19:57 PM
same problem as reported in another bridge found in this bridge:

http://www.4homepages.de/forum/index.php?topic=23892.105
2. If user logout from forum and then refresh gallery-page, then field user_email in the table gl_users for this user will be empty.

where do we make sure that the session is in place before updating the e-mail?

and also, anybody solved the problem of being kept on forum main screen after logout from 4images? Obviously it would be required to stay on 4images main screen....

--------------------
Edit:

Ok, guys, I have found a solution to display user's avatar in phpBB when displaying 4images comments. I.e. user avatar is uploaded using the profile editing in phpBB...

inspired by: Using Phpbb3 Avatars In Custom Pages - http://www.volasail.com/2008/04/using-phpbb3-avatars-in-custom-pages/ (http://www.volasail.com/2008/04/using-phpbb3-avatars-in-custom-pages/)

by no means it's a effective or elegan solution. please feel free to modify and amend. Please let me know also so I could modify my code in this message.

here is what you do...

Step 1.

in details.php find:
Code: [Select]
if ($image_allow_comments == 1) {
ADD after:
Code: [Select]
//comments avatars variable initiate
require_once(ROOT_PATH .'includes/phpbb_sessions.php');
        // for using the phpBB function (I could not make it work...) you will see below
//require_once($phpbb_root_path.'includes/functions_display.php');
//comment avatars variable initiate end

Step 1.1
then find:
Code: [Select]
$comment_user_id = $comment_row[$i]['user_id'];
and ADD after:
Code: [Select]
    //sql for comments avatars
    $sql2 = "SELECT user_avatar, user_avatar_type, user_avatar_width,
    user_avatar_height FROM phpbb_users
    WHERE username = '".$comment_row[$i][$user_table_fields['user_name']]."'";
    $result2 = $site_db->query($sql2);
$row2 = $site_db->fetch_array($result2);
    //sql end comment avatars
        if (empty ($row2['user_avatar'])) {
//the following line uses the phpBB built-in function to return avatars, but I could not get it to work...
                //$comment_user_avatar = get_user_avatar($row2['user_avatar'], $row2['user_avatar_type'], $row2['user_avatar_width'], $row2['user_avatar_height']);
$comment_user_avatar = "";
}
else {
$comment_user_avatar = "<img src='".PHPBB3_URL."/download/file.php?avatar=".$row2['user_avatar']."'>";
        } 

find
Code: [Select]
"comment_user_email_button" => ($show_comment  == 0) ? "" : $comment_user_email_button,
and add after

Code: [Select]
"comment_user_avatar" => $comment_user_avatar, //new line
Step 2.
in comment_bit.html (within your template folder)

find:
Code: [Select]
<b>{comment_user_name}</b><br />
and ADD after:
Code: [Select]
{comment_user_avatar}<br />
That's it for standard installation of 4images.

if you use reply to Comments like on YouTube MOD - http://www.4homepages.de/forum/index.php?topic=23498.0
then continue

Step 3.
in details.php find:
Code: [Select]
$response_row = $site_db->query_firstrow($sql);
and ADD after:
Code: [Select]
//sql for comments response avatars
    $sql3 = "SELECT user_avatar, user_avatar_type, user_avatar_width,
    user_avatar_height FROM phpbb_users
    WHERE username = '".$response_row['response_user_name']."'";
    $result3 = $site_db->query($sql3);
$row3 = $site_db->fetch_array($result3);
//sql end for comment response avatars

          if (empty ($row3['user_avatar'])) {
  $response_user_avatar = "";
          } else {
                  $response_user_avatar = "<img src='".PHPBB3_URL."/download/file.php?avatar=".$row3['user_avatar']."' width='50' height='50'>";
  }

Step 4.
find:

Code: [Select]
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_name."</b> (".$response_user_info.")</td>\n";
and REPLACE by:

Code: [Select]
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_avatar.$response_user_name."</b> (".$response_user_info.")</td>\n";
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: WWTNET on December 06, 2009, 12:44:59 AM
Hello everyone,

any news about a solution to import registered users (before the bridge installation) ? I know Denis made a script like this for the vbulletin bridge. Is it possible to have one also for this bridge ?

Thanks a lot
D.R
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 08, 2009, 01:26:21 PM
same problem as reported in another bridge found in this bridge:

Fixed, attached files are updated.

Ok, guys, I have found a solution to display user's avatar in phpBB when displaying 4images comments. I.e. user avatar is uploaded using the profile editing in phpBB...

Great, I made a link from the first post to this addition. Have it sense to make it as a different mod maybe?

any news about a solution to import registered users (before the bridge installation) ? I know Denis made a script like this for the vbulletin bridge. Is it possible to have one also for this bridge ?

Unfortunately, not yet.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 08, 2009, 01:42:01 PM
same problem as reported in another bridge found in this bridge:

Fixed, attached files are updated.


Denis, thanks for the fix! Should we download the new phpbb.php or reapply the whole mod again?

Only one line changed in phpbb.php

from
Code: [Select]
    if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
Code: [Select]
    if ($bbuser->data['user_id'] > 0 && $bbuser->data['user_email'] !== $user_info['user_email']) {
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 08, 2009, 01:51:20 PM
Denis, thanks for the fix! Should we download the new phpbb.php or reapply the whole mod again?

Only one line changed in phpbb.php

from
Code: [Select]
    if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
Code: [Select]
    if ($bbuser->data['user_id'] > 0 && $bbuser->data['user_email'] !== $user_info['user_email']) {

Yes, only this file and only this line.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 09, 2009, 09:38:07 AM
Denis, one more glitch... for some reason the registration date of a user is not being transferred from phpBB database into 4images database correctly.. could you please check? For all my newly registered users 4images database shows "0" in the "user_joindate" field ...
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 11, 2009, 10:04:12 AM
Denis, thanks for the fix! Should we download the new phpbb.php or reapply the whole mod again?

Only one line changed in phpbb.php

from
Code: [Select]
    if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
Code: [Select]
    if ($bbuser->data['user_id'] > 0 && $bbuser->data['user_email'] !== $user_info['user_email']) {

Yes, only this file and only this line.

sorry guys, found a small error... in phpBB Anonymous user has user_id == 1, so the code above should be
Code: [Select]
    if ($bbuser->data['user_id'] > 1 && $bbuser->data['user_email'] !== $user_info['user_email']) {
after that if you refresh 4images while logged off from the forum, the e-mail will stay in the database.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 11, 2009, 12:32:05 PM
Denis, one more glitch... for some reason the registration date of a user is not being transferred from phpBB database into 4images database correctly.. could you please check? For all my newly registered users 4images database shows "0" in the "user_joindate" field ...

Thanks for finding, fixed

sorry guys, found a small error... in phpBB Anonymous user has user_id == 1, so the code above should be

To be even more correct there should be ANONYMOUS constant from phpBB

Both fixes are attached to the first post. Changed file only includes/phpbb.php
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 15, 2009, 11:06:06 AM
I have made a MOD to show the last posts from forums on the 4images main page...

http://www.4homepages.de/forum/index.php?topic=26465.0
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Kurman on December 19, 2009, 01:49:10 AM
C phpBB 3.0.6 не работает, да?  Я попробовал, не фурычит.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 19, 2009, 10:35:12 AM
C phpBB 3.0.6 не работает, да?  Я попробовал, не фурычит.

Плохо попробовал: http://bridge.boxup.us/ - phpBB 3.0.6
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Kurman on December 19, 2009, 05:40:04 PM
Ставил уже готовую "modded" 4images, что приаттачена здесь, и ставил phpBB3.0.6 только что скачанную. На локальный сервер vertrigo.

Реакция такая: при регистрации с 4images перекидывает на форум, там регистрация проходит. Потом при нажатии на "вернуться на предыдущую страниу", то бишь на 4images, начинает открывать и подгружаться галерея, но белый лист и грузит, грузит.. (тем временем открываю форум, там залогинен, нет проблем.)

Пробую опять просто войти в 4images и индикатор что страница все ещё подгружается.. Потом обрываю процесс, захожу в phpmyadmin, смотрю в таблице юзеровв 4images несколько тысяч :!: записей нового юзера, которого я только что регистрировал. (то есть, есть гостевая запись, есть админская запись и несколько тысяч записей нового юзера)

Смахивает на то, что процесс импорта юзера из форума в базу 4images зацикливается.
При простом открытии страницы 4images зацикливается и продолжает непрерывный процесс записи/импорта этого юзера в таблицу 4images.

Вот так вот.. Как и сказал, я сам ничего не делал, просто скачал твой "modded", уже готовый и поставил с phpBB3. И такой результат.

Может приаттачишь тот что работает у тебя на демо?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 19, 2009, 06:37:02 PM
Попробуй пошаговую модификацию... у меня все сработало с первого раза.... (за исключением подключения к базе, которое Денис исправил.. и все заработало хорошо)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on December 23, 2009, 02:39:38 PM
I am trying to extend this bridge and update not only the e-mail of the user, but also other fields from phpBB into 4images database...

i have created a custom profile field "full_name" in phpBB and now I am trying to update the relevant field (which I also created in 4images).

field definitions in 4images are done as follows:

in db_field_definitions.php:

Code: [Select]
$additional_user_fields['full_name'] = array($lang['full_name'], "text", 0);
in sessions.php
Code: [Select]
$user_table_fields = array(
 ...
  //new
  "full_name" => "full_name",
  //end new
...
);

then I try to compare and import from one php_users table into 4images_users like this:

Code: [Select]
//  --
//  check and update if user has a new info in phpBB

//e-mail
    if ($bbuser->data['user_id'] > ANONYMOUS && $bbuser->data['user_email'] !== $user_info['user_email']) {
        $sql = "
UPDATE ".USERS_TABLE."
SET ".get_user_table_field(" ", "user_email")." = '".$bbuser->data['user_email']."'
WHERE ".get_user_table_field("", "user_id")." = '".$user_info['user_id']."'
LIMIT 1;";
        $result = $site_db->query($sql);
    }

//name
    if ($bbuser->data['user_id'] > ANONYMOUS && $bbuser->profile_fields['pf_full_name'] !== $user_info['full_name']) {
$sql = "
UPDATE ".USERS_TABLE."
SET ".get_user_table_field(" ", "full_name")." = '".$bbuser->profile_fields['pf_full_name']."'
WHERE ".get_user_table_field("", "user_id")." = '".$user_info['user_id']."'
LIMIT 1;";
        $result = $site_db->query($sql);
    }

as a result, I get nothing in the 4images field... (although if you make the 4images field "full_name" as NULL, it becomes not null as the result of this script)... anyone knows what's wrong? I appreciate any help.
Title: 4images and Phpbb2 -> phpbb3
Post by: satine88 on December 27, 2009, 11:22:37 PM
Hello,

On my site I have a mod for phpbb2 and installed 4images:
http://www.4homepages.de/forum/index.php?topic=4315.0

I should like to phpBB3 version :
http://www.4homepages.de/forum/index.php?topic=26013.0

Is that possible? Is it easy to edit? somebody already?

Thanks :)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on December 30, 2009, 12:04:44 AM
Hello
I have a error :

Code: [Select]
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 325

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 326

An unexpected error occured. Please try again later.

And the page /forum/ is blank


Sessions :
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: sessions.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Main part is adapted from of phpBB, (C) 2001 The phpBB Group        *
 *    phpBB is released under the GNU General Public License              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

// Define here the name of the session. Default of phpBB is "sid".
define('SESSION_NAME''sid');

// Define here the name of the banlist and config database tables.
// Maybe you only need to change the table prefix if you another
// than the phpBB default "phpbb_".
define('PHPBB_BANLIST_TABLE''forumphpbb_banlist');
define('PHPBB_CONFIG_TABLE''forumphpbb_config');

// Set her the corresponding database fields of the user table.
// If there is no corresponding field in the new user table,
// leave the value blank. Normally no need to change.
$user_table_fields = array(
  
"user_id" => "user_id",
  
"user_level" => "user_level",
  
"user_name" => "username",
  
"user_password" => "user_password",
  
"user_email" => "user_email",
  
"user_showemail" => "user_viewemail",
  
"user_allowemails" => "",
  
"user_invisible" => "user_allow_viewonline",
  
"user_joindate" => "user_regdate",
  
"user_activationkey" => "user_actkey",
  
"user_lastaction" => "user_session_time",
  
"user_location" => "user_session_page",
  
"user_lastvisit" => "user_lastvisit",
  
"user_comments" => "",
  
"user_homepage" => "user_website",
  
"user_icq" => "user_icq"
);

// Set here the URL to your phpBB forum. WITH trailing slash!
$url_app           "http://www.fond-ecran-gratuit.biz/forum/";

// Set here different URL's to your phpBB forum.
// Normally no need to change.
$url_register      $url_app."profile.php?mode=register";
$url_lost_password $url_app."profile.php?mode=sendpassword";
$url_control_panel $url_app."profile.php?mode=editprofile";
$url_mailform      $url_app."profile.php?mode=email&u={user_id}";
$url_show_profile  $url_app."profile.php?mode=viewprofile&u={user_id}";
$url_login         $url_app."login.php";
$url_logout        $url_app."login.php?logout=true";

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

define('USER_INTEGRATION''PHPBB');

function 
get_user_table_field($add$user_field) {
  global 
$user_table_fields;
  return (!empty(
$user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class 
Session {

  var 
$session_id;
  var 
$user_ip;
  var 
$user_location;
  var 
$current_time;
  var 
$session_timeout;
  var 
$mode "get";
  var 
$session_info = array();
  var 
$user_info = array();

  function 
Session() {
    global 
$config$board_config;
    
$this->session_timeout $board_config['session_length'];
    
$this->user_ip $this->get_user_ip();
    
$this->user_location 1;
    
$this->current_time time();
    
$this->session_pagestart($this->user_ip0);
  }

  function 
session_pagestart($user_ip$thispage_id) {
    global 
$site_db$board_config;
  global $HTTP_COOKIE_VARS$HTTP_GET_VARS$HTTP_POST_VARS$SID;

    
$cookiename $board_config['cookie_name'];
  $cookiepath $board_config['cookie_path'];
  $cookiedomain $board_config['cookie_domain'];
  $cookiesecure $board_config['cookie_secure'];

  if ( isset($HTTP_COOKIE_VARS[$cookiename '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename '_data']) )
  {
  $this->session_id = isset($HTTP_COOKIE_VARS[$cookiename '_sid']) ? $HTTP_COOKIE_VARS[$cookiename '_sid'] : '';
  $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename '_data'])) : array();
  if (!is_array($sessiondata)) {
    $sessiondata = array();
  }
  $this->mode "cookie";
  }
  else
  {
  $sessiondata = array();
  if (isset($HTTP_GET_VARS[SESSION_NAME])) {
        
$this->session_id $HTTP_GET_VARS[SESSION_NAME];
      }
      elseif (isset(
$HTTP_POST_VARS[SESSION_NAME])) {
        
$this->session_id $HTTP_POST_VARS[SESSION_NAME];
      }
      else {
        
$this->session_id false;
      }
  }

  
//
  
// Does a session exist?
  
//
  
if ( !empty($this->session_id) )
  
{
  
$valid_session 1;
  
if (!$this->load_session_info()) {
      
$this->session_info['session_user_id'] = GUEST;
      
$valid_session 0;
      }
      
$this->user_info $this->load_user_info($this->session_info['session_user_id']);

  
if ( $valid_session )
  
{
  
$SID = ( $this->mode == "get" ) ? SESSION_NAME.'=' $this->session_id '';

  
if ( $this->current_time $this->session_info['session_time'] > 60 )
  
{
  
$sql "UPDATE " SESSIONS_TABLE "
   SET session_time = 
$this->current_time, session_page = $thispage_id
   WHERE session_id = '
$this->session_id'
   AND session_ip = '
$user_ip'";
  
$site_db->query($sql);

  
if ( $this->user_info['user_id'] != GUEST )
  
{
  
$sql "UPDATE " USERS_TABLE "
   SET user_session_time = 
$this->current_time, user_session_page = $thispage_id
   WHERE user_id = " 
$this->user_info['user_id'];
  
$site_db->query($sql);
  
}
   $this->delete_old_sessions();
    setcookie($cookiename '_data'serialize($sessiondata), $this->current_time 31536000$cookiepath$cookiedomain$cookiesecure);
   setcookie($cookiename '_sid'$this->session_id0$cookiepath$cookiedomain$cookiesecure);
     }
   return $this->user_info;
  }
  }

  $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : GUEST;
  $this->user_info $this->session_begin($user_id$user_ip$thispage_idTRUE);
  return $this->user_info;

  }

  function 
session_begin($user_id$user_ip$page_id$auto_create 0$enable_autologin 0) {
    global 
$site_db$board_config;
  global $HTTP_COOKIE_VARS$HTTP_GET_VARS$HTTP_POST_VARS$SID;

    
$cookiename $board_config['cookie_name'];
  $cookiepath $board_config['cookie_path'];
  $cookiedomain $board_config['cookie_domain'];
  $cookiesecure $board_config['cookie_secure'];

  if ( isset($HTTP_COOKIE_VARS[$cookiename '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename '_data']) )
  {
  $this->session_id = isset($HTTP_COOKIE_VARS[$cookiename '_sid']) ? $HTTP_COOKIE_VARS[$cookiename '_sid'] : '';
  $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename '_data'])) : array();
  $this->mode "cookie";
  }
  else
  {
  $sessiondata = array();
  if (isset($HTTP_GET_VARS[SESSION_NAME])) {
        
$this->session_id $HTTP_GET_VARS[SESSION_NAME];
      }
      elseif (isset(
$HTTP_POST_VARS[SESSION_NAME])) {
        
$this->session_id $HTTP_POST_VARS[SESSION_NAME];
      }
      else {
        
$this->session_id false;
      }
  }

  $last_visit 0;
  $expiry_time $this->current_time $board_config['session_length'];

  $this->user_info $this->load_user_info($user_id);
  $user_id $this->user_info['user_id'];

    if ( 
$user_id != GUEST )
  {
  $auto_login_key $this->user_info['user_password'];

  if ( $auto_create )
  {
  
if ( isset($sessiondata['autologinid']) && $this->user_info['user_active'] )
   {
   // We have to login automagically
   if( $sessiondata['autologinid'] === $auto_login_key )
  {
  
// autologinid matches password
   $login 1;
   $enable_autologin 1;
   }
  else
  
{
   // No match; don't login, set as anonymous user
   $login 0;
   $enable_autologin 0;
   $user_id GUEST;
  
}
   }
   else
  {
  // Autologin is not set. Don't login, set as anonymous user
  
$login 0;
   $enable_autologin 0;
   $user_id GUEST;
  }
  
}
   else
  {
   $login 1;
  
}
  }
    else
  {
  $login 0;
  
$enable_autologin 0;
  
$user_id GUEST;
  }

  //
  // Initial ban check against user id, IP and email address
  
//
  preg_match('/(..)(..)(..)(..)/'$user_ip$user_ip_parts);

  $sql "SELECT ban_ip, ban_userid, ban_email
   FROM " 
PHPBB_BANLIST_TABLE "
   WHERE ban_ip IN ('" 
$user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" $user_ip_parts[1] . "ffffff')
   OR ban_userid = 
$user_id";
  
if ( $user_id != GUEST )
  
{
  
$sql .= " OR ban_email LIKE '" str_replace("\'""''"$this->user_info['user_email']) . "'
   OR ban_email LIKE '" 
substr(str_replace("\'""''"$this->user_info['user_email']), strpos(str_replace("\'""''"$this->user_info['user_email']), "@")) . "'";
  
}
  
$result $site_db->query($sql);

  
if ( $ban_info $site_db->fetch_array($result) )
  
{
  
if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )
  
{
  
header("Location: $url_login");
        exit;
  
}
  
}

  
//
  
// Create or update the session
  
//
  
$sql "UPDATE " SESSIONS_TABLE "
   SET session_user_id = 
$user_id, session_start = $this->current_time, session_time = $this->current_time, session_page = $page_id, session_logged_in = $login
   WHERE session_id = '" 
$this->session_id "'
   AND session_ip = '
$user_ip'";
  
if ( !$site_db->query($sql) || !$site_db->affected_rows() )
  
{
  
$this->session_id md5(uniqid($user_ip));

  
$sql "INSERT INTO " SESSIONS_TABLE "
   (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
   VALUES ('
$this->session_id', $user_id$this->current_time$this->current_time, '$user_ip', $page_id$login)";
  
$site_db->query($sql);
  
}

  
if ( $user_id != GUEST )
  
{
  
$last_visit = ( $this->user_info['user_session_time'] > ) ? $this->user_info['user_session_time'] : $this->current_time;

  
$sql "UPDATE " USERS_TABLE "
   SET user_session_time = 
$this->current_time, user_session_page = $page_id, user_lastvisit = $last_visit
   WHERE user_id = 
$user_id";
  
$site_db->query($sql);

  
$this->user_info['user_lastvisit'] = $last_visit;

  
$sessiondata['autologinid'] = ( $enable_autologin && $this->mode == "cookie" ) ? $auto_login_key '';
  
$sessiondata['userid'] = $user_id;
  
}

  
$this->user_info['user_id'] = $user_id;
  
$this->session_info['session_id'] = $this->session_id;
  
$this->session_info['session_ip'] = $user_ip;
  
$this->session_info['session_user_id'] = $user_id;
  
$this->session_info['session_logged_in'] = $login;
  
$this->session_info['session_page'] = $page_id;
  
$this->session_info['session_start'] = $this->current_time;
  
$this->session_info['session_time'] = $this->current_time;

  
setcookie($cookiename '_data'serialize($sessiondata), $this->current_time 31536000$cookiepath$cookiedomain$cookiesecure);
  
setcookie($cookiename '_sid'$this->session_id0$cookiepath$cookiedomain$cookiesecure);

  
$SID = ( $this->mode == "get" ) ? SESSION_NAME.'=' $this->session_id '';

  
return $this->user_info;
  }

  function 
login($user_name ""$user_password ""$auto_login 0$set_auto_login 1$do_md5 true) {
    global 
$url_login;
    
header("Location: $url_login");
  }

  function 
logout($user_id GUEST) {
    global 
$url_logout;
    
header("Location: $url_logout");
  }

  function 
delete_old_sessions() {
    global 
$site_db$board_config;
    
$expiry_time $this->current_time $board_config['session_length'];
    
$sql "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_time < 
$expiry_time";
    
$site_db->query($sql);

    
$sql "SELECT session_id
            FROM "
.SESSIONS_TABLE;
    
$result $site_db->query($sql);
    if (
$result) {
      
$session_ids_sql "";
      while (
$row $site_db->fetch_array($result)) {
        
$session_ids_sql .= (($session_ids_sql != "") ? ", " "") . "'".$row['session_id']."'";
      }
    }
    if (!empty(
$session_ids_sql)) {
      
$sql "DELETE FROM ".SESSIONVARS_TABLE."
              WHERE session_id NOT IN (
$session_ids_sql)";
      
$site_db->query($sql);
    }
    return 
true;
  }

  function 
return_session_info() {
    return 
$this->session_info;
  }

  function 
return_user_info() {
    return 
$this->user_info;
  }

  function 
freeze() {
    return;
  }

  function 
load_session_info() {
    global 
$site_db;
    if (empty(
$this->session_id)) {
      return 
false;
    }
    
$ip_sql = ($this->mode == "get") ? " AND session_ip = '$this->user_ip'" "";
    
$this->session_info = array();
    
$sql "SELECT *
            FROM "
.SESSIONS_TABLE."
            WHERE session_id = '
$this->session_id'
            
$ip_sql";
    
$this->session_info $site_db->query_firstrow($sql);
    if (empty(
$this->session_info['session_user_id'])) {
      return 
false;
    }
    else {
      
$sql "SELECT sessionvars_name, sessionvars_value
              FROM "
.SESSIONVARS_TABLE."
              WHERE session_id = '
$this->session_id'";
      
$result $site_db->query($sql);
      while (
$row $site_db->fetch_array($result)) {
        
$this->session_info[$row['sessionvars_name']] = $row['sessionvars_value'];
      }
      return 
$this->session_info;
    }
  }

  function 
load_user_info($user_id GUEST) {
    global 
$site_db$user_table_fields;

    if (
$user_id != GUEST) {
      
$sql "SELECT u.*, l.*
              FROM "
.USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE "
.get_user_table_field("u.""user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.""user_id");
      
$user_info $site_db->query_firstrow($sql);
      if (!
$user_info) {
        
$sql "SELECT *
                FROM "
.USERS_TABLE."
                WHERE "
.get_user_table_field("""user_id")." = $user_id";
        
$user_info $site_db->query_firstrow($sql);
        if (
$user_info) {
          
$lightbox_id get_random_key(LIGHTBOXES_TABLE"lightbox_id");
          
$sql "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('
$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          
$site_db->query($sql);
          
$user_info['lightbox_lastaction'] = $this->current_time;
          
$user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty(
$user_info[$user_table_fields['user_id']])) {
      
$user_info = array();
      
$user_info['user_id'] = GUEST;
      
$user_info['user_level'] = GUEST;
      
$user_info['user_lastaction'] = $this->current_time;
    }

    foreach (
$user_table_fields as $key => $val) {
      if (isset(
$user_info[$val])) {
        if (
$val == "user_allow_viewonline") {
          
$user_info[$key] = ($user_info[$val] == 1) ? 1;
        }
        else {
          
$user_info[$key] = $user_info[$val];
        }
      }
      elseif (!isset(
$user_info[$key])) {
        
$user_info[$key] = "";
      }
    }
    if (isset(
$user_info['user_active']) && $user_info['user_active'] == 0) {
      
$user_info['user_level'] = USER_AWAITING;
    }
    return 
$user_info;
  }

  function 
set_session_var($var_name$value) {
    global 
$site_db;
    
$sql "SELECT session_id
            FROM "
.SESSIONVARS_TABLE."
            WHERE sessionvars_name = '
$var_name' AND session_id = '$this->session_id'";
    if (
$site_db->is_empty($sql)) {
      
$sql "INSERT INTO ".SESSIONVARS_TABLE."
              (session_id, sessionvars_name, sessionvars_value)
              VALUES
              ('
$this->session_id', '$var_name', '$value')";
      
$site_db->query($sql);
    }
    else {
      
$sql "UPDATE ".SESSIONVARS_TABLE."
              SET sessionvars_value = '
$value'
              WHERE sessionvars_name = '
$var_name' AND session_id = '$this->session_id'";
      
$site_db->query($sql);
    }
    
$this->session_info[$var_name] = $value;
    return 
true;
  }

  function 
get_session_var($var_name) {
    global 
$site_db;
    if (isset(
$this->session_info[$var_name])) {
      return 
$this->session_info[$var_name];
    }
    else {
      
$sql "SELECT sessionvars_value
              FROM "
.SESSIONVARS_TABLE."
              WHERE sessionvars_name = '
$var_name' AND session_id = '$this->session_id'";
      
$value $site_db->query_firstrow($sql);
      if (
$value) {
        
$this->session_info[$var_name] = $value['sessionvars_value'];
        return 
$value['sessionvars_value'];
      }
      else {
        return 
"";
      }
    }
  }

  function 
drop_session_var($var_name) {
    global 
$site_db;
    
$sql "DELETE FROM ".SESSIONVARS_TABLE."
            WHERE sessionvars_name = '
$var_name' AND session_id = '$this->session_id'";
    return (
$site_db->query($sql)) ? 0;
  }

  function 
get_user_ip() {
    global 
$HTTP_SERVER_VARS$HTTP_ENV_VARS$REMOTE_ADDR;

    if( 
getenv('HTTP_X_FORWARDED_FOR') != '' )
    {
    $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );

    if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/"getenv('HTTP_X_FORWARDED_FOR'), $ip_list) )
    {
    $private_ip = array('/^127\.0\.0\.1/''/^192\.168\..*/''/^172\.16\..*/''/^10..*/''/^224..*/''/^240..*/');
    $client_ip preg_replace($private_ip$client_ip$ip_list[1]);
    }
    }
    else
    {
    $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
    }

    
$ip_sep explode('.'$client_ip);
  return sprintf('%02x%02x%02x%02x'$ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
  }

  function 
get_user_location() {
    global 
$self_url;
    return (
defined("IN_CP")) ? "Control Panel" preg_replace(array("/([?|&])action=[^?|&]*/""/([?|&])mode=[^?|&]*/""/([?|&])phpinfo=[^?|&]*/""/([?|&])printstats=[^?|&]*/""/[?|&]".URL_ID."=[^?|&]*/""/[?|&]l=[^?|&]*/""/[&?]+$/"), array(""""""""""""""), addslashes($self_url));
  }

/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  
function url($url$amp "&amp;") {
    global 
$l$user_info;
    
$dummy_array explode("#"$url);
    
$url $dummy_array[0];
    
$url str_replace('&amp;''&'$url);
    if (!
defined('IN_CP')) {
      if (
strstr($url'index.php')) {
        
$url str_replace('index.php'''$url);
      }
      elseif (
strstr($url'search.php')) {
        if (
strstr($url'page=')) {
          
preg_match('#page=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('search.php''search.'.$matches[1].'.htm'$url);
            
$query str_replace('page='.$matches[1].'&'''$query);
            
$query str_replace('&page='.$matches[1], ''$query);
            
$query str_replace('page='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('search.php''search.htm'$url);
        }
      }
      elseif (
strstr($url'lightbox.php')) {
        if (
strstr($url'page=')) {
          
preg_match('#page=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('lightbox.php''lightbox.'.$matches[1].'.htm'$url);
            
$query str_replace('page='.$matches[1].'&'''$query);
            
$query str_replace('&page='.$matches[1], ''$query);
            
$query str_replace('page='.$matches[1], ''$query);
            if (!empty(
$query)) {
                
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('lightbox.php''lightbox.htm'$url);
        }
      }
      elseif (
strstr($url'categories.php')) {
        if (
strstr($url'cat_id=') && strstr($url'page=')) {
          
preg_match('#cat_id=([0-9]+)&?#'$url$matches1);
          
preg_match('#page=([0-9]+)&?#'$url$matches2);
          if (isset(
$matches1[1]) && isset($matches2[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('categories.php''cat'.$matches1[1].'.'.$matches2[1].'.htm'$url);
            
$query str_replace('cat_id='.$matches1[1].'&'''$query);
            
$query str_replace('&cat_id='.$matches1[1], ''$query);
            
$query str_replace('cat_id='.$matches1[1], ''$query);
            
$query str_replace('page='.$matches2[1].'&'''$query);
            
$query str_replace('&page='.$matches2[1], ''$query);
            
$query str_replace('page='.$matches2[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        elseif (
strstr($url'cat_id=')) {
          
preg_match('#cat_id=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$cat_url get_category_url($matches[1]);
            
$url   str_replace('categories.php''cat'.$cat_url.'.htm'$url);
            
$query str_replace('cat_id='.$matches[1].'&'''$query);
            
$query str_replace('&cat_id='.$matches[1], ''$query);
            
$query str_replace('cat_id='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('categories.php''cat.htm'$url);
        }
      }
      elseif (
strstr($url'details.php?image_id=')) {
        if (
strstr($url'image_id=') && strstr($url'mode=')) {
          
preg_match('#image_id=([0-9]+)&?#'$url$matches1);
          
preg_match('#mode=([a-zA-Z0-9]+)&?#'$url$matches2);
          if (isset(
$matches1[1]) && isset($matches2[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('details.php''img'.$matches1[1].'.'.$matches2[1].'.htm'$url);
            
$query str_replace('image_id='.$matches1[1].'&'''$query);
            
$query str_replace('&image_id='.$matches1[1], ''$query);
            
$query str_replace('image_id='.$matches1[1], ''$query);
            
$query str_replace('mode='.$matches2[1].'&'''$query);
            
$query str_replace('&mode='.$matches2[1], ''$query);
            
$query str_replace('mode='.$matches2[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
preg_match('#image_id=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('details.php''img'.get_image_url($matches[1]).'.htm'$url);
            
$query str_replace('image_id='.$matches[1].'&'''$query);
            
$query str_replace('&image_id='.$matches[1], ''$query);
            
$query str_replace('image_id='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
      }
      elseif (
strstr($url'postcards.php?image_id=')) {
        
preg_match('#image_id=([0-9]+)&?#'$url$matches);
        if (isset(
$matches[1])) {
          
$split explode('?'$url);
          
$url $split[0];
          
$query = @$split[1];
          
$url   str_replace('postcards.php''postcard.img'.$matches[1].'.htm'$url);
          
$query str_replace('image_id='.$matches[1].'&'''$query);
          
$query str_replace('&image_id='.$matches[1], ''$query);
          
$query str_replace('image_id='.$matches[1], ''$query);
          if (!empty(
$query)) {
            
$url .= '?' $query;
          }
        }
      }
    }
    if (
$this->mode == "get" && strstr($url$this->session_id)) {
      
$url .= strpos($url'?') !== false '&' '?';
      
$url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty(
$l)) {
      
$url .= strpos($url'?') ? '&' '?';
      
$url .= "l=".$l;
    }
    
$url str_replace('&'$amp$url);
    
$url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return 
$url;
  }
//end of class

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
$board_config = array();
$sql "SELECT * FROM " PHPBB_CONFIG_TABLE;
$result $site_db->query($sql);
while(
$row $site_db->fetch_array($result)) {
  
$board_config[$row['config_name']] = $row['config_value'];
}

//Start Session
$site_sess = new Session();

// Get Userinfo
$session_info $site_sess->return_session_info();
$user_info $site_sess->return_user_info();
include_once(
realpath(dirname(__FILE__)).'/phpbb.php');
//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online 0;
$num_visible_online 0;
$num_invisible_online 0;
$num_registered_online 0;
$num_guests_online 0;
$user_online_list "";
$prev_user_ids = array();
$prev_session_ips = array();

if (
defined("GET_USER_ONLINE") && ($config['display_whosonline'] == || $user_info['user_level'] == ADMIN)) {
  
$time_out time() - 300;
  
$sql "SELECT ".get_user_table_field("u.""user_id").get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_invisible").", s.session_user_id, s.session_time, s.session_ip
  FROM "
.USERS_TABLE." u, ".SESSIONS_TABLE." s
  WHERE "
.get_user_table_field("u.""user_id")." = s.session_user_id AND (s.session_time >= $time_out OR ".get_user_table_field("u.""user_lastaction")." >= $time_out)
  ORDER BY "
.get_user_table_field("u.""user_id")." ASC, s.session_ip ASC";
  
$result $site_db->query($sql);
  while (
$row $site_db->fetch_array($result)) {
    if (
$row['session_user_id'] != GUEST) {
      if (!isset(
$prev_user_ids[$row['session_user_id']])) {
        
$is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 0) ? 0;
        
$invisibleuser = ($is_invisible) ? "*" "";
        
$username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>"$row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!
$is_invisible || $user_info['user_level'] == ADMIN) {
          
$user_online_list .= ($user_online_list != "") ? ", " "";
          
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!
$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        
$num_registered_online++;
      }
      
$prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset(
$prev_session_ips[$row['session_ip']])) {
        
$num_guests_online++;
      }
    }
    
$prev_session_ips[$row['session_ip']] = 1;
  }
  
$num_total_online $num_registered_online $num_guests_online;

  
$site_template->register_vars(array(
    
"num_total_online" => $num_total_online,
    
"num_invisible_online" => $num_invisible_online,
    
"num_registered_online" => $num_registered_online,
    
"num_guests_online" => $num_guests_online,
    
"user_online_list" => $user_online_list,
    
"lang_user_online" => str_replace('{num_total_online}'$num_total_online$lang['user_online']),
    
"lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  
$whos_online $site_template->parse_template("whos_online");
  
$site_template->register_vars("whos_online"$whos_online);
  unset(
$whos_online);
  unset(
$prev_user_ids);
  unset(
$prev_session_ips);
}
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url '')
{
global $site_db;
$sql "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$cat_url  '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}
?>

L325 + 326
Code: [Select]
  setcookie($cookiename . '_data', serialize($sessiondata), $this->current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
  setcookie($cookiename . '_sid', $this->session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);

Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 30, 2009, 12:42:04 AM
Hello
I have a error :

Hi, put this code into config.php:
Code: [Select]
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);

And post back errors you will see.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on December 30, 2009, 12:49:28 AM
Hello
I have a error :

Hi, put this code into config.php:
Code: [Select]
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);

And post back errors you will see.


If I put :
Code: [Select]
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);

With :
Code: [Select]
$db_servertype = "mysql";
I have :
Code: [Select]
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 325

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 326

An unexpected error occured. Please try again later.
http://www.fond-ecran-gratuit.biz/

But If I put : $db_servertype = "mysqli";
I have :
Code: [Select]
Warning: main(./includes/db_mysqli.php) [function.main]: failed to open stream: No such file or directory in /homez.93/fondecra/www/global.php on line 380

Warning: main() [function.include]: Failed opening './includes/db_mysqli.php' for inclusion (include_path='.:/usr/local/lib/php') in /homez.93/fondecra/www/global.php on line 380

Fatal error: Cannot instantiate non-existent class: db in /homez.93/fondecra/www/global.php on line 381


Sorry for my English, I do not speak English well








EDIT

and in detail :
Code: [Select]
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 325

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 326

An unexpected error occured. Please try again later.

Notice: Use of undefined constant Guest - assumed 'Guest' in /homez.93/fondecra/www/details.php on line 618

Notice: Undefined index: calendar_image_tip in /homez.93/fondecra/www/details.php on line 674

Notice: Undefined index: calendar_help in /homez.93/fondecra/www/details.php on line 675

Notice: Undefined index: calendar_paper_tip in /homez.93/fondecra/www/details.php on line 676

Notice: Undefined index: calendar_select_mounth_tip in /homez.93/fondecra/www/details.php on line 677

Notice: Undefined index: calendar_remind_tip in /homez.93/fondecra/www/details.php on line 678

Notice: Undefined index: calendar_print_tip_1 in /homez.93/fondecra/www/details.php on line 679

Notice: Undefined index: calendar_print_tip_2 in /homez.93/fondecra/www/details.php on line 680

Notice: Undefined variable: uploadinfo in /homez.93/fondecra/www/details.php on line 727

Notice: Undefined variable: icodes in /homez.93/fondecra/www/details.php on line 736

http://www.fond-ecran-gratuit.biz/img-3d-296-67272.htm
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on December 30, 2009, 01:14:05 AM
I have :
Code: [Select]
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 325

Warning: Cannot modify header information - headers already sent by (output started at /homez.93/fondecra/www/includes/db_mysql.php:192) in /homez.93/fondecra/www/includes/sessions.php on line 326

An unexpected error occured. Please try again later.

It seems like there is an error in sql somewhere. Took a look over your site, can't even guess what exactly can do an error there -- too much stuff. And I bet it's not related to the phpBB3 bridge or you did something wrong while installing.

Sorry for my English, I do not speak English well

Me neither, although I could try to speak to you in french via my home interpreter.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: V@no on December 30, 2009, 01:32:25 AM
1) 4images doesn't support mysqli, only mysql.
2) An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on January 01, 2010, 08:35:17 PM
During the installation of this mod, there are:

Step 3. includes/sessions.php

Quote
Locate somewhere around line 191:

Code: [Select]
Code:  [Select]  [Expand]  [Hide line numbers]
1
$user_password = md5($user_password);

Replace with:

Code: [Select]
Code:  [Select]  [Expand]  [Hide line numbers]
1
if($do_md5 == true) $user_password = md5($user_password);


Looking through my software:
 "$user_password ="

I found the line:

Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1, $do_md5 = true) {
    global $url_login;
    header("Location: $url_login");
  }


What should I do?


1) 4images doesn't support mysqli, only mysql.

I thought he needed to change because I saw
Code: [Select]
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]  [Expand]  [Hide line numbers]
1
$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.


Quote
2) An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0)
ok :)

Thanks ! :)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on January 03, 2010, 01:31:33 AM
Hello,
I decided to reinstall everything from scratch again.

So I download 4images with the amendment already installed, but installation does not work

An unexpected error occured. Please try again later.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: shtsht on January 03, 2010, 04:07:44 PM
thanks
great topic
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on January 04, 2010, 07:34:08 PM
Anybody ? :)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on January 07, 2010, 11:17:37 PM
Hello,

Does anyone has succeeded?

I just reinstall everything 4images for this mod, but it's still not working
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on January 07, 2010, 11:36:39 PM
Looking through my software:
 "$user_password ="

I found the line:

Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1, $do_md5 = true) {
    global $url_login;
    header("Location: $url_login");
  }


What should I do?

Code of the login function you provided can not be a code of the clean version of the 4images. I can't even imagine what/who did changes in this piece of code.

Does anyone has succeeded?

Actual working version available publicly is hosted here: http://bridge.boxup.us/
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: edonai on January 09, 2010, 09:57:31 PM
Hello, here is my question: if my forum uses an another database from 4images is that the bridge work?
Thanks
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: luener on January 15, 2010, 05:05:48 PM
FEHLERMELDUNG:

Warning: require() [function.require]: Unable to access //config.php in /home/webpages/lima-city/topfoto24/html/includes/phpbb_sessions.php on line 9
Warning: require(//config.php) [function.require]: failed to open stream: No such file or directory in /home/webpages/lima-city/topfoto24/html/includes/phpbb_sessions.php on line 9

Ich komme einfach nicht weiter. :?
Meine config.php

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype "mysql";
$db_host "mysql.lima-city.de";
$db_name "db_154162_1";
$db_user "USER154162";
$db_password "QqsAzPqX";

$table_prefix "4images_";

define("4IMAGES_ACTIVE"1);


define('PHPBB3_BRIDGE_ON'true);
define('PHPBB3_PATH'realpath(realpath(dirname(__FILE__)).'/../phpbbforum/').'/');
define('PHPBB3_URL''http://topfoto24.lima-city.de/phpbbforum/');

?>
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on January 15, 2010, 05:28:14 PM
Ich komme einfach nicht weiter. :?
Meine config.php

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../phpbbforum/').'/');
define('PHPBB3_URL', 'http://topfoto24.lima-city.de/phpbbforum/');

Hi, as I can see on your host topfoto24.lima-city.de you have 4images installed into the root of the site and PHPBB is into /phpbbforum, then your config should be like:
Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/phpbbforum/').'/');
define('PHPBB3_URL', 'http://topfoto24.lima-city.de/phpbbforum/');

Hello, here is my question: if my forum uses an another database from 4images is that the bridge work?
Thanks

Hi, should work as both applications are not really sharing the DB connection, only session.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: edonai on January 19, 2010, 12:50:44 PM
ok, thanks for your reponse denisnovikov
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Steffen13 on January 21, 2010, 11:39:50 PM
hi,

here is my problem:

Code: [Select]
Parse error: syntax error, unexpected '.' in /home/www/***/html/***/test/galerie/includes/phpbb_sessions.php on line 6
my config:

Code: [Select]
define("4IMAGES_ACTIVE", 1);
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');
define('PHPBB3_URL', 'http://sitename.de/test/forum/');
?>

i think in line 3 is something wrong?

best regards
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on January 22, 2010, 12:54:02 AM
Code: [Select]
Parse error: syntax error, unexpected '.' in /home/www/***/html/***/test/galerie/includes/phpbb_sessions.php on line 6

Hi, it says something wrong in phpbb_sessions.php file on line 6, this line is:
Code: [Select]
$phpbb_root_path = PHPBB3_PATH;
There is no "." unless you made some modifications in there.

Code: [Select]
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');

looks pretty for me.

Can you give more details on how applications are located on your server and what exactly contains on line 6 in phpbb_sessions.php file?

From your config it should be something like this:
Code: [Select]
/public_html
    /forum
    /galerie

Is this correct?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Steffen13 on January 22, 2010, 01:23:26 AM


From your config it should be something like this:
Code: [Select]
/public_html
    /forum
    /galerie

Is this correct?

this is correct, yes

and this is line 6

Code: [Select]
$phpbb_root_path = PHPBB3_PATH;
how must i modify this line correctly? i think the error is in there?
Code: [Select]
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');

good night ;)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on January 22, 2010, 01:30:37 AM
Then everything is correct. Try commenting out lines one-by-one (in both config and phpbb_sessions files, starting from line 6 in phpbb_sessions.php) and look carefully maybe you accidently put dot somewhere and didn't notice that.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Steffen13 on January 22, 2010, 08:19:53 AM
good morning,

i installed the ready-made modified version of the 4images gallery.

so, that is your version. the only modification is in the config.php.
there is all correctly you say.  I do not know how to go.

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
when i change _bridge_OFF, the gallery works fine, but not with the forum.
i installed the gallery and the forum in the same database.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Steffen13 on February 05, 2010, 09:14:09 AM
hi, I starting a new  experiment. Is it right that both systems installed in one database?

i whant updating my system to the phpbb3.xx

Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on February 08, 2010, 01:23:16 PM
Hello

I tested version "modded.zip" but :

error :
Code: [Select]
Warning: require(\\CONFIG.PHP) [function.require]: failed to open stream: No such file or directory in E:\wamp\www\includes\phpbb_sessions.php on line 9
Config.php :

Code: [Select]
$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "wall";
$db_user = "root";
$db_password = "";

$table_prefix = "4images_";

define("4IMAGES_ACTIVE", 1);

define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'forum').'/');
define('PHPBB3_URL', 'http://localhost/forum/');

?>

Thanks


the site "demo" --> page blank
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on February 08, 2010, 09:47:13 PM
try these lines in our config.php

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');
define('PHPBB3_URL', '/forum/');
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on February 08, 2010, 10:44:35 PM
Thank you for your reply, I tested, but no change

Does it work with someone? For even on the demo it does not work (blank page)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on February 09, 2010, 12:16:28 AM
Does it work with someone? For even on the demo it does not work (blank page)

Like I have written before in this subject, I did a step by step modification (did not use the attached version) and for me it works great.

If you still have the same error message, it means your path is still wrong and you need to keep trying to find the right path...

also if you get a blank page, try this solution http://www.4homepages.de/forum/index.php?topic=26013.msg143481#msg143481
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on February 10, 2010, 11:29:36 AM
I'll try, will it be possible that you send me a file. Zip or .rar your script by email?

Edit : His march, but I have an error when I change page it disconnects me

I connect via the website, I am redirected to the forum -> ok
I return to the site I'm Disconnected
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on February 10, 2010, 01:59:07 PM
I'll try, will it be possible that you send me a file. Zip or .rar your script by email?

Edit : His march, but I have an error when I change page it disconnects me

I connect via the website, I am redirected to the forum -> ok
I return to the site I'm Disconnected

My files are modded so much, that they will be no use for you.. sorry about that..

So I understand I works for you finally?
If you are kicked off after the site redirects you back to the 4images, try to clean all of your cookies in the browser and check if the user is being automatically inserted into the 4images_users table. If the user if inserted properly we'll look for another problem....

I attach only 2 files that have not been modified from my installation (phpBB.php and phpBB_sessions.php)... try to replace your files with mine (backup your files first!!)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on February 10, 2010, 05:32:45 PM
I'll try, will it be possible that you send me a file. Zip or .rar your script by email?

Edit : His march, but I have an error when I change page it disconnects me

I connect via the website, I am redirected to the forum -> ok
I return to the site I'm Disconnected

My files are modded so much, that they will be no use for you.. sorry about that..

So I understand I works for you finally?
If you are kicked off after the site redirects you back to the 4images, try to clean all of your cookies in the browser and check if the user is being automatically inserted into the 4images_users table. If the user if inserted properly we'll look for another problem....

I attach only 2 files that have not been modified from my installation (phpBB.php and phpBB_sessions.php)... try to replace your files with mine (backup your files first!!)


Ok, I took your files, no change

Edit :

I connect via the website, I am redirected to the forum -> ok
I return to the site I'm always online, then when I click on a page of the site I am disconnected,
I test on a virgin version

the user is present in both databases

Thanks :)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on March 04, 2010, 07:32:24 PM
@satine88, merci for posting about "blank page" issue, this one quite strange and hard to reproduce, but I think I found and fixed a problem. If you will find it again please post back with as much info as you can find, error logs would be really helpful. I updated files attached to post with latest modifications.

@alekseyn1, thanks a lot for trying to help while I was away  :thumbup:

Hello
I tested version "modded.zip" but :
error :
Code: [Select]
Warning: require(\\CONFIG.PHP) [function.require]: failed to open stream: No such file or directory in E:\wamp\www\includes\phpbb_sessions.php on line 9Config.php :
Code: [Select]
$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "wall";
$db_user = "root";
$db_password = "";
$table_prefix = "4images_";
define("4IMAGES_ACTIVE", 1);
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'forum').'/');
define('PHPBB3_URL', 'http://localhost/forum/');
?>

Thanks

the site "demo" --> page blank

This is definitely means you made an error with paths. Following line should be at least like this:
Code: [Select]
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/forum').'/');Note the slash before forum.

I'll try, will it be possible that you send me a file. Zip or .rar your script by email?
Edit : His march, but I have an error when I change page it disconnects me
I connect via the website, I am redirected to the forum -> ok
I return to the site I'm Disconnected

Ok, I took your files, no change
Edit :
I connect via the website, I am redirected to the forum -> ok
I return to the site I'm always online, then when I click on a page of the site I am disconnected,
I test on a virgin version
the user is present in both databases
Thanks :)

Something wrong with sessions. I suggest you clear cookies and sessions in you browser or try with another browser.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: qBass17 on March 13, 2010, 10:01:45 AM
Please make a WBBLite2 Bridge: http://www.woltlab.com/products/burning_board_lite/index.php
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Player73 on March 19, 2010, 11:01:29 PM
Hi.

I try to use:
- Joomla 1.5.14
- phpbb3
- 4image

2gether

- Joomla 1.5 ---2--- phpbb3 bridge working fine = mehdiplugins|-c-o-m-|/misc/phpbbjoom.htm
- 4images 1.77 - standalone - working
- 4images 1.77 ---2--- phpbb3.0.5 bridge from you, I'm still adjusting


First I've got the following error, than I reajusted something:

Quote
Warning: require() [function.require]: open_basedir restriction in effect. File(/../phpbb/3/config.php) is not within the allowed path(s): (/var/www/*domainname*/www/htdocs:/usr/share/php:/usr/share/pear:/tmp:/var/www/*domainname*/www/htdocs:/home/*user*/domains/*domainname*/www/htdocs) in /home/*user*/domains/*domainname*/www/htdocs/4images/includes/phpbb_sessions.php  on line 17

Warning: require(/../phpbb/3/config.php) [function.require]: failed to open stream: Operation not permitted in /home/*user*/domains/*domainname*/www/htdocs/4images/includes/phpbb_sessions.php on line 17

Now I get this Error in 4images after following your tutorial "An unexpected error occured. Please try again later."

what can I change or try different?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on March 19, 2010, 11:10:19 PM
Quote
Warning: require() [function.require]: open_basedir restriction in effect. File(/../phpbb/3/config.php) is not within the allowed path(s): (/var/www/*domainname*/www/htdocs:/usr/share/php:/usr/share/pear:/tmp:/var/www/*domainname*/www/htdocs:/home/*user*/domains/*domainname*/www/htdocs) in /home/*user*/domains/*domainname*/www/htdocs/4images/includes/phpbb_sessions.php  on line 17

Warning: require(/../phpbb/3/config.php) [function.require]: failed to open stream: Operation not permitted in /home/*user*/domains/*domainname*/www/htdocs/4images/includes/phpbb_sessions.php on line 17

Now I get this Error in 4images after following your tutorial "An unexpected error occured. Please try again later."

what can I change or try different?

Can you please post what do you have in your config files?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Player73 on March 19, 2010, 11:47:04 PM
thx for the fast reply

sure, PW and Username, were renamed, don't want them to float over the net ;)
I recognized, in the beginning that one of the configuration files messed around the "$" symbol to "/" could that be a problem? I already changed it, but there is no change to the frontend

The structure is like that:

domain
domain/15/ = joomla
domain/phpbb/3/ = phpbb
domain/4images/ = 4images


4gallery
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype "mysql";
$db_host "localhost";
$db_name "username_joomla_15";
$db_user "username";
$db_password "1234567890$PASSWORD";

$table_prefix "4images_";

define("4IMAGES_ACTIVE"1);
define('PHPBB3_BRIDGE_ON'true);
define('PHPBB3_PATH'realpath(realpath(dirname(__FILE__)).'<phpbb_root>').'/../phpbb/3/');
define('PHPBB3_URL''<phpbb_url>');
?>


phpbb3
Code: [Select]
<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms 'mysqli';
$dbhost '';
$dbport '';
$dbname 'username_joomla_15';
$dbuser 'username';
$dbpasswd '1234567890$PASSWORD';
$table_prefix 'phpbb3_';
$acm_type 'file';
$load_extensions '';

@
define('PHPBB_INSTALLED'true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
?>

Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on March 19, 2010, 11:50:25 PM
@Player73, lines 35-36 are not correct at all in you 4images/config.php, don't you see it? There should be a path, and placeholders like "<phpbb_url>" should be replaced with your values.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Player73 on March 19, 2010, 11:55:01 PM
to be honest I'm really new in coding ;)
- I just followed your instructions, and other tutorials.
so I didn't see it, what would be an example?
What could I enter there, if you give me an example, I will enter my information there =)

is it important to xxx: xxx: domainnamexxx: /folder/subfolder
?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on March 19, 2010, 11:58:35 PM
to be honest I'm really new in coding ;)

so I didn't see it, what would be an example, what I could enter there, if you give me one, I will enter my information there =)

According to your previous info it should be something like that:
Code: [Select]
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../phpbb/3/') . '/');
define('PHPBB3_URL', '/phpbb/3/');
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Player73 on March 20, 2010, 12:38:37 AM
thanks a lot for the help =) I followed your instructions.

Well now I'm back at the old problem: "An unexpected error occured. Please try again later."

Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype "mysql";
$db_host "localhost";
$db_name "user_joomla_15";
$db_user "user";
$db_password "123456$password";

$table_prefix "4images_";

define("4IMAGES_ACTIVE"1);
define('PHPBB3_BRIDGE_ON'true);
define('PHPBB3_PATH'realpath(realpath(dirname(__FILE__)).'/../phpbb/3/') . '/');
define('PHPBB3_URL''/phpbb/3/');
?>



either I made an error while following your step for step instructions, or the two bridges don't like each other.

I will come back to you tomorow, I try to install it again from the scratch 2 times before I make you more efforts.


*edit*

I think I've made an error again in the config ;)

Code: [Select]
/home/username/domains/domain-name.de/www/htdocs/phpbb/3
/home/username/domains/domain-name.de/www/htdocs/4images

woaharrrr.... I want it to work *going crazy* ^^
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Guldstrand on May 31, 2010, 02:31:16 PM
I´m getting the following errors when i enable this mod:

Quote
Notice: Constant GROUPS_TABLE already defined in /*****/forum/includes/constants.php  on line 224

Notice: Constant SESSIONS_TABLE already defined in /*****/forum/includes/constants.php on line 247

Notice: Constant USERS_TABLE already defined in /*****/forum/includes/constants.php on line 262

Fatal error: SQL ERROR [ mysql ]



An sql error occurred while fetching this page. Please contact an administrator if this problem persists. in /*****/forum/includes/db/dbal.php on line 697
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Guldstrand on June 02, 2010, 12:16:47 AM
I´m getting the following errors when i enable this mod:

Quote
Notice: Constant GROUPS_TABLE already defined in /*****/forum/includes/constants.php  on line 224

Notice: Constant SESSIONS_TABLE already defined in /*****/forum/includes/constants.php on line 247

Notice: Constant USERS_TABLE already defined in /*****/forum/includes/constants.php on line 262

Fatal error: SQL ERROR [ mysql ]



An sql error occurred while fetching this page. Please contact an administrator if this problem persists. in /*****/forum/includes/db/dbal.php on line 697
Any help on this? Please...
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on June 02, 2010, 12:38:19 AM
Any help on this? Please...

So what did you say SQL error message says exactly? What versions of 4images and phpBB do you use? Did you tried to check step by step your modifications? Do you have any other MODs for 4images or phpBB or both? Did you tried to switch them off one by one to avoid any possible conflicts?

Or should I guess an answers by myself?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Guldstrand on June 02, 2010, 12:40:55 AM
Any help on this? Please...

So what did you say SQL error message says exactly? What versions of 4images and phpBB do you use? Did you tried to check step by step your modifications? Do you have any other MODs for 4images or phpBB or both? Did you tried to switch them off one by one to avoid any possible conflicts?

Or should I guess an answers by myself?
I´m not using any other mods/plugins, on either phpbb or 4images.
I´m using the latest versions of both the forum and the gallery.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on June 02, 2010, 01:08:04 AM
I´m not using any other mods/plugins, on either phpbb or 4images.
I´m using the latest versions of both the forum and the gallery.

Just updated demo installation at http://bridge.boxup.us to phpBB version 3.0.7-PL1 (latest stable) and see no any issues at all. Please make sure you did modification correctly, this is the only thing I can suggest you for now.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Guldstrand on June 02, 2010, 01:11:59 AM
I´m not using any other mods/plugins, on either phpbb or 4images.
I´m using the latest versions of both the forum and the gallery.

Just updated demo installation at http://bridge.boxup.us to phpBB version 3.0.7-PL1 (latest stable) and see no any issues at all. Please make sure you did modification correctly, this is the only thing I can suggest you for now.
I used the modified files in the first post, so it can´t be anything that i´ve done.
Not sure on how to fix this.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on June 02, 2010, 03:27:30 AM
I used the modified files in the first post, so it can´t be anything that i´ve done.
Not sure on how to fix this.

This can't be true, I just downloaded modded.zip, unpacked it on my hosting and copied configuration file from previous installation: http://bridge.boxup.us/modded/ — works like it should work without any glitches.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Flori88 on June 11, 2010, 01:41:54 PM
Hello everybody,

Thank you for this great Mod, Denis.

My installation is like this:

mydomain
mydomain/galerie(4images)
mydomain/forum(phpbb3)

everything ist working fine.....
but there is one mistake:

When i try to start the website (mydomain/galerie) first time,( it means, all cokies an last visits are deletet)  is only a blanck sreen..??
But if i make a second klick, or aktuall (for example F5) the website is loading normal !

When i try to start from (mydomain/forum)the website is loading normal!

my config.php  4images:

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype "mysql";
$db_host "xxx";
$db_name "xxx";
$db_user "xxx";
$db_password "xxx";

$table_prefix "4images_";

define("4IMAGES_ACTIVE"1);
define('PHPBB3_BRIDGE_ON'true);
define('PHPBB3_PATH''/srv/www/vhosts/mydomain/httpdocs/forum/');
define('PHPBB3_URL''http://mydomain.com/forum/');
?>

Where is the mistake??

Thank you for help

Flor
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on June 11, 2010, 07:29:36 PM
When i try to start the website (mydomain/galerie) first time,( it means, all cokies an last visits are deletet)  is only a blanck sreen..??
But if i make a second klick, or aktuall (for example F5) the website is loading normal !

Hi, yeah, I know this problem, I even reproduced it on demo installation and made an attempt to fix it, but sometimes it's still shows blank screen on first visit. It's not your error anywhere. And I have in my plans to find a solution or workaround for this problem, at the moment the only thing I can suggest you is as you said reload a page or start browsing from forum pages.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: dunyakupasi on June 12, 2010, 02:05:54 AM
thanks for help, wonderful
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: WWTNET on June 19, 2010, 06:57:45 AM
Hi guys,

with this bridge, can you also import old users or it-s just for fresh installation 4images+phpbb ? i would like to apply it to an older site...

Thanks!
D.R.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: vovka13 on July 01, 2010, 03:25:25 PM
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?
хм... похоже какие-то бока с файлом phpbb.php. от него пустая страница.
и еще, не пойму каким образом идет автоматический логин в галерею если логиниться через форум. в обратную сторону понятно, в галерее меняются файлы, но в форуме же ничего не меняется.....
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on July 01, 2010, 03:30:41 PM
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?

Если белую страницу обновить — она остаётся белой или загружает нормально? Если сначала зайти на форум, а не в галерею то же самое происходит?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: vovka13 on July 01, 2010, 04:13:16 PM
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?

Если белую страницу обновить — она остаётся белой или загружает нормально? Если сначала зайти на форум, а не в галерею то же самое происходит?

на форум все нормально заходит.
разбираюсь дальше с файлом phpbb_sessions.php

Code: [Select]
require($phpbb_root_path . '/config.' . $phpEx);
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);

переменные $acm_type и $dbms по ходу пустые.....

Денис, ай нид хелп! :)

включил контроль ошибок в phpbb_sessions.php

Notice: Constant GROUPS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php  on line 224
Notice: Constant SESSIONS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 247
Notice: Constant USERS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 262
Fatal error: SQL ERROR [ mysql ]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists. in Z:\home\localhost\www\love\s\f\includes\db\dbal.php on line 697
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on July 09, 2010, 09:59:40 PM
Hello

When you want to connect, the site download a file, test yourself:

http://www.fond-ecran-gratuit.biz/
Code: [Select]
Login: ffi
password: 123456
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on July 10, 2010, 04:00:31 AM
включил контроль ошибок в phpbb_sessions.php

Notice: Constant GROUPS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php  on line 224
Notice: Constant SESSIONS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 247
Notice: Constant USERS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 262
Fatal error: SQL ERROR [ mysql ]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists. in Z:\home\localhost\www\love\s\f\includes\db\dbal.php on line 697

Константы, да, к сожалению, пересекаются. Что вызывает ошибку не знаю. Какая версия phpBB и какие моды, если есть? Настройки доступа к БД правильно прописаны?

When you want to connect, the site download a file, test yourself:

Server related issue. Try creating (or append following line to existing) .htaccess file:
Code: [Select]
AddType application/x-httpd-php .php
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on July 10, 2010, 08:00:26 PM
Thank you for your help, but it does not work

Login.php :
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: login.php                                            *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 0;

$nozip 1;
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');

$error 0;
if (
$user_info['user_level'] != GUEST || empty($HTTP_POST_VARS['user_name']) || empty($HTTP_POST_VARS['user_password'])) {
  if (!
ereg("index.php"$url) && !ereg("login.php"$url) && !ereg("register.php"$url) && !ereg("member.php"$url)) {
    
redirect($url);
  }
  else {
    
redirect("index.php");
  }
}
else {
  
$user_name trim($HTTP_POST_VARS['user_name']);
  
$user_password trim($HTTP_POST_VARS['user_password']);
  
$auto_login = (isset($HTTP_POST_VARS['auto_login']) && $HTTP_POST_VARS['auto_login'] == 1) ? 0;

  if (
$site_sess->login($user_name$user_password$auto_login)) {
    if (!
ereg("index.php"$url) && !ereg("login.php"$url) && !ereg("register.php"$url) && !ereg("member.php"$url)) {
      
redirect($url);
    }
    else {
      
redirect("index.php");
    }
  }
  else {
    
$error $lang['invalid_login'];
  }
}
if (
$error) {
  
$main_template "error";
  include(
ROOT_PATH.'includes/page_header.php');
  
show_error_page($error);
}
?>
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on July 10, 2010, 08:07:44 PM
It seems like there is no
Code: [Select]
http://www.fond-ecran-gratuit.biz/forum/login.php
on server, login.php downloads with

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
  <head>
    <title>404 Not Found</title>
  </head>
  <body>
    <!--
      Error documents (pages) under 512 bytes
      are ignored by the IE5+ browser, this
      comment is used to bypass this size
      ......................................
      ......................................
      ......................................
    -->
    <h1>Not Found</h1>
    <p>The requested URL was not found on this server.</p>
    <hr/>
  </body>
</html>

content.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: satine88 on July 10, 2010, 08:08:51 PM
It seems like there is no
Code: [Select]
http://www.fond-ecran-gratuit.biz/forum/login.php on server.

My .htaccess :

Code: [Select]
#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

Deny from 41.200.227.16

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

RewriteRule ^sitemap.xml$ google.php
RewriteRule ^sitemap2.xml$ google2.php
RewriteRule ^sitemap3.xml$ google3.php
RewriteRule ^sitemap4.xml$ google4.php
RewriteRule ^sitemap5.xml$ google5.php
RewriteRule ^sitemap6.xml$ google6.php

RedirectPermanent /heberger http://www.fond-ecran-gratuit.biz/heberger-images/
RedirectPermanent /jeux-flash http://www.fond-ecran-gratuit.biz/jeux/
RedirectPermanent /forum/profile.php?mode=register http://www.fond-ecran-gratuit.biz/forum/ucp.php?mode=register


#Mod_bmollet : This is to make search function work  ( redirect links from search results )

RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .php

RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}



# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^www\.fond-ecran-gratuit\.biz$ [NC]
# RewriteRule ^(.*)$ http://www.fond-ecran-gratuit.biz/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^forum/(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /forum/viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^forum/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^forum/annonces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?t=$2&start=$4 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^forum/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^forum/ressources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /forum/download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
RewriteRule ^forum/(membre|[a-z0-9_-]*-u)([0-9]+)\.html$ /forum/memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^forum/(membre|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /forum/search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^forum/(groupe|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /forum/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^forum/sujets-actifs(-([0-9]+))?\.html$ /forum/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^forum/sans-reponses(-([0-9]+))?\.html$ /forum/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^forum/nouveaux-messages(-([0-9]+))?\.html$ /forum/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^forum/non-lu(-([0-9]+))?\.html$ /forum/search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
RewriteRule ^forum/equipe\.html$ /forum/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^forum/([a-z0-9_-]+)(-([0-9]+))\.html$ /forum/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^forum/([a-z0-9_-]+)\.html$ /forum/viewforum.php?forum_uri=$1 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^forum/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /forum/$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^forum/.+/(styles/.*|images/.*)/$ /forum/$1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################



################################## Errors ######################################
#ErrorDocument 301 /error/301-moved_permanently.html
#ErrorDocument 302 /error/302-moved_temporarily.html
#ErrorDocument 303 /error/303-see_other.html
#ErrorDocument 400 /error/400-bad_request.html
ErrorDocument 401 /error/401-authorization_required.html
#ErrorDocument 402 /error/402-payment_required.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-not_found.html
#ErrorDocument 405 /error/405-method_not_allowed.html
#ErrorDocument 406 /error/406-not_acceptable.html
#ErrorDocument 407 /error/407-proxy_authentication_required.html
ErrorDocument 408 /error/408-request_timed_out.html
#ErrorDocument 409 /error/409-conflicting_request.html
#ErrorDocument 410 /error/410-gone.html
#ErrorDocument 411 /error/411-content_length_required.html
#ErrorDocument 412 /error/412-precondition_failed.html
#ErrorDocument 413 /error/413-request_entity_too_long.html
#ErrorDocument 414 /error/414-request_uri_too_long.html
#ErrorDocument 415 /error/415-unsupported_media_type.html
ErrorDocument 500 /error/500-internal_server_error.html
#ErrorDocument 501 /error/501-not_implemented.html
#ErrorDocument 502 /error/502-bad_gateway.html
ErrorDocument 503 /error/503-service_unavailable.html
#ErrorDocument 504 /error/504-gateway_timeout.html
#ErrorDocument 505 /error/505-http_version_not_supported.html
################################################################################

######################### Howto map /~user to /user ############################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)$ http://%{HTTP_HOST}/$1/ [R,L]
RewriteCond %{REQUEST_URI} ^/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)(.+)$ /~$1/$2
################################################################################

###################### Howto map /users/user to /users/user ####################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/users/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)$ http://%{HTTP_HOST}/users/$1/ [R,L]
RewriteCond %{REQUEST_URI} ^/users/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)(.+)$ /~$1/$2
################################################################################

Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: vovka13 on July 13, 2010, 12:32:52 PM
включил контроль ошибок в phpbb_sessions.php

Notice: Constant GROUPS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php  on line 224
Notice: Constant SESSIONS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 247
Notice: Constant USERS_TABLE already defined in Z:\home\localhost\www\love\s\f\includes\constants.php on line 262
Fatal error: SQL ERROR [ mysql ]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists. in Z:\home\localhost\www\love\s\f\includes\db\dbal.php on line 697

Константы, да, к сожалению, пересекаются. Что вызывает ошибку не знаю. Какая версия phpBB и какие моды, если есть? Настройки доступа к БД правильно прописаны?


версия phpbb  3.0.7-PL1. модов никаких. установлен с нуля. пробовал на 3.0.6 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on July 13, 2010, 12:46:16 PM
версия phpbb  3.0.7-PL1. модов никаких. установлен с нуля. пробовал на 3.0.6 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?

Хм, да никаких. Кинь мне доступ в личку, постараюсь успеть глянуть сегодня.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: vovka13 on July 15, 2010, 04:39:07 PM
версия phpbb  3.0.7-PL1. модов никаких. установлен с нуля. пробовал на 3.0.6 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?

Хм, да никаких. Кинь мне доступ в личку, постараюсь успеть глянуть сегодня.

кинул в личку
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: hotvins on August 20, 2010, 01:01:12 PM
Does this work with customied templates ?

I could not get it working with photography-shot theme of themza.com

I did manual editing exactly as per 1st post and put the two phpbb files, but no use :(

I think I made mistake in this.

Quote
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.

My site is

http://hv.6.je/

phpbb is installed at root and 4images in gal directory so urls for both apps are as below

4images = http://hv.6.je/gal/
phpbb = http://hv.6.je/

what should I put in the above urls field ?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on August 20, 2010, 01:10:30 PM
Does this work with customied templates ?

I could not get it working with photography-shot theme of themza.com

I did manual editing exactly as per 1st post and put the two phpbb files, but no use :(

I think I made mistake in this.

Quote
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.

My site is

http://hv.6.je/

phpbb is installed at root and 4images in gal directory so urls for both apps are as below

4images = http://hv.6.je/gal/
phpbb = http://hv.6.je/

what should I put in the above urls field ?

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../').'/');
define('PHPBB3_URL', '/');
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: hotvins on August 20, 2010, 01:24:27 PM
Does this work with customied templates ?

I could not get it working with photography-shot theme of themza.com

I did manual editing exactly as per 1st post and put the two phpbb files, but no use :(

I think I made mistake in this.

Quote
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.

My site is

http://hv.6.je/

phpbb is installed at root and 4images in gal directory so urls for both apps are as below

4images = http://hv.6.je/gal/
phpbb = http://hv.6.je/

what should I put in the above urls field ?

Code: [Select]
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../').'/');
define('PHPBB3_URL', '/');

Thanks.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: qBass17 on October 22, 2010, 04:32:14 PM
Tested on 4images 1.7.8 + PHPBB 3.0.7 PL1 + Wordpress 3.0.1 (Plugin: http://www.wp-united.com/get-wp-united/)

Works very Fine!!
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: FotoRalle on November 10, 2010, 10:42:22 AM
Gibt es nun eine Lösung dafür, wenn man schon 4images am Laufen hat?

Is there a solution if 4images is already running?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: denisnovikov on November 10, 2010, 10:49:20 AM
Gibt es nun eine Lösung dafür, wenn man schon 4images am Laufen hat?

Is there a solution if 4images is already running?

Hi there, technically — yes. However I didn't implement this feature for phpBB, if you would like to try implement it by yourself you can refer to the user export script uploaded to the vBulletin bridge (http://www.4homepages.de/forum/index.php?topic=23892.0) which implements the same way of integration as this one and adjust it for use with phpBB.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: FotoRalle on November 10, 2010, 01:16:00 PM
Thank you. I will have a look. I did not understand russian - so now it is clear  :D
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Arturh on November 10, 2010, 11:45:55 PM
Just to report I apllied this mod on  4images 1.7.8  and phpBB 3.0.7-PL1  with  MySQL(i) 5.0.77 on a centos-5-x86_64 VPS  (Hostgator)

And all worked fine.

Congratulations and greetings from Mexico
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: FotoRalle on November 12, 2010, 05:14:22 PM
Who can build a user trans similar to the MOD Bridge VBulletin?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: agoesatoeb on January 30, 2011, 06:42:48 AM
When i try to start the website (mydomain/galerie) first time,( it means, all cokies an last visits are deletet)  is only a blanck sreen..??
But if i make a second klick, or aktuall (for example F5) the website is loading normal !

Hi, yeah, I know this problem, I even reproduced it on demo installation and made an attempt to fix it, but sometimes it's still shows blank screen on first visit. It's not your error anywhere. And I have in my plans to find a solution or workaround for this problem, at the moment the only thing I can suggest you is as you said reload a page or start browsing from forum pages.

did you already found the mistakes and have a solution for this dennis?

or anybody can help? cos when it is an "image gallery website", it is so important to have gallerie session as main page instead of forum session..
thanks...
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: wassimo on January 31, 2011, 09:18:25 PM
good , thanks for posting this must so useful ~!
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: kardinal on February 14, 2011, 12:05:48 AM
 :cry: После установки мода перестал заходить в галерею! Помогите что делать :?:
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on February 14, 2011, 04:55:45 AM
:cry: После установки мода перестал заходить в галерею! Помогите что делать :?:

пробовать войти с именем админа от форума а не галлереи

если не получается то описать как можно подробнее ошибку
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on February 21, 2011, 11:43:54 AM
To everyone who installed this MOD....

I had a problem where no search bot was seeing my 4images installation. The forum was perfectly accessible but the gallery was returning 302 redirect error....

more on the problem here  http://www.4homepages.de/forum/index.php?topic=17598.msg155638#msg155638


Well, I finally resolved (sort of) this problem.... The problem was that every search bot that came to site, was properly identified by the forum and a special username was assigned to the bot... the username was ever successfully replicated to 4images users database table, but it all stopped at this point..... and this was confusing 4images.... ohhh man, I spent hour and hours trying to figure out why Google was not able to see my 4images installation.... so finally I have disabled all Search Bots from the control panel of phpBB and it WORKED!!

I suggest you check your 4images gallery here

http://web-sniffer.net/
with user agent: Googlebot

 and if it returns the 302 redirect - disable treating search bots as users within the forum.. I am sure it will fix your issue too...

Denis, any idea what's causing this trouble?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: qBass17 on March 18, 2011, 09:00:33 PM
Tested on 4images 1.7.9 + PHPBB 3.0.8 + Wordpress 3.1 (Plugin: http://www.wp-united.com/get-wp-united/)

Works very Fine!!
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Warrior on April 30, 2011, 02:49:27 AM
Edit:

Ok, guys, I have found a solution to display user's avatar in phpBB when displaying 4images comments. I.e. user avatar is uploaded using the profile editing in phpBB...

inspired by: Using Phpbb3 Avatars In Custom Pages - http://www.volasail.com/2008/04/using-phpbb3-avatars-in-custom-pages/ (http://www.volasail.com/2008/04/using-phpbb3-avatars-in-custom-pages/)

by no means it's a effective or elegan solution. please feel free to modify and amend. Please let me know also so I could modify my code in this message.

here is what you do...

Step 1.

in details.php find:
Code: [Select]
if ($image_allow_comments == 1) {
ADD after:
Code: [Select]
//comments avatars variable initiate
require_once(ROOT_PATH .'includes/phpbb_sessions.php');
        // for using the phpBB function (I could not make it work...) you will see below
//require_once($phpbb_root_path.'includes/functions_display.php');
//comment avatars variable initiate end

Step 1.1
then find:
Code: [Select]
$comment_user_id = $comment_row[$i]['user_id'];
and ADD after:
Code: [Select]
   //sql for comments avatars
    $sql2 = "SELECT user_avatar, user_avatar_type, user_avatar_width,
    user_avatar_height FROM phpbb_users
    WHERE username = '".$comment_row[$i][$user_table_fields['user_name']]."'";
    $result2 = $site_db->query($sql2);
$row2 = $site_db->fetch_array($result2);
    //sql end comment avatars
        if (empty ($row2['user_avatar'])) {
//the following line uses the phpBB built-in function to return avatars, but I could not get it to work...
                //$comment_user_avatar = get_user_avatar($row2['user_avatar'], $row2['user_avatar_type'], $row2['user_avatar_width'], $row2['user_avatar_height']);
$comment_user_avatar = "";
}
else {
$comment_user_avatar = "<img src='".PHPBB3_URL."/download/file.php?avatar=".$row2['user_avatar']."'>";
        }  

Step 2.
in comment_bit.html (within your template folder)

find:
Code: [Select]
<b>{comment_user_name}</b><br />
and ADD after:
Code: [Select]
{comment_user_avatar}<br />
That's it for standard installation of 4images.

if you use reply to Comments like on YouTube MOD - http://www.4homepages.de/forum/index.php?topic=23498.0
then continue

Step 3.
in details.php find:
Code: [Select]
$response_row = $site_db->query_firstrow($sql);
and ADD after:
Code: [Select]
//sql for comments response avatars
    $sql3 = "SELECT user_avatar, user_avatar_type, user_avatar_width,
    user_avatar_height FROM phpbb_users
    WHERE username = '".$response_row['response_user_name']."'";
    $result3 = $site_db->query($sql3);
$row3 = $site_db->fetch_array($result3);
//sql end for comment response avatars

          if (empty ($row3['user_avatar'])) {
 $response_user_avatar = "";
          } else {
                  $response_user_avatar = "<img src='".PHPBB3_URL."/download/file.php?avatar=".$row3['user_avatar']."' width='50' height='50'>";
 }

Step 4.
find:

Code: [Select]
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_name."</b> (".$response_user_info.")</td>\n";
and REPLACE by:

Code: [Select]
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_avatar.$response_user_name."</b> (".$response_user_info.")</td>\n";

After doing the bridge, I have done this, but nothing is showing up. Not even errors!

is there another step that wasn't included here?

I am also using the AJAX comment form MOD.

I wouldn't think that'd interfere, would it? None of the above coding was anywhere within any of the AJAX coding.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on April 30, 2011, 07:21:23 PM
if I remember right, the AJAX comments MOD requires you to modify details.php and ajaxcomments.php.... make sure you modify details.php first, and then do the same in ajaxcomments.php
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Warrior on April 30, 2011, 09:02:19 PM
Ok. Did that. Still the same thing. The break is there from the template, but the av is not. As before, when I make a comment, the {comment_user_avatar} shows up, then upon a refresh, even it disappears.

http://www.lonewolf-grafix.com/sample4/details.php?image_id=25
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on April 30, 2011, 09:27:23 PM
zip up the two files and let me have a look... attach them here
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Warrior on April 30, 2011, 09:42:35 PM
Here ya go.

Keep in mind- With or without the av mods to the AJAX file, it did the same thing.

I am getting NO errors either way. It's just nothing showing, like the template code isn't declared somewhere or something.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on April 30, 2011, 10:21:11 PM
that's exactly what was missing... template veariable...

in both files do this:

find
Code: [Select]
"comment_user_email_button" => ($show_comment  == 0) ? "" : $comment_user_email_button,
and add after

Code: [Select]
"comment_user_avatar" => $comment_user_avatar, //new line

my tutorial updated
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Warrior on April 30, 2011, 10:33:23 PM
That did it, although I was actually looking for in each:
Code: [Select]
"comment_user_email_button" => $comment_user_email_button,
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Warrior on May 02, 2011, 02:30:55 AM
Any chance of getting a true bridge, rather than an integration, with phpBB2, similar to what is done with phpBB3?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: wutz on July 20, 2011, 03:57:40 PM
4images 1.7.10 + PHPBB 3.0.9 + Joomla 1.5.23 + Jfusion 1.5.5 (Useranmeldung Joomla und phpBB3 gleichzeitig)

funktioniert prima  :D

bei Änderung des Benutzers in Joomla ist beim ersten laden die index.php weiß Reload und alles ist OK
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: alekseyn1 on October 19, 2011, 11:54:08 AM
anybody who installed this bridge, is having a redirection problem? If user logs in from a 4images page (any page) he is not redirected back to the same page after the login, but to the main 4images page... the redirect parameter is correct, but for some reason it's not working...
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Bugfixed on December 20, 2011, 09:29:14 PM
Hi Thanks for the mode.
my system as follows:
phpbb 3.0.9, 4images 1.7.10, php 5.3.8, apache 2.2.21 on linux centos 5.7.

4images version 1.7.10, this line: $ user_password = md5 ($ user_password), unfortunately not.

I did not find others to skip this line.

  I can login to the forum but I want to access the gallery I get the error 403 access forbidden. go out when you have made the forum again, I can access the gallery again.

If it helps me very happy. There are thousands of members on my site.
Thank you in advance for your help.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Bugfixed on January 07, 2012, 10:07:07 AM
Hi Thanks for the mode.
my system as follows:
phpbb 3.0.9, 4images 1.7.10, php 5.3.8, apache 2.2.21 on linux centos 5.7.

4images version 1.7.10, this line: $ user_password = md5 ($ user_password), unfortunately not.

I did not find others to skip this line.

  I can login to the forum but I want to access the gallery I get the error 403 access forbidden. go out when you have made the forum again, I can access the gallery again.

If it helps me very happy. There are thousands of members on my site.
Thank you in advance for your help.

please help me.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: (a)lex on March 16, 2012, 11:06:57 PM
Hallo liebe Gemeinde,

ich habe diese Bridge schon seit etlichen Jahren im Einsatz. Erst zu meinem phpbb2 und dann zu meinem phpbb3. Das lief bis auf ein paar Zicken mit denen man aber gut leben konnte immer relativ gut.

Nun wird die PHP-Version auf die 5.3.x umgestellt und der Ofen ist aus.

Folgende Symptome:
=============
- Ich kann mich am Forum ganz normal anmelden
- Versuche ich dann in die Galerie zu gehen, bin ich plötzlich Gast
- Komme ich zurück zum Forum, bin ich ausgeloggt

Obendrein scheint es so als ob für jeden Seitenaufruf (d.h. ich rufe einfach verschiedene Kategorien auf) eine neue Session id in die Sessiontabelle geschrieben wird.

Ich habe nicht die geringste Ahnung wonach ich überhaupt suchen soll.
Hat jemand ein ähnliches Problem oder besser noch - das Problem schon gelöst?

Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Rembrandt on March 17, 2012, 05:56:27 AM
Willkommen im Forum!
...Nun wird die PHP-Version auf die 5.3.x umgestellt und der Ofen ist aus.
.....
Dir wird nichts anderes übrig bleiben als deine 4images Version zu erneuern.
In dieser Version sind einige PHP Funktionen die nicht mehr funktionieren werden.

mfg Andi
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: (a)lex on March 17, 2012, 07:42:25 AM
Hallo Rembrand,

sorry - unvollständige Informationen. Ich habe immer Updates gemacht und derzeit 4images 1.7.10 und phpbb 3.0.10 im Einsatz. Das läuft bis zu bis zu php 5.2.x auch alles einwandfrei. Ich habe die wage Vermutung, dass in den beiden einzufügenden Dateien der Bridge veralteter Code enthalten ist. Das ist aber nur eine Vermutung. Ich bin da echt absolut ratlos und vor allem php-technisch eher Bastler mit gefährlichem Halbwissen.

Läuft die Bridge denn überhaupt bei Irgendjemandem auf php 5.3.x?

Gruß
- ALEX -
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: (a)lex on March 18, 2012, 02:24:10 PM
ENTWARNUNG

Um es kurz zu machen - ich bin ein Trottel. Ich hatte schon die Bridge ausgebaut und ein Script erstellt, welches die Daten aus der phpbb3-Datenbank in die 4images-Datenbank schaufelt und auch die Verschlüsselung umgebogen. Dann fiel mir plötzlich auf, dass die in phpbb3 hinterlegte Cookiedomain noch nicht umgestellt war. Ich war doch für den test auf ein anderes System umgezogen. Also umgestellt - und potz Blitz - läuft scheinbar wie geschmiert.

Trotzdem vielen Dank!

Ergebnis: Bridge works with phpbb 3.0.10 an 4images 1.7.10 fine!
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: lazarustrk on April 18, 2012, 11:28:43 PM
teşekkürler TR / giresun  :)
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Bugfixed on May 21, 2012, 08:33:12 PM
hello.

 i have this errors: Notice: Constant GROUPS_TABLE already defined in ......includes/constants.php on line 235

Notice: Constant SESSIONS_TABLE already defined in ......includes/constants.php on line 259

Notice: Constant USERS_TABLE already defined in ......includes/constants.php on line 274

---

and not display admin cp link  :(
Are introduced to smooth the gallery. However, despite the admin section, gallery administrator privileges does not seem effective.

My system: 4images 1.7.10, Phpbb 3.0.10, Httpd 2.2.21, Php 5.3.13, mysql 5.5.24 on centos 5.8

Please help me thanks.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Bugfixed on August 12, 2012, 02:11:57 PM
Please update mod to 4images 1.7.11 and phpbb3 3.0.10
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: interbi on September 16, 2012, 07:38:47 PM
Hello!
Several problems appeared after integration 4images and phpBB3:
1. Unable to log in 4images;
2. Closed session to phpBB after any action on 4images's any page (click or page refresh).
How to fix it?

System Information:
4images 1.7.11
phpbb3 3.0.11
PHP 5.3.3-7
Apache 2.2.16
MySQL 5.1.63


Or, please update mod to 4images 1.7.11 and phpbb3 3.0.11.
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: interbi on November 26, 2012, 03:52:21 PM
I found out why this is happening:
This SQL-QUERY:
Code: [Select]
Query     INSERT INTO phpbb_sessions  (session_user_id, session_start, session_last_visit, session_time, session_browser, session_forwarded_for, session_ip, session_autologin, session_admin, session_viewonline, session_page, session_forum_id, session_id) VALUES (1, 1353938641, 1353938641, 1353938641, 'Mozilla/5.0 (<My_OS>) Gecko/20100101 Firefox/15.0', '', '<My_IP>', 0, 0, 1, '../4images/index.php', 0, 'bdd93ee4a4525d342586452f8f88b8bd')
Unreadable session reason in phpbb_sessions.php
What should I do to fix this?
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Bugfixed on December 18, 2012, 07:20:54 PM
I found out why this is happening:
This SQL-QUERY:
Code: [Select]
Query     INSERT INTO phpbb_sessions  (session_user_id, session_start, session_last_visit, session_time, session_browser, session_forwarded_for, session_ip, session_autologin, session_admin, session_viewonline, session_page, session_forum_id, session_id) VALUES (1, 1353938641, 1353938641, 1353938641, 'Mozilla/5.0 (<My_OS>) Gecko/20100101 Firefox/15.0', '', '<My_IP>', 0, 0, 1, '../4images/index.php', 0, 'bdd93ee4a4525d342586452f8f88b8bd')
Unreadable session reason in phpbb_sessions.php
What should I do to fix this?

i have same problem. :(

Please help...
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: senloel on December 15, 2013, 03:23:07 PM
Hey,

I have a little question regarding this MOD:
What if I have created additional user fields for registration in my 4images gallery and want to use this bridge?

Will these additional user fields also be entered in the database?

Thank you for your help!

Patrick

--------------------------------------------

Hallo,

ich habe eine kleine Frage zu diesem MOD:
In meiner Galerie habe ich additional user fields für die Registration angelegt und möchte nun diese bridge einbauen.

Was muss ich dann tun, damit die additional user fields ebenfalls in die Datenbank geschrieben werden?

Ich bin über jede Hilfe dankbar!

Grüße,
Patrick
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: ELO on February 25, 2015, 05:50:42 PM
Will there be an update to phpbb 3.1.+ ?

Thanks
Michael
Title: Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
Post by: Quiff Boy on June 29, 2020, 04:47:01 PM
Just bumping this topic to ask if there's going to be a version for phpBB3.3?

I've been running a phpBB2 site for years with a 4Images v1.7.4  gallery, and am about to update the forum to phpBB3.3 but have no way of updating the gallery to integrate with phpBB3.3.