Example #1
0
 public static function lang($key, $args = NULL)
 {
     return self::langISO(Dog::getLangISO(), $key, $args);
 }
Example #2
0
 public function lang($key, $args = NULL)
 {
     return $this->langISO(Dog::getLangISO(), $key, $args);
 }
Example #3
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;
Example #4
0
 public function getTrans()
 {
     return $this->lang_->getTrans(Dog::getLangISO());
 }
Example #5
0
 public function displayAge()
 {
     return GWF_Time::displayAgeISO($this->getDate(), Dog::getLangISO());
 }
Example #6
0
<?php

$lang = array('en' => array('help' => 'Usage: %CMD% [<timestamp>] [<timezone>]. Convert a unix timestamp to a date.', 'conv' => 'Timestamp %s will be %s.'));
$plugin = Dog::getPlugin();
if ('' === ($message = $plugin->msg())) {
    return $plugin->showHelp();
}
$args = explode(' ', $message);
if (count($args) === 1) {
    $args[] = 'CET';
}
if (count($args) !== 2) {
    return $plugin->showHelp();
}
$plugin->rply('conv', array($args[0], GWF_Time::displayTimestamp($args[0], Dog::getLangISO(), 'Invalid date')));
Example #7
0
<?php

$lang = array('en' => array('help' => 'Usage: %CMD% <some location>. Get weather information from google.', 'err_google' => 'Cannot connect to google.', 'err_decode' => 'An error occured in the response processor.', 'weather' => "Wetter in %s: %s, %s°C, %s."));
$plugin = Dog::getPlugin();
$msg = $plugin->msg();
if ($msg === '') {
    return $plugin->showHelp();
}
return $plugin->rply('NOT WORKING');
$url = "http://www.google.com/ig/api?weather=" . urlencode($msg) . "&hl=" . Dog::getLangISO();
if (false === ($file = GWF_HTTP::getFromURL($url))) {
    return $plugin->rply('err_google');
}
try {
    $file = utf8_encode($file);
    if (false !== ($xml = simplexml_load_string($file))) {
        $temp = $xml->weather->forecast_information->city;
        $location = $xml->weather->forecast_information->city->attributes()->data;
        $condition = $xml->weather->current_conditions->condition->attributes()->data;
        $temp_c = $xml->weather->current_conditions->temp_c->attributes()->data;
        $humidity = $xml->weather->current_conditions->humidity->attributes()->data;
        $plugin->rply('weather', array($location, $condition, $temp_c, $humidity));
    }
} catch (Exception $e) {
}
$plugin->rply('err_decode');