Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - denisnovikov

Pages: 1 2 3 [4] 5 6
46
IMPORTANT NOTICE: create backups BEFORE applying this mod to your applications!

Index

  • Introduction
  • Demo
  • List of changed files
  • Installation
  • Notes
  • Known issues
  • Version history
  • Extras

Introduction

This mod allows to use both 4images and phpBB application transparently for users as they are one application. Registration and login are handling by the phpBB app, users are creating into 4images database “on-the-fly”, on first request of any of the 4images pages by logged in user.


Demo

http://bridge.boxup.us/
4images (ver. 1.7.7) + phpBB (ver. 3.0.7) updated on 4th March 2010


List of changed files

New files:
   includes/phpbb.php
   includes/phpbb_sessions.php

Modified:
   config.php
   includes/sessions.php
   includes/page_header.php
   admin/admin_global.php
   admin/index.php
   templates/default/user_loginform.html


Installation

Step 1. New files

Download new files and place them:
   a) phpbb.php into includes directory;
   b) phpbb_sessions.php into includes directory.


Step 2. config.php

Add at the end of the file, before “?>” symbols:

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

Where:
<phpbb_root> is relative path from the 4images’ root to phpBB root. For example, if you have installed both apps at the same directory on your server and your phpBB is located into ‘phpBB’ directory, type there: “/../phpBB/” (without quotes). Note, on some servers small and caps letters are differ, so put it exactly as it named.
<phpbb_url> is your phpBB installation relative to the root of server url, as users type it’s address in their web-browsers.


Step 3. includes/sessions.php

Locate somewhere around line 178:

Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
Replace with:

