當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dog::lang方法代碼示例

本文整理匯總了PHP中Dog::lang方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::lang方法的具體用法?PHP Dog::lang怎麽用?PHP Dog::lang使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dog的用法示例。


在下文中一共展示了Dog::lang方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fetchDefinitionE

 function fetchDefinitionE(Dog_Plugin $plugin, $term)
 {
     $output = array();
     $res = GWF_HTTP::getFromUrl('http://www.urbandictionary.com/define.php?term=' . $term);
     if ($res === false) {
         return Dog::lang('err_timeout');
     }
     if (strstr($res, "isn't defined <a href")) {
         return $plugin->lang('none_yet', array($term, urlencode($term)));
     }
     preg_match('#<div class=\'meaning\'>(.+?)</div>.*?<div class=\'example\'>(.*?)</div>#s', $res, $arr);
     $definition = trim(html_entity_decode(strip_tags(preg_replace('#<\\s*?br\\s*?/?\\s*?>#', "\n", $arr[1]))));
     $definition = strtr($definition, array("\r" => ' ', "\n" => ' '));
     while (false !== strstr($definition, '  ')) {
         $definition = str_replace('  ', ' ', $definition);
     }
     if (strlen($definition) > 800) {
         $definition = substr($definition, 0, 800) . '...';
     }
     $output['definition'] = $definition;
     if (!empty($arr[2])) {
         $example = trim(html_entity_decode(strip_tags(preg_replace('#<\\s*?br\\s*?/?\\s*?>#', "\n", $arr[2]))));
         $example = strtr($example, array("\r" => ' | ', "\n" => ' | '));
         while (false !== strstr($example, ' |  | ')) {
             $example = str_replace(' |  | ', ' | ', $example);
         }
         while (false !== strstr($example, '  ')) {
             $example = str_replace('  ', ' ', $example);
         }
         if (strlen($example) > 800) {
             $example = substr($example, 0, 800) . '...';
         }
         $output['example'] = $example;
     }
     return $output;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:36,代碼來源:wtf_Pb.php

示例2: getHelp

 public function getHelp()
 {
     return 'help' === ($help = $this->lang('help')) ? Dog::lang('err_no_help') : $help;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:4,代碼來源:Dog_Plugin.php

示例3: getHelp

 public function getHelp($trigger, $args = NULL)
 {
     $key = 'help_' . $trigger;
     if ($key === ($help = $this->lang_->lang($key))) {
         return Dog::lang('err_no_help');
     }
     return $this->replaceLang($help, $args, $trigger);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:8,代碼來源:Dog_Module.php

示例4: showVarNames

 public static function showVarNames(array $vars, $scope = NULL)
 {
     $serv = Dog::getServer();
     $chan = Dog::getChannel();
     $user = Dog::getUser();
     $back = array();
     foreach ($vars as $var) {
         $var instanceof Dog_Var;
         if ($var->inScope($scope) && $var->hasPermission($serv, $chan, $user)) {
             $back[] = $var->getName();
         }
     }
     return count($back) ? implode(', ', $back) : Dog::lang('none');
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:14,代碼來源:Dog_Var.php

示例5: connect

 public function connect()
 {
     if ($this->next_connect <= microtime(true)) {
         $this->attempt++;
         echo "Dog_IRC::connect() to {$this->getURL()}{$this->displaySSL()} attempt {$this->attempt}.\n";
         if (false === $this->connection->connect($this)) {
             $this->setConnectIn($this->getNextConnectTime());
             if (false !== ($connector = $this->getVarDefault('dog_connector', false))) {
                 $connector instanceof Dog_User;
                 $connector->sendPRIVMSG(Dog::lang('err_connecting', array($this->displayLongName())));
             }
             if ($this->attempt > 3 && !$this->hasConnectedOnce()) {
                 Dog::removeServer($this);
                 $this->delete();
             }
             return false;
         } else {
             $this->attempt = 2;
             return Dog_Auth::connect($this);
         }
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:22,代碼來源:Dog_Server.php

示例6: onSend

 public function onSend(Dog_Server $server, Dog_User $user, $message)
 {
     // 		$c = Dog::getTrigger();
     if (false === ($nickname = Common::substrUntil($message, ' ', false))) {
         return $this->lang('help_send');
     }
     $message = Common::substrFrom($message, ' ');
     if (false === ($user_to = Dog_User::getForServer($server->getID(), $nickname))) {
         return Dog::lang('err_user');
     }
     if (false === Dog_Note::isWithinLimits($user->getID())) {
         return $this->lang('err_limit', array(Dog_Note::LIMIT_AMT, GWF_Time::humanDuration(Dog_Note::LIMIT_TIME)));
     }
     if (false !== ($channel = Dog::getChannel())) {
         if (false !== $channel->getUserByName($nickname)) {
             return $this->lang('err_in_chan', array($nickname));
         }
     }
     if (false === Dog_Note::insertNote($user, $user_to, $message)) {
         return GWF_HTML::lang('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->lang('msg_sent', array($nickname));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:23,代碼來源:DOGMOD_Notes.php

示例7: dogplug_scopetxt

 function dogplug_scopetxt(Dog_Plugin $plugin, $priv, $scope)
 {
     $priv = Dog::lang('priv_' . $priv);
     $scope = Dog::lang('scop_' . $scope);
     return ' ' . $plugin->lang('scope', array($scope, $priv));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:6,代碼來源:help_Pb.php

示例8: displayChar

 public static function displayChar($char)
 {
     return Dog::lang('priv_' . $char);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:4,代碼來源:Dog_IRCPriv.php

示例9: array

<?php

# :irc.giz.org 001 Dog :Welcome to the gizmore IRC Network Dog!Dawg@localhost
# Set bot mode
$server = Dog::getServer();
$nick = Dog::getNickname();
Dog::getOrCreateUserByName(Dog::argv(0));
if (!$server->isOptionEnabled(Dog_Server::NO_BOTFLAG)) {
    $server->sendRAW("MODE {$nick} +b");
    $server->sendRAW("MODE {$nick} +B");
}
if (false !== ($connector = $server->getVarDefault('dog_connector', false))) {
    $server->unsetVar('dog_connector');
    $connector instanceof Dog_User;
    $connector->sendPRIVMSG(Dog::lang('msg_connected', array($server->displayLongName(), Dog::getNickname(), $server->getConf('ircoppass'))));
}
$server->saveOption(Dog_Server::HAS_CONNECTED_ONCE);
$server->getNick()->identify();
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:18,代碼來源:001.php


注:本文中的Dog::lang方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。