當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。