本文整理汇总了PHP中UserConfig::set方法的典型用法代码示例。如果您正苦于以下问题:PHP UserConfig::set方法的具体用法?PHP UserConfig::set怎么用?PHP UserConfig::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserConfig
的用法示例。
在下文中一共展示了UserConfig::set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyTicker
}
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:
$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: execute
/**
* 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;
}