Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Mr.Easybb (1587)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Bloodbath (745)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Rukiafan (533)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Dom (513)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
puppycheese (446)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
pedro (330)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Neymar (301)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Hitsu (281)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 
Flora (275)
[PLUG-IN] Add avatars to the chatbox Vote_lcap[PLUG-IN] Add avatars to the chatbox Voting_bar[PLUG-IN] Add avatars to the chatbox Vote_rcap 


[PLUG-IN] Add avatars to the chatbox

TonightTonight
Status : No status yet...

Posts : 152
Join date : 2012-10-06
Age : 28
Location : Estonia
Mon 27 May 2013, 20:52
[PLUG-IN] Add avatars to the chatbox Avatar10

First of all - those codes were made by EasyBB a long time ago. Since I can't find the topic anymore, I thought why not make a tutorial about it.
This way is manual - it means you have to add people names + avatars to script, or else they won't have avatars in chatbox.

Add that code to AvacWeb Chatbox Javascript (main script you added to your forum, to get that awesome chat):
Code:
avacweb_chat_config.message_hook.push(function(row, username, user_id, user) {
            if(username === 'NICK')user.innerHTML='<img height="16px" width="16px" style="padding-right:4px;" src="AVATAR URL">' + user.innerHTML;
            if(username === 'NICK')user.innerHTML='<img height="16px" width="16px" style="padding-right:4px;" src="AVATAR URL">' + user.innerHTML;
            if(username === 'NICK') user.innerHTML = '<img height="16px" width="16px" style="padding-right:4px;" src="AVATAR URL">' + user.innerHTML;
        });
Obviously, if you want to add more avatars, you have to make another
[ic]if(username === 'NICK') user.innerHTML = '<img height="16px" width="16px" style="padding-right:4px;" src="AVATAR URL">' + user.innerHTML;[/ic]
before });
doannamthaidoannamthai
Status : No status yet...

Posts : 152
Join date : 2013-01-02
Age : 37
Tue 28 May 2013, 02:27
Code:
avacweb_chat_config.user_hook.push(function(row, username, user_id) {
if(username == 'Username') row.innerHTML = '<img height="16px" width="16px" style="padding-right:5px;" src="AVATAR  URL">' + row.innerHTML ;
});

It will display your avatar in Online and Away

make if(username == 'Username') row.innerHTML = '<img height="16px" width="16px" style="padding-right:5px;" src="AVATAR URL">' + row.innerHTML ; before }); to add another avatar
puppycheesepuppycheese
Status : No status yet...

Posts : 446
Join date : 2013-02-12
Age : 30
Location : New Jersey
Tue 28 May 2013, 04:21
any way to have the avatar auto- update when changed?
doannamthaidoannamthai
Status : No status yet...

Posts : 152
Join date : 2013-01-02
Age : 37
Tue 28 May 2013, 05:02
Not sure , But I have 2 way for you

1. This is easy way : You can load user's avatar from href /u.. in Online and Away and then you use setInterval them with 1000ms but I think it will lag . ok I will try it tonight
2. This Get all avatar and username forum memberlist where have username it will display his/her avatar . Maybe this way has something difficult with me.

Let try this

puppycheesepuppycheese
Status : No status yet...

Posts : 446
Join date : 2013-02-12
Age : 30
Location : New Jersey
Mon 03 Jun 2013, 19:09
How would I load them via href /u.. would I replace that where the username would go with the user_id?
Code:
[panda=js]avacweb_chat_config.user_hook.push(function(row, username, user_id) {
if(username == 'Username')
LeoLeo
Status : No status yet...

Posts : 194
Join date : 2012-05-10
Age : 26
Fri 07 Jun 2013, 15:07
It works ! Thanks !
avatartommycoo
Status : No status yet...

Posts : 205
Join date : 2011-12-03
Age : 28
Location : indonesia
Sun 09 Jun 2013, 15:04
thats hard to put them avatar one by one ?
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Sun 09 Jun 2013, 19:45
puppycheese the code accepts user_id as well

Code:
[panda=js]avacweb_chat_config.user_hook.push(function(row, username, user_id) {
if(user_id== '8')row.innerHTML = '<img height="16px" width="16px" style="padding-right:5px;" src="AVATAR  URL">' + row.innerHTML ;
});

I believe you will have to try the 8 or whatever with u8 if it doesn't work at first.
avatartommycoo
Status : No status yet...

Posts : 205
Join date : 2011-12-03
Age : 28
Location : indonesia
Mon 10 Jun 2013, 12:43
is that any ways to add the avatar automatically ?
avatarKrph
Status : No status yet...

Posts : 34
Join date : 2013-06-30
Sun 30 Jun 2013, 15:12
It's possible to add the avatars of all the users automatically?
Sponsored content