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

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

0 Members and 2 Guests are viewing this topic.

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #15 on: December 01, 2009, 02:19:57 PM »
same problem as reported in another bridge found in this bridge:

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

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

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

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

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

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

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

here is what you do...

Step 1.

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

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

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

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

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

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

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

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

Step 4.
find:

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

Code: [Select]
$responses .= "<tr>\n<td><b>".$lang['response'].$response_user_avatar.$response_user_name."</b> (".$response_user_info.")</td>\n";
« Last Edit: April 30, 2011, 10:19:35 PM by alekseyn1 »

Offline WWTNET

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #16 on: December 06, 2009, 12:44:59 AM »
Hello everyone,

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

Thanks a lot
D.R

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #17 on: December 08, 2009, 01:26:21 PM »
same problem as reported in another bridge found in this bridge:

Fixed, attached files are updated.

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

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

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

Unfortunately, not yet.
check

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #18 on: December 08, 2009, 01:42:01 PM »
same problem as reported in another bridge found in this bridge:

Fixed, attached files are updated.


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

Only one line changed in phpbb.php

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

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #19 on: December 08, 2009, 01:51:20 PM »
Denis, thanks for the fix! Should we download the new phpbb.php or reapply the whole mod again?

Only one line changed in phpbb.php

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

Yes, only this file and only this line.
check

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #20 on: December 09, 2009, 09:38:07 AM »
Denis, one more glitch... for some reason the registration date of a user is not being transferred from phpBB database into 4images database correctly.. could you please check? For all my newly registered users 4images database shows "0" in the "user_joindate" field ...

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #21 on: December 11, 2009, 10:04:12 AM »
Denis, thanks for the fix! Should we download the new phpbb.php or reapply the whole mod again?

Only one line changed in phpbb.php

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

Yes, only this file and only this line.

sorry guys, found a small error... in phpBB Anonymous user has user_id == 1, so the code above should be
Code: [Select]
    if ($bbuser->data['user_id'] > 1 && $bbuser->data['user_email'] !== $user_info['user_email']) {
after that if you refresh 4images while logged off from the forum, the e-mail will stay in the database.

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #22 on: December 11, 2009, 12:32:05 PM »
Denis, one more glitch... for some reason the registration date of a user is not being transferred from phpBB database into 4images database correctly.. could you please check? For all my newly registered users 4images database shows "0" in the "user_joindate" field ...

Thanks for finding, fixed

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

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

Both fixes are attached to the first post. Changed file only includes/phpbb.php
check

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #23 on: December 15, 2009, 11:06:06 AM »
I have made a MOD to show the last posts from forums on the 4images main page...

http://www.4homepages.de/forum/index.php?topic=26465.0

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #24 on: December 19, 2009, 01:49:10 AM »
C phpBB 3.0.6 не работает, да?  Я попробовал, не фурычит.
4images running as a music portal http://music.kurman.ru/

Offline denisnovikov

  • Test group
  • Full Member
  • *
  • Posts: 125
    • View Profile
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #25 on: December 19, 2009, 10:35:12 AM »
C phpBB 3.0.6 не работает, да?  Я попробовал, не фурычит.

Плохо попробовал: http://bridge.boxup.us/ - phpBB 3.0.6
« Last Edit: December 19, 2009, 08:44:33 PM by denisnovikov »
check

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #26 on: December 19, 2009, 05:40:04 PM »
Ставил уже готовую "modded" 4images, что приаттачена здесь, и ставил phpBB3.0.6 только что скачанную. На локальный сервер vertrigo.

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

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

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

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

Может приаттачишь тот что работает у тебя на демо?
4images running as a music portal http://music.kurman.ru/

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #27 on: December 19, 2009, 06:37:02 PM »
Попробуй пошаговую модификацию... у меня все сработало с первого раза.... (за исключением подключения к базе, которое Денис исправил.. и все заработало хорошо)
« Last Edit: December 23, 2009, 02:28:01 PM by alekseyn1 »

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Bridge: 4images 1.7.7 - phpBB 3.0.5+
« Reply #28 on: December 23, 2009, 02:39:38 PM »
I am trying to extend this bridge and update not only the e-mail of the user, but also other fields from phpBB into 4images database...

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

field definitions in 4images are done as follows:

in db_field_definitions.php:

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

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

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

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

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

as a result, I get nothing in the 4images field... (although if you make the 4images field "full_name" as NULL, it becomes not null as the result of this script)... anyone knows what's wrong? I appreciate any help.

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
4images and Phpbb2 -> phpbb3
« Reply #29 on: December 27, 2009, 11:22:37 PM »
Hello,

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

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

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

Thanks :)