Code: [Select]
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1, $do_md5 = true) {
Locate somewhere around line 191:

Code: [Select]
$user_password = md5($user_password);
Replace with:

Code: [Select]
if($do_md5 == true) $user_password = md5($user_password);
Locate somewhere around line 418:

Code: [Select]
// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

Add following code after:

Code: [Select]
include_once(realpath(dirname(__FILE__)).'/phpbb.php');

Step 4. includes/page_header.php

Locate:

Code: [Select]
Copyright &copy; 2002-'.date('Y').' <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</p>
',

Add following code right after:

Code: [Select]
"login_user_name_form_field" => (!empty($login_user_name_form_field)) ? $login_user_name_form_field : 'user_name',
"login_user_password_form_field" => (!empty($login_user_password_form_field)) ? $login_user_password_form_field : 'user_password',
"login_auto_form_field" => (!empty($login_auto_form_field)) ? $login_auto_form_field : 'auto_login',
"login_additional_form_fields" => (!empty($login_additional_form_fields)) ? $login_additional_form_fields : '',


Step 5. admin/admin_global.php

Locate:

Code: [Select]
// Include default languages
Add following code before:

Code: [Select]
// Default form
$login_admin_form_action = $site_sess->url(ROOT_PATH."admin/index.php");;
$login_admin_name_form_field = 'loginusername';
$login_admin_password_form_field = 'loginpassword';
$login_admin_additional_form_fields = '';
 
// Overwrite form if necessary
if(defined('PHPBB3_BRIDGE_ON') && PHPBB3_BRIDGE_ON === true){
$login_admin_form_action = $site_sess->url(PHPBB3_URL."ucp.php?mode=login");
$login_admin_name_form_field = 'username';
$login_admin_password_form_field = 'password';
$login_admin_additional_form_fields = '<input type="hidden" name="redirect" value="'.$_SERVER['REQUEST_URI'].'" /><input type="hidden" name="login" value="Login" />';
}

Locate:

Code: [Select]
<form action="<?php echo $site_sess->url(ROOT_PATH."admin/index.php"); ?>" method="post">
Replace with:

Code: [Select]
<form action="<?php echo $login_admin_form_action?>" method="post">
<?php echo $login_admin_additional_form_fields?>

Locate:

Code: [Select]
<td><input type="text" name="loginusername" size="<?php echo $textinput_size2?>"></td>
<td><input type="password" name="loginpassword" size="<?php echo $textinput_size2?>"></td>

Replace with:

Code: [Select]
<td><input type="text" name="<?php echo $login_admin_name_form_field?>" size="<?php echo $textinput_size2?>"></td>
<td><input type="password" name="<?php echo $login_admin_password_form_field?>" size="<?php echo $textinput_size2?>"></td>


Step 6. admin/index.php

Locate (at around lines 60-70):

Code: [Select]
if ($action == "head") {
?>
<html dir="<?php echo $lang['direction']; ?>">


Add following code right between “if ($action == "head") {“ and “?>”:

Code: [Select]
// switch back admin logout url if no integration
if(!defined('PHPBB3_BRIDGE_ON') || PHPBB3_BRIDGE_ON !== true){
$url_logout = $site_sess->url(ROOT_PATH."admin/index.php?logout=1");
}

Locate:

Code: [Select]
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a>&nbsp;|&nbsp;<a href="<?php echo $site_sess->url(ROOT_PATH."admin/index.php?logout=1"); ?>" target="_top"><?php echo $lang['logout']; ?></a>&nbsp;&nbsp;</b></TD>
Replace with:

Code: [Select]
<td align="right"><b><a href="<?php echo $site_sess->url(ROOT_PATH."index.php"); ?>" target="_blank"><?php echo $lang['goto_homepage']; ?></a>&nbsp;|&nbsp;<a href="<?php echo $url_logout?>" target="_top"><?php echo $lang['logout']; ?></a>&nbsp;&nbsp;</b></TD>

Step 7. templates/default/user_loginform.html

Locate:

Code: [Select]
<input type="text" size="10" name="user_name" class="logininput" />
Replace with:

Code: [Select]
<input type="text" size="10" name="{login_user_name_form_field}" class="logininput" />

Locate:

Code: [Select]
<input type="password" size="10" name="user_password" class="logininput" />
Replace with:

Code: [Select]
<input type="password" size="10" name="{login_user_password_form_field}" class="logininput" />
{login_additional_form_fields}


Locate:

Code: [Select]
<td><input type="checkbox" name="auto_login" value="1" /></td>
Replace with:

Code: [Select]
<td><input type="checkbox" name="{login_auto_form_field}" value="1" /></td>

Notes

Please make sure when installing applications you have admin account on both with the same user name and password.

Make sure you checked the topic http://www.4homepages.de/forum/index.php?topic=23892 for the vBulletin bridge, since both bridges are using the same way to work with 4images some questions may be already answered there.


Known issues

Known not to be working if phpBB configured to use mysql driver. Use mysqli instead (http://php.net/manual/en/mysqli.overview.php).
phpBB_installation_path/config.php
Code: [Select]
$dbms = 'mysqli';
When switching bridge off users can’t login to 4images anymore from the native 4images form. However they still exist in 4images database and could request for new password.

After logging off user will be returned to the main page of the forum installation instead of page he was browsing previously.


Version history

0.1 - initial release
0.2 - fixes issue with emptying email address (http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497)
0.3 - fixes issue with wrong register date
0.4 - attempt to fix "blank page" issue (4 Mar 2010)

Extras

Downloadable already modded 4images archive.

Downloadable this instruction in printer friendly pdf.

If you wish to integrate Joomla 1.5, phpBB 3.0 and 4images -- use RokBridge between Joomla and phpBB as known works altogether just fine. Thanks to wingnut for finding it out.

Extending 4images comments with avatars from phpBB from alexeyn1: http://www.4homepages.de/forum/index.php?topic=26013.msg143497#msg143497

Known to work without any issues with Wordpress 3.0.1 (http://www.wp-united.com/get-wp-united/) plugin. Thanks to Benny for finding (http://www.4homepages.de/forum/index.php?topic=26013.msg152103#msg152103).



For downloads please refer to the original post on forum at http://www.4homepages.de/forum/

47
Now It's work. Thank you for quickly answer :) .

No probs :)


Great modification
But in the notes to me personally too many files!
What should you use?
Look not through there!

You can take whole 4images sources premodified in modded.zip file.

48
Tolle Mod,
aber im anhang sind mir pers. zu viele Dateien!
Was soll man verwenden?
Blicke da nicht durch!

Kein Deutsch  :oops:


It's didn't work. I try use old vb.php with you changes, try use new vb.php(from first post), i try change email in vb by user and by admin for user, but always email was old.

Yes, my fault, with the code above it will update email only if password changed. New snippet:

Code: [Select]
//  --
//  check and update if user has a new email address in vBulletin
    if ($vbulletin->userinfo['email'] !== $user_info['user_email']) {
        $sql = "UPDATE ".USERS_TABLE." SET ".get_user_table_field(" ", "user_email")." = '".$vbulletin->userinfo['email']."' WHERE ".get_user_table_field("", "user_id")." = '".$user_info['user_id']."' LIMIT 1;";
        echo $sql;
        $result = $site_db->query($sql);
    }

Should be pasted before
Code: [Select]
if(($user_info['user_id']) > 0 && intval($vbulletin->userinfo['userid']) <= 0){
in includes/vb.php

I'll update the first post today with new files. Thanks for finding!

With you script. I can find user, but when i click on it i see page whith empty filds.

Pretty strange, I'll see at it later this week.

49
I added parameter "disabled" to tag input for emails to avoid changes, but when you try to change icq or homepage it showes the following error: this e-mail already exists.

As I said above -- simply replace whole template with link to the profile on vBulletin. So user will be able to change everything on the vBulletin side which is responsible for users handling while bridge is on.

50
Yeah, this seems to be a bug: bridge doesn't work if the email validation is disabled. 

Email validation disabled for vBulletin or 4images? I have local installation where vBulletin email verification is disabled -- and I have no probs at all.

And one more problem: the users can't change treir password in the gallery profile.  Demo site is affected by this bug too.

If you read carefully whole topic you will find an answer:

Quote
2. If user want change password in 4 images, he always see message, that he's password isn't correct. Maybe page must be refreshed for vb(or it's my installation error?)?

Users can't change their passwords through the 4images profile, only through vBulletin profile. 4images and vBulletin uses different ways to keep users' passwords hashes, since we using DB from vBulletin Mod is transferring hashes from vBulletin tables to 4images with no changes and when 4images tries to compare hash it got from user's password with one in DB table it fails. This is the particular case of known issue and we can't do anything with this.

Quote
5. User can change his email in 4images. When he do it, he see message, that he need activate his account. After that user can't see 4image pages(he see only blank page which trying to connect). Admin must activate user for fix situation. I think we must do not let user change his email in the 4images.

To avoid this you can just edit member_editprofile.html of your chosen template. Simply delete everything or replace with the text and links to user's profile on vb (/member.php?u=1 from the root of your vBulletin installation).

51
i have 2 domains:
Code: [Select]
gallery.site.domain   and
Code: [Select]
forum.site.domain
vBulletin Options -> Cookies and HTTP Header Options -> Cookie Domain i set it to
Code: [Select]
.site.domain

Yup. This should be correct. Any more info?

52
Hello!
I have follewed this guide, but i have encountered the following problem: i can't login into gallery.  It showes that i have successfully logged in, but after automatic redirect i am not logged in.
Hove to fix this problem? The versions are 1. 7. 7 & 3. 8. 3.
P. S.  Можно и на русском.

Check for the correct "session sharing". Check for the any errors in the logs. Any additional information will be helpful, at the moment I can't see where could be a problem.

53
I think that fix should solve the problem for both mods

Apparently the $l variable is important for 4images, but I think it's a mistake...

Confirm, with fix I mentioned above [MOD] Multi-Language support for any text is working just fine.

54
And error whith different mods:
6.I have "[MOD] Language select" + "[MOD] Multi-Language support for any text" and after I install bridge i have error: if i choose language it changes, but when i click on any link - language changes for default. Please, help me to fix this.

Fix:

Find in includes/sessions.php:

Code: [Select]
include_once(realpath(dirname(__FILE__)).'/vb.php');
Replace with:

Code: [Select]
$temporaryLanguage = $l;
include_once(realpath(dirname(__FILE__)).'/vb.php');
$l = $temporaryLanguage;

First post updated with new section. Will search for the fix for [MOD] Multi-Language support for any text later today.


тоесть всем пользователям надо запросить новые пароли?

Да.

55
и как тогда мне вернуть к жизни юзеров? поставил форум обратно, скопировал пользователей, все - равно незаходит, просто негрузит страницу и все

Тем не менее, они существуют в базе и могут запросить новый пароль.

56
Quote
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.
Отключил мост, все равно немогу залогинится, пишет ту-же ошибку: "Вы неправильно ввели логин или пароль. "
По-русски: Когда отключаешь мост пользователи не могут более войти на 4images посредством формы логина галереи. Тем не менее, они существуют в базе и могут запросить новый пароль.

57
да, всеравно, у всех неполучается. 
я просто случайно снес базу форума, и вот из-за этого пришлось убирать интеграцию

Known issues

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.


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

1. When user change his email in vb, it is not changes in the 4images. But 4images use this wrong email(for example, when you want write letter to user who write comment). How to fix this?

Yes, this is correct behavior, only if user changed password its hash transferring to the 4images table, to fix this:
Find in vb.php line (should be 28th) starting with:
Code: [Select]
$sql = "UPDATE ".USERS_TABLE." SET " ...

and replace whole line with:

Code: [Select]
$sql = "UPDATE ".USERS_TABLE." SET ".get_user_table_field(" ", "user_password")." = '".$vbulletin->userinfo['password']."', ".get_user_table_field(" ", "user_email")." = '".$vbulletin->userinfo['email']."' WHERE ".get_user_table_field("", "user_id")." = '".$user_id."' LIMIT 1;";

That's it, should work now. I will update the first post with newer version later tonight. Thanks for reporting!

2. If user want change password in 4 images, he always see message, that he's password isn't correct. Maybe page must be refreshed for vb(or it's my installation error?)?

Users can't change their passwords through the 4images profile, only through vBulletin profile. 4images and vBulletin uses different ways to keep users' passwords hashes, since we using DB from vBulletin Mod is transferring hashes from vBulletin tables to 4images with no changes and when 4images tries to compare hash it got from user's password with one in DB table it fails. This is the particular case of known issue and we can't do anything with this.

4. If in 4images i click "Log out" then i always come to the vb. Is it necessarily? Can user stay in 4images? How to do this?

No it's not possible to logout directly from 4images pages. However there is should be the link on vBulletin logout page with something like "go to the page you were previously browsing", this link should get user back to the 4images. Maybe there is an option in vBulletin which can create auto action after user successfully logged out.

5. User can change his email in 4images. When he do it, he see message, that he need activate his account. After that user can't see 4image pages(he see only blank page which trying to connect). Admin must activate user for fix situation. I think we must do not let user change his email in the 4images.

To avoid this you can just edit member_editprofile.html of your chosen template. Simply delete everything or replace with the text and links to user's profile on vb (/member.php?u=1 from the root of your vBulletin installation).

And error whith different mods:
6.I have "[MOD] Language select" + "[MOD] Multi-Language support for any text" and after I install bridge i have error: if i choose language it changes, but when i click on any link - language changes for default. Please, help me to fix this.

I'll take a look on these Mods and tell you if find anything we can do with this.

7. New user haven't registration date in the 4images. We can see this date, for exaple, when see comments.

I'll attach new vb.php with fix for this. You can just download it and replace older one. It will also fix for #1. Thanks for reporting!

8. I copy some users from 4images to vb. I can't modify this users from vb admin panel

How exactly do you copy users?


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

if im ganna use the usersexportvb.php
if there  is a user with same username and different email
is any dublicate it ?
also
if the username and email are same
what well happen !!?

I would like to recommend not use userexportvb.php to MERGE two existing databases. To see what will happen just make backups of everything and try it, but sometimes it's simpler just ask couple of user to re-register.

well, im getting this error when i want to see admin control panel

Quote
Unable to add cookies, header already sent.
File: /home/XXX/public_html/XXX/image/admin/index.php
Line: 1

Looks like your index.php has something wrong in line 1.


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

Is this mode working ok? I need to know this before buying the license for vbulletin.  Any new feedback ?

Yes. Just checked for it's work with vBulletin 3.8.4

58
Denis, could this version work with 4images 1.7.6?

Well, it was working with 1.7.6 with no any problems.

59
i couldnt make this to be done
everything is ok except the session . how i configure the vb option

In your AdminCP on vBulletin:
vBulletin Options -> Cookies and HTTP Header Options -> Cookie Domain

60
Hello denisnovikov,

I think I have the same problem than AntiNSA2.

I only have your mod on my 4images.
Since I have the mod installed Google only has indexed the index of my galleries (before was completly indexed).

I had read AntiNSA2 message yesterday, and now I'm investigating this problem.

Do you think that is a problem with the mod?

Thanks again!

Hi, I think it's pretty possible that mods are in some way conflicting with each other. I will take a look for sure.

Hello
thanks for great MOD

my vb url is www.site.com/vb
my gallery pic.site.com

what should i do

any help i appreciate it

You should have session sharing for subdomains configured, something like *.site.com in your vB preferences and configure url as:
Code: [Select]
define('VBULLETIN3_URL', 'http://www.site.com/vb/');

Pages: 1 2 3 [4] 5 6