当前位置: 首页>>代码示例>>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;未经允许,请勿转载。