本文整理汇总了PHP中core::get_data_after方法的典型用法代码示例。如果您正苦于以下问题:PHP core::get_data_after方法的具体用法?PHP core::get_data_after怎么用?PHP core::get_data_after使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core
的用法示例。
在下文中一共展示了core::get_data_after方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logonnews_command
public static function logonnews_command($nick, $ircdata = array())
{
if (strtolower($ircdata[0]) == 'add') {
$title = $ircdata[1];
$text = core::get_data_after(&$ircdata, 2);
if (trim($title) == '' || trim($text) == '') {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX_RE, array('help' => 'LOGONEWS'));
// wrong syntax
return false;
}
self::_add_news($nick, $title, $text);
// add a news article
} elseif (strtolower($ircdata[0]) == 'del') {
$title = $ircdata[1];
if (trim($title) == '') {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX_RE, array('help' => 'LOGONEWS'));
// wrong syntax
return false;
}
self::_del_news($nick, $title);
// delete a news article, FROM the title.
} elseif (strtolower($ircdata[0]) == 'list') {
self::_list_news($nick);
// list the news
} else {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX_RE, array('help' => 'LOGONEWS'));
// wrong syntax
return false;
}
}
示例2: global_command
public static function global_command($nick, $ircdata = array())
{
$mask = $ircdata[0];
$message = core::get_data_after(&$ircdata, 1);
if (trim($mask) == '' || trim($message) == '') {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX);
return false;
}
// are they sending a message?
if (strpos($mask, '@') === false) {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_GLOBAL_INVALID);
return false;
} else {
if (strpos($mask, '!') === false) {
$mask = '*!' . $mask;
}
// prepend the *! to the mask
}
// is the mask valid?
if (core::$config->global->nick_on_global) {
ircd::global_notice(core::$config->global->nick, $mask, '[' . $nick . '] ' . $message);
} else {
ircd::global_notice(core::$config->global->nick, $mask, $message);
}
// send the message!!
ircd::globops(core::$config->operserv->nick, $nick . ' just used GLOBAL command.');
// we globop the command being used.
}
示例3: main
public function main(&$ircdata, $startup = false)
{
foreach (modules::$list as $module => $data) {
if ($data['type'] == 'nickserv') {
modules::$list[$module]['class']->main(&$ircdata, $startup);
// loop through the modules for nickserv.
}
}
if (ircd::on_msg(&$ircdata, core::$config->nickserv->nick)) {
$nick = core::get_nick(&$ircdata, 0);
$command = substr(core::get_data_after(&$ircdata, 3), 1);
// convert to lower case because all the tingy wags are in lowercase
self::get_command($nick, $command);
}
// this is what we use to handle command listens
// should be quite epic.
if (ircd::on_mode(&$ircdata) && core::$config->server->help_chan) {
$chan = core::get_chan(&$ircdata, 2);
if ($chan == strtolower(core::$config->server->help_chan)) {
$re_data = $ircdata;
unset($re_data[0], $re_data[1], $re_data[2], $re_data[3]);
foreach ($re_data as $nick) {
// we're going to guess that it's a nick here, lol.
if (strstr(core::$chans[$chan]['users'][$nick], 'o')) {
ircd::umode(core::$config->nickserv->nick, $nick, '+h');
}
// user has +o, lets give em +h!
}
}
// only deal with it if we're talking about the help chan
}
// here we deal with giving umode +h to ops :D
if (ircd::on_chan_create(&$ircdata) && core::$config->server->help_chan) {
$chans = explode(',', $ircdata[2]);
// chans
foreach ($chans as $chan) {
if ($chan == strtolower(core::$config->server->help_chan)) {
// the chan
$nusers_str = implode(' ', $ircdata);
$nusers_str = explode(':', $nusers_str);
// right here we need to find out where the thing is
$nusers = ircd::parse_users($chan, $nusers_str, 1);
foreach ($nusers as $nick => $modes) {
if (strstr($modes, 'o')) {
ircd::umode(core::$config->nickserv->nick, $nick, '+h');
}
// user has +o, lets give em +h!
}
}
// only deal with it if we're talking about the help chan
}
}
// and on_chan_create
}
示例4: main
public function main(&$ircdata, $startup = false)
{
if (ircd::on_msg(&$ircdata, core::$config->nickserv->nick)) {
$nick = core::get_nick(&$ircdata, 0);
$query = substr(core::get_data_after(&$ircdata, 3), 1);
// convert to lower case because all the tingy wags are in lowercase
$query = strtolower($query);
nickserv::get_help($nick, $query);
}
// only hook to the privmsg towards ChanServ, not channel messages
// although chanserv shouldn't even be in any channels :P
}
示例5: main
public function main(&$ircdata, $startup = false)
{
if (ircd::on_msg(&$ircdata, core::$config->operserv->nick)) {
$nick = core::get_nick(&$ircdata, 0);
$query = substr(core::get_data_after(&$ircdata, 3), 1);
// convert to lower case because all the tingy wags are in lowercase
$query = strtolower($query);
if (core::$nicks[$nick]['ircop'] && services::user_exists($nick, true, array('display', 'identified') !== false)) {
operserv::get_help($nick, $query);
}
}
// only hook to the privmsg towards OperServ
}
示例6: register_command
public static function register_command($nick, $ircdata = array())
{
$chan = core::get_chan(&$ircdata, 0);
$desc = core::get_data_after(&$ircdata, 1);
// get the channel.
if ($user = services::user_exists($nick, true, array('display', 'id'))) {
if (trim($desc) == '' || $chan == '' || $chan[0] != '#' || stristr($channel, ' ')) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_INVALID_SYNTAX_RE, array('help' => 'INFO'));
// wrong syntax
return false;
}
if (services::chan_exists($chan, array('channel')) !== false) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_REGISTERED_CHAN, array('chan' => $chan));
return false;
}
// check if its registered?
if (!strstr(core::$chans[$chan]['users'][$nick], 'o')) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_NEED_CHAN_OP, array('chan' => $chan));
return false;
}
// we need to check if the user trying to register it has +o
// if not we tell them to GET IT!
$chan_info = array('channel' => $chan, 'timestamp' => core::$network_time, 'last_timestamp' => core::$network_time, 'topic' => core::$chans[$chan]['topic'], 'topic_setter' => core::$chans[$chan]['topic_setter']);
$rflags = core::$config->chanserv->default_flags;
$rflags = str_replace('d', '', $rflags);
$rflags = str_replace('u', '', $rflags);
$rflags = str_replace('e', '', $rflags);
$rflags = str_replace('w', '', $rflags);
$rflags = str_replace('m', '', $rflags);
$rflags = str_replace('t', '', $rflags);
// ignore parameter flags
database::insert('chans', $chan_info);
database::insert('chans_levels', array('channel' => $chan, 'target' => $user->display, 'flags' => 'Ftfrsqao'));
database::insert('chans_flags', array('channel' => $chan, 'flags' => $rflags . 'd', 'desc' => $desc));
// create the channel! WOOOH
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_CHAN_REGISTERED, array('chan' => $chan));
core::alog(core::$config->chanserv->nick . ': ' . $chan . ' registered by ' . core::get_full_hostname($nick));
// logchan
core::alog('register_command(): ' . $chan . ' registered by ' . core::get_full_hostname($nick), 'BASIC');
// log what we need to log.
if ($channel = services::chan_exists($chan, array('channel', 'topic', 'suspended'))) {
chanserv::_join_channel(&$channel);
// join the channel
}
// does the channel exist?
} else {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_UNREGISTERED);
return false;
// ph00s aint even registered..
}
}
示例7: suspend_command
public static function suspend_command($nick, $ircdata = array())
{
$chan = core::get_chan(&$ircdata, 0);
$reason = core::get_data_after(&$ircdata, 1);
$chan_info = array();
// get the channel.
if (!core::$nicks[$nick]['ircop'] || services::user_exists($nick, true, array('display', 'identified')) === false) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
return false;
}
// they've gotta be identified and opered..
if ($chan == '' || $chan[0] != '#') {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_INVALID_SYNTAX_RE, array('help' => 'SUSPEND'));
return false;
// wrong syntax
}
// make sure they've entered a channel
if (trim($reason) == '') {
$reason = 'No reason';
}
// is there a reason? if not we set it to 'No Reason'
if ($channel = services::chan_exists($chan, array('channel', 'suspended'))) {
if ($channel->suspended == 1) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_SUSPEND_2, array('chan' => $chan));
return false;
// channel is already suspended lol
} else {
database::update('chans', array('suspended' => 1, 'suspend_reason' => $reason), array('channel', '=', $channel->channel));
// channel isn't suspended, but it IS registered
}
} else {
$chan_info = array('channel' => $chan, 'timestamp' => core::$network_time, 'last_timestamp' => core::$network_time, 'suspended' => 1, 'suspend_reason' => $reason);
database::insert('chans', $chan_info);
database::insert('chans_flags', array('channel' => $chan, 'flags' => 'd', 'desc' => $reason));
// if the channel isn't registered, we register it, with a founder value of 0
// so we can check when it's unsuspended THAT if the founder value is 0, we'll
// just drop it as well, this way nobody actually gets the founder status.
}
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_SUSPEND_3, array('chan' => $chan, 'reason' => $reason));
core::alog(core::$config->chanserv->nick . ': ' . $nick . ' SUSPENDED ' . $chan . ' with the reason: ' . $reason);
ircd::globops(core::$config->chanserv->nick, $nick . ' SUSPENDED ' . $chan);
if (!empty(core::$chans[$chan]['users'])) {
foreach (core::$chans[$chan]['users'] as $user => $boolean) {
if (!core::$nicks[$nick]['ircop']) {
ircd::kick(core::$config->chanserv->nick, $user, $chan, $reason);
}
}
}
// any users in the channel? KICK EM!! RAWR
}
示例8: suspend_command
public static function suspend_command($nick, $ircdata = array())
{
$unick = core::get_nick(&$ircdata, 0);
$reason = core::get_data_after(&$ircdata, 1);
$user_info = array();
// get the nick etc.
if (!core::$nicks[$nick]['ircop'] || services::user_exists($nick, true, array('display', 'identified')) === false) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ACCESS_DENIED);
return false;
}
// they've gotta be identified and opered..
if (services::is_root($unick) && !services::is_root($nick)) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ACCESS_DENIED);
return false;
}
// is a non-root trying to drop a root?
if (trim($reason) == '') {
$reason = 'No reason';
}
// is there a reason? if not we set it to 'No Reason'
if ($user = services::user_exists($unick, false, array('display', 'suspended'))) {
if ($user->suspended == 1) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_SUSPEND_2, array('nick' => $unick));
return false;
// channel is already suspended lol
} else {
database::update('users', array('suspended' => 1, 'suspend_reason' => $reason), array('display', '=', $user->display));
// channel isn't suspended, but it IS registered
}
} else {
$user_info = array('display' => $unick, 'last_timestamp' => core::$network_time, 'timestamp' => core::$network_time, 'identified' => 0, 'real_user' => 0, 'suspended' => 1, 'suspend_reason' => $reason);
// setup the user info array.
database::insert('users', $user_info);
// insert it into the database.
}
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_SUSPEND_3, array('nick' => $unick, 'reason' => $reason));
core::alog(core::$config->nickserv->nick . ': ' . $nick . ' SUSPENDED ' . $unick . ' with the reason: ' . $reason);
ircd::globops(core::$config->nickserv->nick, $nick . ' SUSPENDED ' . $unick);
if (isset(core::$nicks[$unick])) {
$random_nick = 'Unknown' . rand(10000, 99999);
services::communicate(core::$config->nickserv->nick, $unick, &nickserv::$help->NS_SUSPEND_1, array('nick' => $unick));
services::communicate(core::$config->nickserv->nick, $unick, &nickserv::$help->NS_NICK_CHANGE, array('nick' => $random_nick));
ircd::svsnick($unick, $random_nick, core::$network_time);
}
// is the nick in use? we need to force change it.
}
示例9: topic_command
public static function topic_command($nick, $ircdata = array())
{
$chan = core::get_chan(&$ircdata, 0);
$topic = core::get_data_after(&$ircdata, 1);
// get the channel.
if ($chan == '' || $chan[0] != '#') {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_INVALID_SYNTAX_RE, array('help' => 'TOPIC'));
return false;
// wrong syntax
}
// make sure they've entered a channel
if (services::chan_exists($chan, array('channel')) === false) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_UNREGISTERED_CHAN, array('chan' => $chan));
return false;
}
// make sure the channel exists.
if (chanserv::check_levels($nick, $channel->channel, array('t', 'F')) === false) {
services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
return false;
}
// do they have access?
if ($channel = services::chan_exists($chan, array('channel'))) {
$topicmask = chanserv::get_flags($chan, 't');
// get the topicmask
if ($topicmask != null) {
$topic = str_replace(' *', ' ' . $new_topic, $topicmask);
$topic = str_replace('\\*', '*', $topic);
ircd::topic(core::$config->chanserv->nick, $channel->channel, $topic);
database::update('chans', array('topic' => $topic, 'topic_setter' => core::$config->chanserv->nick), array('channel', '=', $channel->channel));
} else {
$topic = trim($topic);
if (trim($topic) == '') {
ircd::topic(core::$config->chanserv->nick, $chan, '');
database::update('chans', array('topic' => '', 'topic_setter' => core::$config->chanserv->nick), array('channel', '=', $chan));
// set us an empty topic
} else {
ircd::topic(core::$config->chanserv->nick, $chan, $topic);
database::update('chans', array('topic' => $topic, 'topic_setter' => core::$config->chanserv->nick), array('channel', '=', $chan));
// change the topic
}
}
}
// we gotta get the topicmask etc
}
示例10: chanclear_command
public static function chanclear_command($nick, $ircdata = array())
{
$chan = core::get_chan(&$ircdata, 1);
$reason = core::get_data_after(&$ircdata, 2);
$mode = strtoupper($ircdata[0]);
// get the data.
if (trim($chan) == '' || trim($reason) == '' || !in_array($mode, array('KICK', 'KILL', 'GLINE'))) {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX_RE, array('help' => 'CHANCLEAR'));
return false;
// wrong syntax
}
if ($chan[0] != '#') {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_INVALID_SYNTAX_RE, array('help' => 'CHANCLEAR'));
return false;
// wrong syntax
}
if (isset(core::$chans[$chan])) {
foreach (core::$chans[$chan]['users'] as $user => $umode) {
if (core::$nicks[$user]['ircop']) {
core::alog(core::$config->operserv->nick . ': Ignoring IRC Operator (' . $user . ')');
// ignore irc operator, infact, logchan it too
} else {
if ($mode == 'KICK') {
ircd::kick(core::$config->operserv->nick, $user, $chan, 'CHANKILL by ' . $nick . ' (' . $reason . ')');
ircd::mode(core::$config->operserv->nick, $chan, '+b *@' . core::$nicks[$user]['host']);
// kick and +b them
} elseif ($mode == 'KILL') {
ircd::kill(core::$config->operserv->nick, $user, 'CHANKILL by ' . $nick . ' (' . $reason . ')');
} elseif ($mode == 'GLINE') {
ircd::gline(core::$config->operserv->nick, '*@' . core::$nicks[$user]['oldhost'], 604800, 'CHANKILL by ' . $nick . ' (' . $reason . ')');
}
// remove all other users.
}
}
// loop through the people in the channel/
} else {
services::communicate(core::$config->operserv->nick, $nick, &operserv::$help->OS_CHAN_INVALID, array('chan' => $chan));
}
// check if the channel is in use..
}
示例11: on_mode
public static function on_mode(&$ircdata)
{
if (isset($ircdata[1]) && $ircdata[1] == 'MODE') {
core::alog('on_mode(): ' . $ircdata[0] . ' set ' . core::get_data_after($ircdata, 4) . ' on ' . $ircdata[2], 'BASIC');
// i added this to make debbuing a bit more useful.
return true;
}
// return true when any channel has a mode change, because $chan isnt set.
return false;
}
示例12: parse_users
public static function parse_users($chan, &$ircdata, $number)
{
$users = core::get_data_after(&$ircdata, $number);
$users = explode(' ', $users);
foreach ($users as $user) {
if ($user != null || $user != ' ') {
$nick = explode(',', $user);
$mode = trim($nick[0]);
$nick = isset($nick[1]) ? trim($nick[1]) : '';
$mode = str_replace(self::$prefix_modes['q'], 'q', $mode);
$mode = str_replace(self::$prefix_modes['a'], 'a', $mode);
$mode = str_replace(self::$prefix_modes['o'], 'o', $mode);
$mode = str_replace(self::$prefix_modes['h'], 'h', $mode);
$mode = str_replace(self::$prefix_modes['v'], 'v', $mode);
// fucking shitty inspircd 1.1
if ($nick != '') {
$nusers[$nick] = $mode;
}
}
}
return $nusers;
}
示例13: main
public function main(&$ircdata, $startup = false)
{
foreach (modules::$list as $module => $data) {
if ($data['type'] == 'operserv') {
modules::$list[$module]['class']->main(&$ircdata, $startup);
// loop through the modules for operserv.
}
}
if (ircd::on_msg(&$ircdata, core::$config->operserv->nick)) {
$nick = core::get_nick(&$ircdata, 0);
$command = substr(core::get_data_after(&$ircdata, 3), 1);
// convert to lower case because all the tingy wags are in lowercase
core::alog(core::$config->operserv->nick . ': ' . $nick . ': ' . $command);
// logchan it
if (core::$nicks[$nick]['ircop'] && services::user_exists($nick, true, array('display', 'identified') !== false)) {
self::get_command($nick, $command);
} else {
services::communicate(core::$config->operserv->nick, $nick, &self::$help->OS_DENIED_ACCESS);
}
// theyre an oper.
}
// this is what we use to handle command listens
// should be quite epic.
}
示例14: saflags_command
public static function saflags_command($nick, $ircdata = array())
{
$unick = core::get_nick(&$ircdata, 0);
$flags = $ircdata[1];
$param = core::get_data_after(&$ircdata, 2);
$rparams = explode('||', $param);
// get the channel.
if (!($user = services::user_exists($unick, false, array('display', 'id', 'identified', 'salt')))) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ISNT_REGISTERED, array('nick' => $unick));
return false;
}
// find out if our user is registered
if (services::is_root($unick) && !services::is_root($nick)) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ACCESS_DENIED);
return false;
}
// is a non-root trying to change a root's password?
if (!core::$nicks[$nick]['ircop'] || services::user_exists($nick, true, array('display', 'identified')) === false) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_ACCESS_DENIED);
return false;
}
// do we have access to do this?
$flag_a = array();
foreach (str_split($flags) as $flag) {
if (strpos(self::$flags, $flag) === false) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_FLAGS_UNKNOWN, array('flag' => $flag));
return false;
}
// flag is invalid.
$flag_a[$flag]++;
// plus
if ($flag_a[$flag] > 1 || $flag != '-' && $flag != '+') {
$flag_a[$flag]--;
}
// check for dupes
}
// check if the flag is valid
$flags = '';
foreach ($flag_a as $flag => $count) {
$flags .= $flag;
}
// reconstruct the flags
$flag_array = mode::sort_modes($flags, false);
// sort our flags up
foreach (str_split(self::$p_flags) as $flag) {
$param_num = strpos($flag_array['plus'], $flag);
if ($param_num !== false) {
$params[$flag] = trim($rparams[$param_num]);
}
// we do!
}
// check if we have any paramtized flags, eg +me
foreach (str_split($flag_array['plus']) as $flag) {
// paramtized flags (lowercase) ones come first
// ----------- +e ----------- //
if ($flag == 'e') {
self::set_flag($nick, $unick, '+e', $params['e']);
// +e the target in question
} elseif ($flag == 'u') {
self::set_flag($nick, $unick, '+u', $params['u']);
// +u the target in question
} elseif ($flag == 'S') {
self::set_flag($nick, $unick, '+S', '');
// +S the target in question
} elseif ($flag == 'P') {
self::set_flag($nick, $unick, '+P', '');
// +P the target in question
}
// ----------- +P ----------- //
}
foreach (str_split($flag_array['minus']) as $flag) {
// paramtized flags (lowercase) ones come first
// ----------- -e ----------- //
if ($flag == 'e') {
self::set_flag($nick, $unick, '-e', $params['e']);
// -e the target in question
} elseif ($flag == 'u') {
self::set_flag($nick, $unick, '-u', $params['u']);
// -u the target in question
} elseif ($flag == 'S') {
self::set_flag($nick, $unick, '-S', '');
// -S the target in question
} elseif ($flag == 'P') {
self::set_flag($nick, $unick, '-P', '');
// -P the target in question
}
// ----------- -P ----------- //
}
if (isset(self::$set[$unick])) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_FLAGS_SET, array('flag' => self::$set[$unick], 'target' => $unick));
unset(self::$set[$unick]);
}
// send back the target stuff..
if (isset(self::$already_set[$unick])) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_FLAGS_ALREADY_SET, array('flag' => self::$already_set[$unick], 'target' => $unick));
unset(self::$already_set[$unick]);
}
// send back the target stuff..
if (isset(self::$not_set[$unick])) {
services::communicate(core::$config->nickserv->nick, $nick, &nickserv::$help->NS_FLAGS_NOT_SET, array('flag' => self::$not_set[$unick], 'target' => $unick));
//.........这里部分代码省略.........
示例15: parse_users
public static function parse_users($chan, &$ircdata, $number)
{
$users = core::get_data_after(&$ircdata, $number);
$users = explode(' ', $users);
foreach ($users as $user) {
if ($user != null || $user != ' ') {
$prenick = explode(',', $user);
$nick = trim(self::get_nick($prenick, 1));
if ($nick != null) {
$nusers[$nick] = $prenick[0];
}
}
}
return $nusers;
}