Author Topic: Extern Avatar from WBB in 4images Comment  (Read 16724 times)

0 Members and 1 Guest are viewing this topic.

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Extern Avatar from WBB in 4images Comment
« on: July 10, 2010, 10:40:49 PM »
Hello,

this is the wcf1_avatar table from Woltlab Burning Board
i will show the Avatar of the user in 4images comment



I use wordpress + 4images + woltlab nurning board. The user´s have all the same ID, i have a single registration for wordpress/4images and wbb


i will use {comment_user_avatar} in the comment for showing the WBB Avatar

Sorry for my english....
Beste Grüße
Benny

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extern Avatar from WBB in 4images Comment
« Reply #1 on: July 10, 2010, 11:06:45 PM »
Maybe something like this?

In details.php find:
  $sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq")."
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);


Replace with:
  $sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").", a.avatarID
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          LEFT JOIN wcf1_avatar a ON (a.userID = "
.get_user_table_field("u.""user_id").")
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);


Then find:
        "comment_user_ip" => $comment_user_ip,

Insert below:
        "comment_user_avatar" => $comment_row[$i]['avatarID'],
« Last Edit: July 11, 2010, 12:24:40 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: Extern Avatar from WBB in 4images Comment
« Reply #2 on: July 10, 2010, 11:55:24 PM »
Hi Vano,

thank you very very much, but the avatarName dont work. this is the name of the uploaded Avatar. WBB changed name to avatar-avatarID.avatarExtension
http://siteurl/wp-forum/wcf/images/avatars/avatar-2.jpg

Can you help me?
Beste Grüße
Benny

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extern Avatar from WBB in 4images Comment
« Reply #3 on: July 11, 2010, 12:04:52 AM »
The avatarName in your screenshot contains filename for the avatar image (1-4a9b3ea1150f7e9c.jpg), and you are saying that actual filename is different?
what is the actual filename of the avatar for the user with id 1?

perhaps all you need to do is change the directory in your <img> tag?
Code: [Select]
<img src="path_to_avatars_directory/{comment_user_avatar}">
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: Extern Avatar from WBB in 4images Comment
« Reply #4 on: July 11, 2010, 12:08:22 AM »
Yes, the filename is

avatar-2.jpg

Split

avatar - avatarID . avatarExtension

The name "1-4a9b3ea1150f7e9c.jpg" is the uploaded filename
example "myavatar.png"
i uploaded "myavatar.png"
wbb change the name "myavatar.png" to "avatar-3.png"

please look at my atachment

dont work
Code: [Select]
<img alt="" src="../wp-forum/wcf/images/avatars/1-4a9b3ea1150f7e9c.jpg" class="avatar avatar-32" height="32" width="32">
work
Code: [Select]
<img alt="" src="../wp-forum/wcf/images/avatars/avatar-2.jpg" class="avatar avatar-32" height="32" width="32">
Beste Grüße
Benny

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extern Avatar from WBB in 4images Comment
« Reply #5 on: July 11, 2010, 12:26:20 AM »
So, avatarID is being used?
in that case just replace all avatarName in my code with avatarID
(I've updated the code above)

and in template use:
Code: [Select]
<img alt="" src="../wp-forum/wcf/images/avatars/avatar-{comment_user_avatar}.jpg" class="avatar avatar-32" height="32" width="32">
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: Extern Avatar from WBB in 4images Comment
« Reply #6 on: July 11, 2010, 12:32:25 AM »
But what is with th avatarExtension

The Code
Code: [Select]
<img alt="" src="../wp-forum/wcf/images/avatars/avatar-{comment_user_avatar}.jpg" class="avatar avatar-32" height="32" width="32">
dont work with a png

<img alt="" src="../wp-forum/wcf/images/avatars/avatar-{comment_user_avatar}.jpg" class="avatar avatar-32" height="32" width="32">
the avatarExtension is individual


This is now my code

  $sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").", a.avatarID, a.avatarExtension
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          LEFT JOIN wcf1_avatar a ON (a.userID = "
.get_user_table_field("u.""user_id").")
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);


	
	
"comment_user_avatar" => $comment_row[$i]['avatarID'],
	
	
"comment_user_avatar_extension" => $comment_row[$i]['avatarExtension'],


The code work, but is this correckt?
« Last Edit: July 11, 2010, 01:07:15 AM by Sumale.nin »
Beste Grüße
Benny

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: Extern Avatar from WBB in 4images Comment
« Reply #7 on: July 11, 2010, 01:16:23 AM »
sure, you got the idea ;)

you could simplify it to one template tag though:
Code: [Select]
"comment_user_avatar" => $comment_row[$i]['avatarID'] . "." . $comment_row[$i]['avatarExtension'],
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Avatare aus WBB für Kommentare / Avatars for comments from WBB
« Reply #8 on: December 09, 2011, 08:35:13 PM »
:flag-de: Mit dieser Modifikation werden die Avatare aus dem "Woltlab Burning Board" in den Kommentaren von 4images benutzt
:flag-en: With this modification, the avatars of the "WoltLab Burning Board" used in the comments by 4images


Step #1

Öffne / Open: details.php
Suche / Search:
  $sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq")."
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);

Ersetze mit / Replace with:
  $sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").", a.avatarID, a.avatarExtension
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          LEFT JOIN wcf1_avatar a ON (a.userID = "
.get_user_table_field("u.""user_id").")
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);

Suche / Search:
 "comment_user_ip" => $comment_user_ip,
Füge danach ein / Add after
 "comment_user_avatar" => $comment_row[$i]['avatarID'] . "." $comment_row[$i]['avatarExtension'],
Beste Grüße
Benny