コード例 #1
0
ファイル: account.php プロジェクト: Nord001/zKillboard
    }
    if (@$domainChar['isExecutorCEO']) {
        $subdomain = modifyTicker($domainChar['alliTicker']) . ".{$baseAddr}";
        if (isset($bannerUpdates[$subdomain])) {
            $banner = $bannerUpdates[$subdomain];
            Db::execute('insert into zz_subdomains (subdomain, banner) values (:subdomain, :banner) on duplicate key update banner = :banner', array(':subdomain' => $subdomain, ':banner' => $banner));
            $error = "Banner updated for {$subdomain}, please wait 2 minutes for the change to take effect.";
        }
        $status = Db::queryRow('select adfreeUntil, banner from zz_subdomains where subdomain = :subdomain', array(':subdomain' => $subdomain), 0);
        $domainChar['adfreeUntil'] = @$status['adfreeUntil'];
        $domainChar['banner'] = @$status['banner'];
        $allis[] = $domainChar;
    }
    $showDisqus = Util::getPost('showDisqus');
    if ($showDisqus) {
        UserConfig::set('showDisqus', $showDisqus == 'true');
        $error = 'Disqus setting updated to ' . ($showDisqus ? ' display.' : ' not display.') . ' The next page load will reflect the change.';
    }
}
$data['domainCorps'] = $corps;
$data['domainAllis'] = $allis;
$data['domainChars'] = $domainChars;
$data['showDisqus'] = UserConfig::get('showDisqus', true);
$app->render('account.html', array('data' => $data, 'message' => $error, 'key' => $key, 'reqid' => $reqid));
function modifyTicker($ticker)
{
    $ticker = str_replace(' ', '_', $ticker);
    $ticker = preg_replace('/^\\./', 'dot.', $ticker);
    $ticker = preg_replace('/\\.$/', '.dot', $ticker);
    return strtolower($ticker);
}
コード例 #2
0
ファイル: account.php プロジェクト: Covert-Inferno/zKillboard
            $error = "{$entitymetadata['name']} has been added to your tracking list";
        } else {
            $error = "{$entitymetadata['name']} is already being tracked";
        }
    }
    $ddcombine = Util::getPost("ddcombine");
    if (isset($ddcombine)) {
        UserConfig::set("ddcombine", $ddcombine);
    }
    $ddmonthyear = Util::getPost("ddmonthYear");
    if (isset($ddmonthyear)) {
        UserConfig::set("ddmonthyear", $ddmonthyear);
    }
    $useSummaryAccordion = Util::getPost("useSummaryAccordion");
    if (isset($useSummaryAccordion)) {
        UserConfig::set("useSummaryAccordion", $useSummaryAccordion);
    }
}
$data["entities"] = Account::getUserTrackerData();
$data["themes"] = Util::bootstrapThemes();
$data["viewthemes"] = Util::themesAvailable();
$data["apiKeys"] = Api::getKeys($userID);
$data["apiChars"] = Api::getCharacters($userID);
$charKeys = Api::getCharacterKeys($userID);
$charKeys = Info::addInfo($charKeys);
$data["apiCharKeys"] = $charKeys;
$data["userInfo"] = User::getUserInfo();
$data["currentTheme"] = UserConfig::get("theme", "default");
$data["timeago"] = UserConfig::get("timeago");
$data["ddcombine"] = UserConfig::get("ddcombine");
$data["ddmonthyear"] = UserConfig::get("ddmonthyear");
コード例 #3
0
 /**
  * Executes the cronjob.
  *
  * @param mixed $last_result What the last execution of this cronjob
  *                           returned.
  * @param Array $parameters Parameters for this cronjob instance which
  *                          were defined during scheduling.
  *                          Only valid parameter at the moment is
  *                          "verbose" which toggles verbose output while
  *                          purging the cache.
  */
 public function execute($last_result, $parameters = array())
 {
     global $user;
     $cli_user = $user;
     $notification = new ModulesNotification();
     $query = "SELECT DISTINCT user_id FROM seminar_user su WHERE notification <> 0";
     if (get_config('DEPUTIES_ENABLE')) {
         $query .= " UNION SELECT DISTINCT user_id FROM deputies WHERE notification <> 0";
     }
     $rs = DBManager::get()->query($query);
     while ($r = $rs->fetch()) {
         $user = new Seminar_User($r["user_id"]);
         if ($user->locked) {
             continue;
         }
         setTempLanguage('', $user->preferred_language);
         $to = $user->email;
         $title = "[" . $GLOBALS['UNI_NAME_CLEAN'] . "] " . _("Tägliche Benachrichtigung");
         $mailmessage = $notification->getAllNotifications($user->id);
         $ok = false;
         if ($mailmessage) {
             if ($user->cfg->getValue('MAIL_AS_HTML')) {
                 $smail = new StudipMail();
                 $ok = $smail->setSubject($title)->addRecipient($to)->setBodyHtml($mailmessage['html'])->setBodyText($mailmessage['text'])->send();
             } else {
                 $ok = StudipMail::sendMessage($to, $title, $mailmessage['text']);
             }
         }
         UserConfig::set($user->id, null);
         if ($ok !== false && $parameters['verbose']) {
             echo $user->username . ':' . $ok . "\n";
         }
     }
     $user = $cli_user;
 }