📄 commands.php
字号:
}
} else {
$stmt = new Statement("UPDATE {$GLOBALS['fc_config']['db']['pref']}bans SET created=NOW() WHERE banneduserid=?");
$stmt->process($who_userid);
}
return 'ok';
}
if($irc_cmd == '/unban' && $role_admin) {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$type = 'nbanu';
$this->sendToUser($who_userid, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $msg_txt, $this->color));
$stmt = new Statement("DELETE FROM {$GLOBALS['fc_config']['db']['pref']}bans WHERE banneduserid=?");
$stmt->process($who_userid);
return 'ok';
}
if($irc_cmd == '/move' && $role_admin) {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE id=?");
$rs = $stmt->process($this->roomid);
$room = $rs->next();
if(!$room['ispublic']) $this->sendToUser($who_userid, new Message('adr', null, $this->roomid, $room['name']));
$this->sendToAll(new Message('mvu', $who_userid, $this->roomid, $msg));
$stmt = new Statement("UPDATE {$GLOBALS['fc_config']['db']['pref']}connections SET updated=NOW(), roomid=? WHERE id=?");
$stmt->process($this->roomid, $who_id);
return 'ok';
}
if($irc_cmd == '/unignore') {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$type = 'nignu';
$this->sendToUser($who_userid, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $msg_txt, $this->color));
$stmt = new Statement("DELETE FROM {$GLOBALS['fc_config']['db']['pref']}ignors WHERE userid=? AND ignoreduserid=?");
$stmt->process($this->userid, $who_userid);
return 'ok';
}
if($irc_cmd == '/msg' || $irc_cmd == '/query') {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
if($irc_cmd == '/msg') $txt = $msg_txt; else $txt = '';
$this->sendToUser($who_userid, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
return 'ok';
}
if($who_ip) {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $who_ip, $this->color));
if($irc_cmd == '/who') return 'ok';
}
if(substr($irc_cmd, 0, 4) == '/who') {
if(!$who_ip) $this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$this->doRequestUserProfileText($who_userid);
return 'ok';
}
}
}
//start fix nr 1 for not displaying bad IRC commands and also all available IRC commands when /? or /help
if(substr($txt, 0, 2) == '/?' || substr($txt, 0, 5) == '/help') {
if( !$role_admin || (substr($txt, 0, 5) == '/?all' || substr($txt, 0, 8) == '/helpall') ) {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>User Commands are:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>Announcing availability:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/away</b> Sets user as away. Typing this command again sets user as "here".';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/here</b> Sets user as here. This reverses the "away" and "busy" states.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/busy</b> Sets user as busy. Typing this command again sets user as "here".';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>Managing messages:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/back <number></b> Shows the last <number> of entries of the rooms chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/backtime <minutes></b> Shows the last <minutes> of the rooms chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/clear</b> Clears the chat screen. This only affects your screen, not the screen of other users.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/me <action></b> Issues an IRC-like "action" to the chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/msg <user> <message></b> Initiates a PM with <user> and fills PM box with optional <message>.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/query <user></b> Initiates a PM with <user>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>Accessing rooms:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/join <room></b> Switches the user to <room>. For example: "/join The Lounge"';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/part</b> Logout of the chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/quit</b> Logout of the chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/logout</b> Logout of the chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>Managing users:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/ignore <user></b> Ignores PMs from <user>.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/invite <user></b> Invites <user> to the room that you are currently in.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/names</b> Shows a list of all user names in all public rooms';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/showignores</b> Shows a list of users ignored by you and which other users are ignoring you.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/sos <message></b> Alerts moderator in current room or all moderators. <message> is optional.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/unignore <user> <message></b> Removes your ignore of <user> with optional <message> to user.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/who <user></b> Profile page popup for <user>. If you are <user> login information is added.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/whois <user></b> Profile page popup for <user> where <user> must be logged in to the chat.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/whowas <user></b> Profile page popup for any registered <user>.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>Other:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/motd</b> Displays the Message of the Day.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/topic</b> Shows the topic or welcome message for the room you are in, if any.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/version</b> Shows which version of the chat you are using.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/welcome</b> Same as /topic.';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
}
if($role_admin) {
$txt = '<b>Moderator Commands are:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/kick</b> user <b>/boot</b> user <b>/ban</b> user <b>/banip</b> user <b>/gagX</b> user <b>/ungag</b> user <b>/broadcast</b> message';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/alert</b> user message <b>/roomalert</b> message <b>/chatalert</b> message';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/showbans</b> <b>/unban</b> user <b>/reban</b> user <b>/reban</b> @ <b>/rooms</b> <b>/who</b> user <b>/whois</b> user <b>/names</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/kickout</b> user <b>/kickout</b> @ <b>/kickroom</b> <b>/move</b> user <b>/status</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/motd</b> <b>/motd</b> @ <b>/motd</b> [new message] <b>/?all</b> <b>/helpall</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/addbot</b> botname <b>/startbot</b> botname <b>/killbot</b> botname <b>/showbots</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '<b>/teach</b> "botname" "phrase" => "response" <b>/unteach</b> "botname" "phrase" => "response" ';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
}
if($GLOBALS['fc_config']['disabledIRC']) {
$txt = '<b>Some IRC commands are disabled:</b>';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = '/' . str_replace ( ',', ' /', $GLOBALS['fc_config']['disabledIRC']);
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
}
return 'ok';
}
if(substr($txt, 0, 1) == '/') {
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
$txt = 'Warning ! Only IRC subset can be used (Type /? or /help for list of IRC commands)';
$this->sendToUser(null, new Message($type, $this->userid, $GLOBALS['fc_config']['liveSupportMode']?$this->roomid:null, $txt, $this->color));
return 'ok';
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -