AJAX Chat + Forum phpBB3 - avatars in the chat

41 views
Skip to first unread message

Łukasz Wyrwoł

unread,
Aug 20, 2019, 6:17:55 PM8/20/19
to ajax...@googlegroups.com
Hello,

I would like to add avatars to massages on ajax chat (source: https://frug.github.io/AJAX-Chat/). I want to use avatars from phpbb3 forum (v 3.1.5).

To make this I edited file chat.js, and for function "getChatListMessageString" I added this code before sending massage.

var PathPic = 'http://phs-phsa.cba.pl/download/file.php?avatar=' + userID + '_#.jpg';
                              
                    var img = new Image();
                    img.src = PathPic;
                    
                    var AvatarPic = '';
                    if( img.height !== 0 ) {
                        AvatarPic = '<img class="avatar'
                                        + '" title="'
                                        + userName
                                        + '" alt="'
                                        + userName
                                        + '" src="'
                                        + PathPic
                                        + '"></img> ';

Problem is generated for this line: "var PathPic = 'http://phs-phsa.cba.pl/download/file.php?avatar=' + userID + '_#.jpg';"

In place of "#" there is a number. I do not know how this number is generated, but in the database there is written this number. 

My question is - how to send request to the DB form this function or maybe exist easier form of reading avatar from forum phpBB3 on the ajax chat?
Reply all
Reply to author
Forward
0 new messages