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


PHP Dog::getOrLoadChannelByArg方法代码示例

本文整理汇总了PHP中Dog::getOrLoadChannelByArg方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::getOrLoadChannelByArg方法的具体用法?PHP Dog::getOrLoadChannelByArg怎么用?PHP Dog::getOrLoadChannelByArg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dog的用法示例。


在下文中一共展示了Dog::getOrLoadChannelByArg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: on_autojoin_Ac

 public function on_autojoin_Ac()
 {
     $user = Dog::getUser();
     $server = Dog::getServer();
     $argv = $this->argv();
     $argc = count($argv);
     # Invoked in channel.
     switch ($argc) {
         # .autojoin
         case 0:
             return $this->showStatus($channel);
             # .autojoin on|#channel
         # .autojoin on|#channel
         case 1:
             if (Dog_Var::isValid('b', $argv[0])) {
                 return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[0]));
             } elseif (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             } else {
                 return $this->showStatus($channel);
             }
             # .autojoin #wechall on
         # .autojoin #wechall on
         case 2:
             if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             }
             if (!Dog::hasPermission($server, $channel, $user, 'A')) {
                 return Dog::noPermission('s');
             }
             return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[1]));
     }
     $this->showHelp('autojoin');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:34,代码来源:DOGMOD_AutoJoin.php

示例2: array

<?php

$lang = array('en' => array('help' => 'Usage: %CMD% [<channel>[!<SID>]]. Command %BOT% to leave a channel. IRCOps can utilize this across networks.', 'not_there' => 'The channel you are trying to leave ist not occupied by %BOT% at all.', 'parting' => 'I am leaving %s now, and won´t come back on my own.'), 'de' => array('help' => 'Nutze: %CMD% [<Kanal>[!<SID>]]. Befehle %BOT% einen Kanal zu verlassen. IRCOps können dies Netzwerkübergreifend erledigen.', 'not_there' => 'Der Kanal den Du verlassen möchtest wird ist %BOT% zur Zeit unbekannt.', 'parting' => 'Ich verlasse nun %s und komme auch nicht von selbst wieder.'));
$plugin = Dog::getPlugin();
$serv = Dog::getServer();
$user = Dog::getUser();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc === 0) {
    if (false === ($channel = Dog::getChannel())) {
        return $plugin->showHelp();
    }
} elseif ($argc === 1) {
    if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
        return Dog::rply('err_channel');
    }
    if ($channel->getSID() !== $serv->getID()) {
        if (!Dog::hasPermission($serv, false, $user, 'i')) {
            return Dog::noPermission('i');
        }
    }
} else {
    return $plugin->showHelp();
}
# Do it!
$channel->saveOption(Dog_Channel::AUTO_JOIN, false);
$plugin->rply('parting', array($channel->displayLongName()));
$serv->partChannel($channel);
开发者ID:sinfocol,项目名称:gwf3,代码行数:28,代码来源:part_Ab.php


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