Esempio n. 1
0
 private function announceVideo(array $data)
 {
     // Pick ISO for channel?
     if (false !== ($chan = Dog::getChannel())) {
         $iso = $chan->getLangISO();
     } else {
         $iso = Dog::getUser()->getLangISO();
     }
     $vars = array($data['title'], GWF_TimeConvert::humanDurationISO($iso, $data['duration']), sprintf('%.02f', $data['rating']), number_format($data['views']), number_format($data['num_raters']));
     Dog::reply($this->langISO($iso, 'video', $vars));
 }
Esempio n. 2
0
    $DOG_PLUG_ALERT_TIMERS = array();
}
$plug = Dog::getPlugin();
if ($plug->argc() < 2) {
    return $plug->showHelp();
}
$seconds = str_replace('m', 'i', $plug->argv(0));
// Try to parse seconds from input
if (0 >= ($seconds = GWF_TimeConvert::humanToSeconds($seconds))) {
    return $plug->rply('err_seconds');
}
if (GWF_Time::ONE_DAY * 8 < $seconds) {
    return $plug->rply('err_too_long');
}
// Try to parse back duration from parsed seconds
if (false === ($delay = GWF_TimeConvert::humanDurationISO(Dog::getLangISO(), $seconds))) {
    return $plug->rply('err_seconds');
}
$user = Dog::getUser();
if (!isset($DOG_PLUG_ALERT_TIMERS[$user->getID()])) {
    $DOG_PLUG_ALERT_TIMERS[$user->getID()] = 0;
}
if ($DOG_PLUG_ALERT_TIMERS[$user->getID()] >= 3) {
    return $plug->rply('err_too_much');
}
if (!function_exists('dog_plugin_alert_func4')) {
    function dog_plugin_alert_func4(array $args)
    {
        global $DOG_PLUG_ALERT_TIMERS;
        $scope = $args[0];
        $scope instanceof Dog_Scope;