本文整理匯總了PHP中option::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP option::set方法的具體用法?PHP option::set怎麽用?PHP option::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類option
的用法示例。
在下文中一共展示了option::set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: check_update
/**
* Adds notifications if there are new theme version available.
* Runs on time a day
*
* @return void
*/
public static function check_update()
{
$lastChecked = (int) option::get('theme_last_checked');
$temp_version = get_transient('wpzoom_temp_theme_version');
// force a check if we think theme was updated
if (!$temp_version) {
set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
} else {
if (version_compare($temp_version, WPZOOM::$themeVersion, '!=')) {
$lastChecked = 0;
set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
}
}
if ($lastChecked == 0 || $lastChecked + 60 * 60 * 24 < time()) {
if (self::has_update()) {
option::set('theme_status', 'needs_update');
} else {
option::delete('theme_status');
}
option::set('theme_last_checked', time());
}
if (option::get('theme_status') == 'needs_update' && current_user_can('update_themes')) {
add_action('admin_notices', array(__CLASS__, 'notification'));
}
}
示例2: callback_init
function callback_init()
{
global $m;
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_ban` (\n`id` int(255) NOT NULL AUTO_INCREMENT ,\n`uid` int(255) NOT NULL ,\n`pid` int(255) NOT NULL ,\n`tieba` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`user` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' ,\n`nextdo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=12\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0;");
option::set('plugin_wmzz_ban', 'a:2:{s:5:"limit";s:2:"10";s:3:"msg";s:63:"由於你違反了吧規,現在已被本吧管理循環封禁";}');
cron::set('wmzz_ban', 'plugins/wmzz_ban/wmzz_ban_cron.php', 0, 0, 0);
}
示例3: callback_init
function callback_init()
{
option::add('wmzz_mailer_title');
option::add('wmzz_mailer_text');
option::set('wmzz_mailer_limit', '5');
option::set('wmzz_mailer_last', '0');
cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 0, 0, 0);
}
示例4: callback_init
function callback_init()
{
global $m;
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan` (\n`id` int(255) NOT NULL AUTO_INCREMENT ,\n`uid` int(255) NOT NULL ,\n`num` int(255) NULL DEFAULT 0 ,\n`lastdo` date NOT NULL DEFAULT '0000-00-00' ,\nPRIMARY KEY (`id`, `uid`),\nUNIQUE INDEX `uid` (`uid`) USING BTREE \n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=3\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan_data` (\n`id` int(255) NOT NULL AUTO_INCREMENT ,\n`uid` int(255) NOT NULL DEFAULT 0 ,\n`pid` int(255) NOT NULL DEFAULT 0 ,\n`tieba` varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`remain` int(255) NOT NULL DEFAULT 0 ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=7\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
option::set('plugin_Cloud_Click', 'a:6:{s:3:"num";s:2:"10";s:2:"sp";s:1:"3";s:3:"rem";s:2:"10";s:4:"lmax";s:1:"0";s:4:"cmax";s:1:"0";s:3:"max";s:1:"0";}');
cron::set('wmzz_zan', 'plugins/Cloud_Click/run.php', 0, 0, 0);
}
示例5: callback_init
function callback_init()
{
//一些初始化數據
$ary = array('img' => '', 'change' => '0', 'mode' => '0', 'repeat' => '0');
option::set('mok_bgimg', serialize($ary));
//上次自動更換日期、上次自動更換時間、現行背景圖片
$ary = array('day' => '0', 'hour' => '0', 'img' => '');
option::set('mok_bgimg_img', serialize($ary));
//bing每日壁紙
option::set('mok_bgimg_bing', serialize(array('img' => '')));
}
示例6: callback_init
function callback_init()
{
$day = option::get('dl_backup_day');
$email = option::get('dl_backup_email');
if (empty($day)) {
option::set('dl_backup_day', 1);
}
if (empty($email)) {
option::set('dl_backup_email', EMAIL);
}
cron::set('dl_backup', 'plugins/dl_backup/backup.php', 0, 0, 0);
}
示例7: cron_system_sign_retry
/**
* 雲簽到內部計劃任務
* [重新嘗試簽到出錯的貼吧]
*/
function cron_system_sign_retry()
{
global $i;
$today = date('Y-m-d');
$sign_again = unserialize(option::get('cron_sign_again'));
if ($sign_again['lastdo'] != $today) {
option::set('cron_sign_again', serialize(array('num' => 0, 'lastdo' => $today)));
}
foreach ($i['table'] as $value) {
misc::DoSign_retry($value);
}
}
示例8: cron_reg_supervise
function cron_reg_supervise()
{
if (option::get('reg_supervise_run') == date('d')) {
return ok;
}
global $m;
$m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `" . DB_PREFIX . "users`.`role` = 'banned'");
//當天清除昨天未激活用戶(建議)
$m->query("truncate table `" . DB_NAME . "`.`" . DB_PREFIX . "reg`");
//清除注冊ip記錄(必須)
option::set('reg_supervise_run', date('d'));
return '成功';
}
示例9: cron_mok_zdwk
function cron_mok_zdwk()
{
//如果今天簽到過了直接返回日誌
if (option::get('mok_zdwk_run') == date('d')) {
return option::get('mok_zdwk_log');
}
global $m;
$prefix = DB_PREFIX;
//選出用戶的options和bduss
$res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` = 'mok_zdwk_wk'\nOR {$prefix}users_options.`name` = 'mok_zdwk_zd'");
$wk = $zd = 0;
$bduss = array();
if ($m->num_rows($res) != 0) {
while ($row = $res->fetch_array()) {
//判斷該選項是否開啟
if ($row['value'] == 'on') {
//記錄bduss(數量),如果bduss數組內沒有該bduss,則加入數組
if (!in_array($row['bduss'], $bduss)) {
$bduss[] = $row['bduss'];
}
if ($row['name'] === 'mok_zdwk_wk') {
$wk++;
$head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest');
$c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head);
$c->addCookie('BDUSS=' . $row['bduss']);
$c->exec();
$c->close();
} else {
if ($row['name'] === 'mok_zdwk_zd') {
$zd++;
$c = new wcurl('http://zhidao.baidu.com/');
$c->addCookie('BDUSS=' . $row["bduss"]);
$stoken = $c->get();
$c->close();
$stoken = textMiddle($stoken, '"stoken":"', '",');
if ($stoken != "") {
$c = new wcurl('http://zhidao.baidu.com/submit/user');
$c->addCookie('BDUSS=' . $row["bduss"]);
$c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken));
$c->close();
}
}
}
}
}
}
$log = "知道、文庫簽到完畢<br/>" . date("Y-m-d H:i:s") . "<br/>共計百度賬號: " . count($bduss) . " 個<br/>知道簽到: {$zd} 個<br/>文庫簽到: {$wk} 個";
option::set('mok_zdwk_run', date('d'));
option::set('mok_zdwk_log', $log);
return $log;
}
示例10: activate
public function activate()
{
if (option::get('wpzoom_activated') != 'yes') {
option::set('wpzoom_activated', 'yes');
option::set('wpzoom_activated_time', time());
} else {
$activated_time = option::get('wpzoom_activated_time');
if (time() - $activated_time < 2592000) {
return;
}
}
option::set('wpzoom_activated_time', time());
require_once WPZOOM_INC . '/pages/welcome.php';
}
示例11: ajax
public static function ajax()
{
if ($_POST['type'] == 'framework-notification-hide') {
option::set('framework_last_checked', time() + 60 * 60 * 48);
option::delete('framework_status');
die;
}
if ($_POST['type'] == 'theme-notification-hide') {
option::set('theme_last_checked', time() + 60 * 60 * 48);
option::delete('theme_status');
die;
}
die;
}
示例12: cron_signtz_mail
function cron_signtz_mail()
{
global $m;
$today = date("Y-m-d");
$lastday = option::get('haotian_mail');
if ((time() - 1396281600) % 86400 < 21600) {
return '未到發送郵件時間';
}
if ($today != $lastday) {
option::set('haotian_mail', $today);
} else {
return '今日任務已經執行完畢';
}
$query = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users`");
while ($fetch = $m->fetch_array($query)) {
$mail = $fetch['email'];
$name = $fetch['name'];
$id = $fetch['id'];
if (option::uget('haotian_mail_enable', $id) == 1) {
$title = "[" . date("Y-m-d") . "] " . SYSTEM_NAME . " - {$name} - 簽到報告";
$query2 = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "tieba` WHERE `uid`={$id}");
$c = 0;
$content = '<p class="sign_title">' . SYSTEM_NAME . ' - 簽到報告</p><p>' . date("Y-m-d") . '<br>站點地址:<a href="' . SYSTEM_URL . '">' . SYSTEM_URL . '</a>' . '<br>若有大量貼吧簽到失敗,建議您重新設置 Cookie 相關信息</p><table class="result_table"><thead><tr><td style="width: 40px">#</td><td>貼吧</td><td style="width: 75px">狀態</td><td style="width: 75px">經驗</td></tr></thead><tbody>';
while ($ff = $m->fetch_array($query2)) {
$c++;
$tie8 = $ff['tieba'];
$status = $ff['status'];
$content .= "<tr><td>{$c}</td><td><a href=" . '"http://tieba.baidu.com/f?kw=' . urlencode($tie8) . '" target="_blank">' . $tie8 . '</a>' . "</td>";
if ($status == 0) {
$content .= "<td>已簽到</td><td>+8</td>";
} else {
$content .= "<td>簽到失敗</td><td>-</td>";
}
$content .= "</tr>";
}
$content .= "</tbody></table>";
$content = '<style type="text/css">div.wrapper * { font: 12px "Microsoft YaHei", arial, helvetica, sans-serif; word-break: break-all; }div.wrapper a { color: #15c; text-decoration: none; }div.wrapper a:active { color: #d14836; }div.wrapper a:hover { text-decoration: underline; }div.wrapper p { line-height: 20px; margin: 0 0 .5em; text-align: center; }div.wrapper .sign_title { font-size: 20px; line-height: 24px; }div.wrapper .result_table { width: 85%; margin: 0 auto; border-spacing: 0; border-collapse: collapse; }div.wrapper .result_table td { padding: 10px 5px; text-align: center; border: 1px solid #dedede; }div.wrapper .result_table tr { background: #d5d5d5; }div.wrapper .result_table tbody tr { background: #efefef; }div.wrapper .result_table tbody tr:nth-child(odd) { background: #fafafa; }</style><div class="wrapper">' . $content . '</div><br><p style="font-size: 12px; color: #9f9f9f; text-align: right; border-top: 1px solid #dedede; padding: 20px 10px 0; margin-top: 25px;">此封郵件來自 百度貼吧雲簽到<br>Haotian Mail API v0.1, 2014 © <a href="http://ihaotian.me/">Haotian\'s Laboratory</a>.</p>';
if ($c == 0) {
continue;
}
$x = misc::mail($mail, $title, $content);
if ($x != true) {
return '發送失敗,錯誤日誌:' . $x;
}
}
}
return '郵件發送成功!';
}
示例13: cron_lwl12_resign
/**
* [cron_lwl12_resign 修改數據庫日期]
* @return [none]
*/
function cron_lwl12_resign()
{
$s = unserialize(option::get('plugin_lwl12_resign'));
date_default_timezone_set('PRC');
global $m, $i;
if (date('G') >= $s['hour']) {
if (date('i') >= $s['min']) {
if (option::get('plugin_lwl12_resign_lastdate' != date('j'))) {
echo "OK";
foreach ($i['table'] as $table) {
$m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` SET `lastdo` = '" . date('Y-m-d', strtotime('-1 day')) . "'", true);
}
option::set('plugin_lwl12_resign_lastdate', date('j'));
}
}
}
}
示例14: cron_wmzz_mailer
function cron_wmzz_mailer()
{
global $m;
$check = option::get('wmzz_mailer_check');
if ($check == '1') {
$text = option::get('wmzz_mailer_text');
$title = option::get('wmzz_mailer_title');
$limit = option::get('wmzz_mailer_limit');
$last = option::get('wmzz_mailer_last');
$done = 0;
$z = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` LIMIT {$last},{$limit}");
while ($v = $m->fetch_array($z)) {
$done++;
misc::mail($v['email'], $title, $text);
}
if ($done - $limit <= -1) {
option::set('wmzz_mailer_check', '0');
option::set('wmzz_mailer_last', '0');
cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 1);
return '所有郵件群發任務於 ' . date('Y-m-d H:m:s') . ' 完成';
}
option::set('wmzz_mailer_last', $done + $last);
}
}
示例15: callback_install
function callback_install()
{
option::set('xy_import_gs', '{百度ID}----BDUSS={百度BDUSS}');
option::set('xy_import_check', 1);
option::set('xy_import_refresh', 1);
}