本文整理汇总了PHP中Dog::getServerBySuffix方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::getServerBySuffix方法的具体用法?PHP Dog::getServerBySuffix怎么用?PHP Dog::getServerBySuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog::getServerBySuffix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_seen_Pb
/**
* We got triggered by !seen.
*/
public function on_seen_Pb()
{
$argv = $this->argv();
$argc = count($argv);
if ($argc === 1) {
if (!preg_match('/^[a-z0-9_!]+$/iD', $argv[0])) {
return Dog::rply('err_user');
}
if (false === ($server = Dog::getServerBySuffix($argv[0]))) {
return Dog::rply('err_server');
}
if (false === ($user = Dog_User::getByLongName($argv[0]))) {
return Dog::rply('err_user');
}
if (false === ($seen = Dog_Seen::getSeen($user))) {
return $this->rply('never', array($user->displayName()));
}
$channel = $seen->getChannel();
$channam = $channel === false ? '!NOCHAN!' : $channel->displayName();
$this->rply($seen->getEvent(), array($user->displayName(), $server->displayName(), $channam, $seen->displayDate(), $seen->displayAge(), $seen->getMessage()));
} else {
$this->showHelp('seen');
}
}
示例2: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% <channel>[!<SID>]. Try to join a channel.', 'already' => 'I am already on that channel.', 'trying' => 'Trying to join this channel.', 'unknown_serv' => 'This server is unknown.'), 'de' => array('help' => 'Nutze: %CMD% <Kanal>[!<SID>]. Versucht einem Kanal beizutreten.', 'already' => 'Ich bin schon in diesem Kanal.', 'trying' => 'Es wird versucht dem Kanal beizutreten.', 'unknown_serv' => 'Dieser Server ist nicht vorhanden.'));
$plugin = Dog::getPlugin();
if ($plugin->argc() !== 1) {
return $plugin->showHelp();
}
$arg = $plugin->argv(0);
if (false === ($server = Dog::getServerBySuffix($arg))) {
return $plugin->rply('unknown_serv');
}
if (false !== ($channel = Dog::getChannelByArg($arg))) {
return $plugin->rply('already');
}
$chan_name = Common::substrFrom($arg, '!', $arg);
if (false === ($channel = Dog_Channel::getOrCreate($server, $chan_name))) {
return Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$plugin->rply('trying');
$channel->saveOption(Dog_Channel::AUTO_JOIN, true);
$server->joinChannel($channel);