4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: denisnovikov on October 07, 2009, 03:00:33 PM
-
IMPORTANT NOTICE: create backups BEFORE applying this mod to your applications!
Index
- Introduction
- Demo
- List of changed files
- Installation
- Notes
- Known issues
- Version history
- Extras
Introduction
This mod allows to use both 4images and phpBB application transparently for users as they are one application. Registration and login are handling by the phpBB app, users are creating into 4images database “on-the-fly”, on first request of any of the 4images pages by logged in user.
Demo
http://bridge.boxup.us/
4images (ver. 1.7.7) + phpBB (ver. 3.0.7) updated on 4th March 2010
List of changed files
New files:
includes/phpbb.php
includes/phpbb_sessions.php
Modified:
config.php
includes/sessions.php
includes/page_header.php
admin/admin_global.php
admin/index.php
templates/default/user_loginform.html
Installation
Step 1. New files
Download new files and place them:
a) phpbb.php into includes directory;
b) phpbb_sessions.php into includes directory.
Step 2. config.php
Add at the end of the file, before “?>” symbols:
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:
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
Replace with:
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1, $do_md5 = true) {
Locate somewhere around line 191:
$user_password = md5($user_password);
Replace with:
if($do_md5 == true) $user_password = md5($user_password);
Locate somewhere around line 418:
// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();
Add following code after:
include_once(realpath(dirname(__FILE__)).'/phpbb.php');
Step 4. includes/page_header.php
Locate:
Copyright © 2002-'.date('Y').' <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</p>
',
Add following code right after:
"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:
// Include default languages
Add following code before:
// 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:
<form action="<?php echo $site_sess->url(ROOT_PATH."admin/index.php"); ?>" method="post">
Replace with:
<form action="<?php echo $login_admin_form_action; ?>" method="post">
<?php echo $login_admin_additional_form_fields; ?>
Locate:
<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:
<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):
if ($action == "head") {
?>
<html dir="<?php echo $lang['direction']; ?>">
Add following code right between “if ($action == "head") {“ and “?>”:
// 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:
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a> | <a href="<?php echo $site_sess->url(ROOT_PATH."admin/index.php?logout=1"); ?>" target="_top"><?php echo $lang['logout']; ?></a> </b></TD>
Replace with:
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a> | <a href="<?php echo $url_logout; ?>" target="_top"><?php echo $lang['logout']; ?></a> </b></TD>
Step 7. templates/default/user_loginform.html
Locate:
<input type="text" size="10" name="user_name" class="logininput" />
Replace with:
<input type="text" size="10" name="{login_user_name_form_field}" class="logininput" />
Locate:
<input type="password" size="10" name="user_password" class="logininput" />
Replace with:
<input type="password" size="10" name="{login_user_password_form_field}" class="logininput" />
{login_additional_form_fields}
Locate:
<td><input type="checkbox" name="auto_login" value="1" /></td>
Replace with:
<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
$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/
-
Did anyone implemented this integration?
-
Updated the first post with link to demo.
-
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
-
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
-
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.
-
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.
-
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.
-
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.
-
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.
-
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!
-
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.
-
I made a mistake in config.php, now everything is ok. Thanks! :wink:
-
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!
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.... :(
-
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!
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
$dbms = 'mysqli';
Thanks to alekseyn1 for finding.
-
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:
if ($image_allow_comments == 1) {
ADD after:
//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:
$comment_user_id = $comment_row[$i]['user_id'];
and ADD after:
//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
"comment_user_email_button" => ($show_comment == 0) ? "" : $comment_user_email_button,
and add after
"comment_user_avatar" => $comment_user_avatar, //new line
Step 2.
in comment_bit.html (within your template folder)
find:
<b>{comment_user_name}</b><br />
and ADD after:
{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:
$response_row = $site_db->query_firstrow($sql);
and ADD after:
//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:
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_name."</b> (".$response_user_info.")</td>\n";
and REPLACE by:
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_avatar.$response_user_name."</b> (".$response_user_info.")</td>\n";
-
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
-
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.
-
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
if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
if ($bbuser->data['user_id'] > 0 && $bbuser->data['user_email'] !== $user_info['user_email']) {
-
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
if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
if ($bbuser->data['user_id'] > 0 && $bbuser->data['user_email'] !== $user_info['user_email']) {
Yes, only this file and only this line.
-
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 ...
-
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
if ($bbuser->data['user_email'] !== $user_info['user_email']) {
to
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
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.
-
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
-
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
-
C phpBB 3.0.6 не работает, да? Я попробовал, не фурычит.
-
C phpBB 3.0.6 не работает, да? Я попробовал, не фурычит.
Плохо попробовал: http://bridge.boxup.us/ - phpBB 3.0.6
-
Ставил уже готовую "modded" 4images, что приаттачена здесь, и ставил phpBB3.0.6 только что скачанную. На локальный сервер vertrigo.
Реакция такая: при регистрации с 4images перекидывает на форум, там регистрация проходит. Потом при нажатии на "вернуться на предыдущую страниу", то бишь на 4images, начинает открывать и подгружаться галерея, но белый лист и грузит, грузит.. (тем временем открываю форум, там залогинен, нет проблем.)
Пробую опять просто войти в 4images и индикатор что страница все ещё подгружается.. Потом обрываю процесс, захожу в phpmyadmin, смотрю в таблице юзеровв 4images несколько тысяч :!: записей нового юзера, которого я только что регистрировал. (то есть, есть гостевая запись, есть админская запись и несколько тысяч записей нового юзера)
Смахивает на то, что процесс импорта юзера из форума в базу 4images зацикливается.
При простом открытии страницы 4images зацикливается и продолжает непрерывный процесс записи/импорта этого юзера в таблицу 4images.
Вот так вот.. Как и сказал, я сам ничего не делал, просто скачал твой "modded", уже готовый и поставил с phpBB3. И такой результат.
Может приаттачишь тот что работает у тебя на демо?
-
Попробуй пошаговую модификацию... у меня все сработало с первого раза.... (за исключением подключения к базе, которое Денис исправил.. и все заработало хорошо)
-
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:
$additional_user_fields['full_name'] = array($lang['full_name'], "text", 0);
in sessions.php
$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:
// --
// 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.
-
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 :)
-
Hello
I have a error :
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 :
<?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_ip, 0);
}
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_id, 0, $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_id, TRUE);
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'] > 0 ) ? $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_id, 0, $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) ? 0 : 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)) ? 1 : 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 = "&") {
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 = "&") {
global $l, $user_info;
$dummy_array = explode("#", $url);
$url = $dummy_array[0];
$url = str_replace('&', '&', $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'] == 1 || $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) ? 1 : 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&".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
setcookie($cookiename . '_data', serialize($sessiondata), $this->current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $this->session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
-
Hello
I have a error :
Hi, put this code into config.php:
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
And post back errors you will see.
-
Hello
I have a error :
Hi, put this code into config.php:
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
And post back errors you will see.
If I put :
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
With :
$db_servertype = "mysql";
I have :
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 :
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 :
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
-
I have :
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.
-
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)
-
During the installation of this mod, there are:
Step 3. includes/sessions.php
Locate somewhere around line 191:
Code: [Select] [Expand] [Hide line numbers]
1
$user_password = md5($user_password);
Replace with:
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:
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
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.
2) An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0)
ok :)
Thanks ! :)
-
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.
-
thanks
great topic
-
Anybody ? :)
-
Hello,
Does anyone has succeeded?
I just reinstall everything 4images for this mod, but it's still not working
-
Looking through my software:
"$user_password ="
I found the line:
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/
-
Hello, here is my question: if my forum uses an another database from 4images is that the bridge work?
Thanks
-
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
<?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/');
?>
-
Ich komme einfach nicht weiter. :?
Meine config.php
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:
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.
-
ok, thanks for your reponse denisnovikov
-
hi,
here is my problem:
Parse error: syntax error, unexpected '.' in /home/www/***/html/***/test/galerie/includes/phpbb_sessions.php on line 6
my config:
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
-
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:
$phpbb_root_path = PHPBB3_PATH;
There is no "." unless you made some modifications in there.
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:
/public_html
/forum
/galerie
Is this correct?
-
From your config it should be something like this:
/public_html
/forum
/galerie
Is this correct?
this is correct, yes
and this is line 6
$phpbb_root_path = PHPBB3_PATH;
how must i modify this line correctly? i think the error is in there?
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');
good night ;)
-
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.
-
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.
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.
-
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
-
Hello
I tested version "modded.zip" but :
error :
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 :
$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
-
try these lines in our config.php
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../forum/').'/');
define('PHPBB3_URL', '/forum/');
-
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)
-
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
-
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
-
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!!)
-
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 :)
-
@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 :
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 :
$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:
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.
-
Please make a WBBLite2 Bridge: http://www.woltlab.com/products/burning_board_lite/index.php
-
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:
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?
-
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?
-
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
<?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
<?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);
?>
-
@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.
-
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
?
-
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:
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../phpbb/3/') . '/');
define('PHPBB3_URL', '/phpbb/3/');
-
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."
<?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 ;)
/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* ^^
-
I´m getting the following errors when i enable this mod:
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
-
I´m getting the following errors when i enable this mod:
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...
-
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?
-
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.
-
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´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.
-
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.
-
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:
<?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
-
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.
-
thanks for help, wonderful
-
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.
-
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?
хм... похоже какие-то бока с файлом phpbb.php. от него пустая страница.
и еще, не пойму каким образом идет автоматический логин в галерею если логиниться через форум. в обратную сторону понятно, в галерее меняются файлы, но в форуме же ничего не меняется.....
-
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?
Если белую страницу обновить — она остаётся белой или загружает нормально? Если сначала зайти на форум, а не в галерею то же самое происходит?
-
установил начисто phpbb 3.0.7 и 4images
сделал все изменения как указано в инструкции (не брал версию modded, а вручную изменил все файлы пошагово). сто раз перепроверил.
при обращении к галерее - чистая страница. методом исключения определил, что это измененный файл sessions.php такое делает. заменил его оригинальным, галерея грузится, но есс-но никакого моста нет.
что может быть с sessions.php?
Если белую страницу обновить — она остаётся белой или загружает нормально? Если сначала зайти на форум, а не в галерею то же самое происходит?
на форум все нормально заходит.
разбираюсь дальше с файлом phpbb_sessions.php
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
-
Hello
When you want to connect, the site download a file, test yourself:
http://www.fond-ecran-gratuit.biz/
Login: ffi
password: 123456
-
включил контроль ошибок в 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:
AddType application/x-httpd-php .php
-
Thank you for your help, but it does not work
Login.php :
<?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) ? 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);
}
?>
-
It seems like there is no
http://www.fond-ecran-gratuit.biz/forum/login.php
on server, login.php downloads with
<!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.
-
It seems like there is no http://www.fond-ecran-gratuit.biz/forum/login.php
on server.
My .htaccess :
#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
################################################################################
-
включил контроль ошибок в 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 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?
-
версия phpbb 3.0.7-PL1. модов никаких. установлен с нуля. пробовал на 3.0.6 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?
Хм, да никаких. Кинь мне доступ в личку, постараюсь успеть глянуть сегодня.
-
версия phpbb 3.0.7-PL1. модов никаких. установлен с нуля. пробовал на 3.0.6 то же самое.
а какие еще настройки к БД если форум и галерея по отдельности до интеграции работали?
Хм, да никаких. Кинь мне доступ в личку, постараюсь успеть глянуть сегодня.
кинул в личку
-
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.
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 ?
-
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.
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 ?
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../').'/');
define('PHPBB3_URL', '/');
-
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.
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 ?
define('PHPBB3_BRIDGE_ON', true);
define('PHPBB3_PATH', realpath(realpath(dirname(__FILE__)).'/../').'/');
define('PHPBB3_URL', '/');
Thanks.
-
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!!
-
Gibt es nun eine Lösung dafür, wenn man schon 4images am Laufen hat?
Is there a solution if 4images is already running?
-
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.
-
Thank you. I will have a look. I did not understand russian - so now it is clear :D
-
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
-
Who can build a user trans similar to the MOD Bridge VBulletin?
-
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...
-
good , thanks for posting this must so useful ~!
-
:cry: После установки мода перестал заходить в галерею! Помогите что делать :?:
-
:cry: После установки мода перестал заходить в галерею! Помогите что делать :?:
пробовать войти с именем админа от форума а не галлереи
если не получается то описать как можно подробнее ошибку
-
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?
-
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!!
-
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:
if ($image_allow_comments == 1) {
ADD after:
//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:
$comment_user_id = $comment_row[$i]['user_id'];
and ADD after:
//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:
<b>{comment_user_name}</b><br />
and ADD after:
{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:
$response_row = $site_db->query_firstrow($sql);
and ADD after:
//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:
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_name."</b> (".$response_user_info.")</td>\n";
and REPLACE by:
$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.
-
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
-
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
-
zip up the two files and let me have a look... attach them here
-
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.
-
that's exactly what was missing... template veariable...
in both files do this:
find
"comment_user_email_button" => ($show_comment == 0) ? "" : $comment_user_email_button,
and add after
"comment_user_avatar" => $comment_user_avatar, //new line
my tutorial updated
-
That did it, although I was actually looking for in each:
"comment_user_email_button" => $comment_user_email_button,
-
Any chance of getting a true bridge, rather than an integration, with phpBB2, similar to what is done with phpBB3?
-
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
-
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...
-
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.
-
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.
-
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?
-
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
-
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 -
-
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!
-
teşekkürler TR / giresun :)
-
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.
-
Please update mod to 4images 1.7.11 and phpbb3 3.0.10
-
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.
-
I found out why this is happening:
This SQL-QUERY:
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 found out why this is happening:
This SQL-QUERY:
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...
-
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
-
Will there be an update to phpbb 3.1.+ ?
Thanks
Michael
-
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.
-
Hi, I also just came across this bridge and would like to know if there will be a bridge for the current phpbb3.3?