Avatars in chatbox are way too big
3 posters
Page 1 of 1
Avatars in chatbox are way too big
Hi, i'm using the codes in this topic https://help.forumotion.com/t139284-codes-to-personalize-your-chatbox#cb-icon and i'm trying to add avatars to my chat box like this :
https://i.servimg.com/u/f38/19/12/53/85/chat410.png" />
but when i add the codes it appears like this:
I just want the avatars on the online list gone and the avatars next to the messages to be sized 30x30
I'm using these codes from the topic:
in the CSS:
in the JS (set to home page only):
link to forum: http://pendulumsduelacademy.forumotion.com/
https://i.servimg.com/u/f38/19/12/53/85/chat410.png" />
but when i add the codes it appears like this:
I just want the avatars on the online list gone and the avatars next to the messages to be sized 30x30
I'm using these codes from the topic:
in the CSS:
- Code:
#chatbox .cb-avatar { background: transparent !important; box-shadow: none !important; }
body #chatbox .cb-avatar { border: none !important; /*retirer la bordure*/ }
#chatbox .cb-avatar > img{ border-radius: 50% !important; }
#chatbox .user-msg .user, #chatbox .user-msg .msg {
display: inline;
}
#chatbox_members .cb-avatar > img {
height:30px;width:30px;
vertical-align: middle;
}
in the JS (set to home page only):
- Code:
$(window).load(function() {
var chatbox_script = function() {
var default_avatar = 'http://2img.net/i/fa/invision/pp-blank-thumb-38px.png';
var ava_in_member_list = true;
var ava_in_indirect_message = true;
var avatars = {};
var d;
var set_avatar = function(pseudo, elem_to_prepend){
var avatar = avatars[pseudo];
var el = $(this);
elem_to_prepend.find('.cb-avatar').remove();
elem_to_prepend.prepend('<span class="cb-avatar"><img src="'+(avatar||default_avatar)+'"></span> ');
if(!avatar) {
if(!d) {
d = $.get('/memberlist?change_version=prosilver').done(function(c){
$('.avatar-mini img', c).each(function(){
avatars[$(this).parent().text().substr(1)]= $(this).attr('src')
})
})
}
d.done(function(){
var avatar = avatars[pseudo];
elem_to_prepend.find('.cb-avatar img').attr('src', avatar||default_avatar)
})
}
};
var overrided = Chatbox.prototype.refresh;
Chatbox.prototype.refresh = function(data) {
var next_scroll = false;
if (data.messages && data.messages.length) {
$.each(data.messages, function(_,m){
if(ava_in_indirect_message)
m.msgColor+='\' data-username=\''+$('<div/>').text(m.username).html();
if(m.user && m.user.avatar)
avatars[m.username] = m.user.avatar
});
next_scroll = !this.messages || this.messages.length != data.messages.length;
}
overrided.call(this, data);
d = null;
ava_in_member_list && $('#chatbox_members .chatbox-username').each(function(){
set_avatar($(this).text(), $(this).parent());
});
ava_in_indirect_message && $('#chatbox p > .msg').wrap('<span class="user-msg indirect-user-msg" />').each(function(){
set_avatar($(this).children().attr('data-username'), $(this).parent());
});
if(next_scroll) $("#chatbox")[0].scrollTop = $("#chatbox").prop('scrollHeight') * 2
};
};
var s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox/index.forum"],iframe[src^="/chatbox/index.forum"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
});
link to forum: http://pendulumsduelacademy.forumotion.com/
Last edited by Kirbs on Wed 2 Sep 2015 - 20:08; edited 1 time in total
Kirbs- Forumember
- Posts : 628
Reputation : 18
Language : English
Re: Avatars in chatbox are way too big
Try removing those codes and it should(Or might) work.
Guest- Guest
Re: Avatars in chatbox are way too big
But those are the codes that are posted on the tutorial topic, and the ones actually adding the avatars o.O i think you got me wrong ;o i want the avatars in there i just want them removed from the online list on the chatbox, and make them small like many other forums have them in the messages in the chatbox
Kirbs- Forumember
- Posts : 628
Reputation : 18
Language : English
Re: Avatars in chatbox are way too big
Hello,
Have you tried the 'show avatars' option in the chatbox area of the ACP? If so, they should automatically appear with no code(s) nessecary.
Hope this helps,
-Brandon
Have you tried the 'show avatars' option in the chatbox area of the ACP? If so, they should automatically appear with no code(s) nessecary.
Hope this helps,
-Brandon
Last edited by brandon_g on Wed 2 Sep 2015 - 20:12; edited 1 time in total
Re: Avatars in chatbox are way too big
Dear god how did i miss that... thanks a lot mate
Kirbs- Forumember
- Posts : 628
Reputation : 18
Language : English
Re: Avatars in chatbox are way too big
Your welcome anytime .
-Brandon
-Brandon
Remember to mark your topic when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
Team Leader
Review Section Rules | Request A Review | Sticker Points
Re: Avatars in chatbox are way too big
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» [Chatbox] Avatars
» Display user avatars in chatbox
» Display user avatars in chatbox
» CHATBOX: adding avatars to names on the online
» Problem with avatars on memberslist in chatbox javascript
» Display user avatars in chatbox
» Display user avatars in chatbox
» CHATBOX: adding avatars to names on the online
» Problem with avatars on memberslist in chatbox javascript
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum