-
Notifications
You must be signed in to change notification settings - Fork 300
Mod Wall
Doc gWorldz edited this page Jul 23, 2014
·
3 revisions
Open lib/class/CustomAJAXChat.php and add the following before the last closing bracket } at the end of the file:
NOTE: If you have already added another custom command, you should add only the case for '/wall' to your existing parseCustomCommands function override.
function parseCustomCommands($text, $textParts) { switch($textParts[0]) { case '/wall': if($this->getUserRole()==AJAX_CHAT_ADMIN || $this->getUserRole() == AJAX_CHAT_MODERATOR) { $text = str_replace('/wall','',$text); $users=$this->getCustomUsers(); // Had to change my Yii call, this may breaks… :/ switch($this->getUserRole()) { // BBCode colors for the roles case AJAX_CHAT_ADMIN: $col="blue"; break; case AJAX_CHAT_MODERATOR: $col="orange"; break; } foreach($users as $id=>$user) { $this->insertChatBotMessage( $this->getPrivateMessageID($id), '[color=red][i]'.$this->getLang("wall").'[/i][/color]|[color='.$col.'][b]'.$this->getUserName().'[/b][/color]: '.$text ); } } else { $this->insertChatBotMessage( $this->getPrivateMessageID(), '/error CommandNotAllowed '.$textParts[0] ); } return true; break; default: return false; } }
Open lib/lang/en.php and find:
$lang = array();
Add the following on a new line before the php closing tag ?>
at the end of the file:
$lang['wall'] = 'Wall';
Useful to send out maintenance messages:
/wall Installing PHP and Apache update, chat may act funky.
In the logs, it apepars as a message to each seperate user, making it possible to also send this to private channels.
Thanks to Ingwie Phoenix for this mod.