LGforum (2804)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Mr.Easybb (1586)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Bloodbath (745)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Rukiafan (533)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Dom (513)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
puppycheese (446)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
pedro (330)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Neymar (301)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Hitsu (281)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 
Flora (275)
Quote-Plugin for AWC. Vote_lcapQuote-Plugin for AWC. Voting_barQuote-Plugin for AWC. Vote_rcap 


Quote-Plugin for AWC.

RukiafanRukiafan
Status : No status yet...

Posts : 533
Join date : 2012-07-20
Thu 21 Feb 2013, 18:42
I came up with an idea for a new plugin that would allow users to quote another member's message on the AWC like you can in the blogs and forums, however I don't know how to accomplish this. Is this even possible?
LGforumLGforum
Status : Working to restore AWC!

Posts : 2804
Join date : 2011-10-05
Age : 27
Location : UK
Fri 22 Feb 2013, 08:39
It wouldn't be able to quote the user exactly. For instance, when you a quote a user on the forum, it includes the BBcode they used. That wouldn't happen with the chatbox. However, you could add a simpler quote which allows you to add the text from their message into the textbox.

Try this, if it works, I may share it in a plug in topic:
Code:
[panda=js]
avacweb_chat_config.message_hook.push(function(row, username, userid, usr, msg) {
    row.innerHTML += '<span class="awc-quote" onclick="parent.avacweb_chat.quote_msg(\'' + username.replace(/'/g, "\\'") + '\', this.parentNode)">Quote</span>';
});
avacweb_chat_config.add_event('onload', function() {
    avacweb_chat.quote_msg = function(user, row) {
        avacweb_chat.insert_text( '[quote="' + user + '"]' + $('.msg', row).text() + '[/quote]' );
    };
});
Tested and it works Smile

Here's some CSS to neaten it up though:
[ic].awc-quote { float: right; font-weight: bold; text-shadow: 0 1px white; cursor: pointer; }[/ic]

You know I love this idea so much, I might install it here on Avacweb, and maybe make it a default feature in AWC 1.8
Thank you for the great idea.
LGforumLGforum
Status : Working to restore AWC!

Posts : 2804
Join date : 2011-10-05
Age : 27
Location : UK
Fri 22 Feb 2013, 13:53
A much better way of doing the avatars would be this:
Code:
[panda=js]avacweb_chat_config.message_hook.push(function(row, username, user_id, user) {
    var avs = {
        'Alexander' : 'http://i15.servimg.com/u/f15/14/58/00/77/alexav10.png',
        'Luffle' : 'http://en.touhouwiki.net/images/thumb/0/00/Th11Satori.png/200px-Th11Satori.png',
        'nextuser' : 'nextimg'
    },
    defaultAv = 'default avatar URL';
    user.innerHTML = '<img class="chatavatar" src="' + (avs[username] || defaultAv) + '">' + user.innerHTML;
});
(It would be even better to use the user id, since usernames with funny characters can be ambiguous in scripts)

The script in this topic is exactly what I use on this forum and is working fine. I've even updated it to include the quote tags now.

Yes, I'm aware of all of that... I've been here and doing this a while.
However I generally write shorter rules on one line, so when readability isn't massive issue, I post it like that too.
Its called Compiling. The CSS is compiled dynamically before output, and the same is done with the Javascripts.
Sponsored content