当前位置: 首页>>代码示例>>PHP>>正文


PHP Dog::getServerBySuffix方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:DOGMOD_Seen.php

示例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);
开发者ID:sinfocol,项目名称:gwf3,代码行数:21,代码来源:join_Hb.php


注:本文中的Dog::getServerBySuffix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。