System Message or Warning Message
(Versions 1.3 - 1.9.1) (Not supported in 2.0+)This short plug in will give your install of AWC two new commands; 'system' and 'warning'. The [ic]/system[/ic] command will post a system message to AWC, this message does not have an author or time. The [ic]/warning[/ic] command does the same thing, but looks important and can be used to warn people or tell them off for breaking rules.
Here's the short plug in code, just stick it underneath your AWC install script.
- Code:
[panda=js]avacweb_chat_config.commands.system = {
description : '/system message - post a system message',
run : function(text) {
if(text && text.length) {
return '[table class="system-message"][tr][td]' + text + '[/td][/tr][/table]';
}
return false;
}
};
avacweb_chat_config.commands.warning = {
description : '/warning message - post a warning message',
run : function(text) {
if(text && text.length) {
return '[table class="warning-message"][tr][td]' + text + '[/td][/tr][/table]';
}
return false;
}
};
avacweb_chat_config.message_hook.push(function(row) {
var m = $('.system-message, .warning-message', row)[0];
if(m) {
var msg = m.getElementsByTagName('td')[0].innerHTML;
row.innerHTML = '<div class="' + m.className + '">' + msg + '</div>';
}
});
Then to top it off and make it stylish add this CSS to your forums CSS[tip]Found at ACP > Display > Colors > CSS Stylesheet[/tip]
- Code:
[panda=css].system-message, .warning-message {
font-weight: bold;
border: 1px solid #AAA;
padding: 3px 5px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
color: #666;
background: #DDD;
text-shadow: 0 1px white;
}
.warning-message {
border: 1px solid rgb(228, 130, 130);
color: rgb(196, 14, 14);
background: rgb(245, 174, 174);
}
Enjoy.