当前位置: 首页>>代码示例>>PHP>>正文


PHP option::set方法代码示例

本文整理汇总了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'));
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:31,代码来源:theme-updater.php

示例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);
}
开发者ID:chajianku,项目名称:wmzz_ban,代码行数:7,代码来源:wmzz_ban_callback.php

示例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);
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:8,代码来源:wmzz_mailer_callback.php

示例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);
}
开发者ID:chajianku,项目名称:Cloud_Click,代码行数:8,代码来源:Cloud_Click_callback.php

示例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' => '')));
}
开发者ID:chajianku,项目名称:mok_bgimg,代码行数:11,代码来源:mok_bgimg_callback.php

示例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);
}
开发者ID:MoeGakuen,项目名称:dl_backup,代码行数:12,代码来源:dl_backup_callback.php

示例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);
    }
}
开发者ID:pixode,项目名称:Tieba-Cloud-Sign,代码行数:16,代码来源:cron_system_sign_retry.php

示例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 '成功';
}
开发者ID:chajianku,项目名称:reg_supervise,代码行数:13,代码来源:reg_supervise_cron.php

示例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;
}
开发者ID:chajianku,项目名称:mok_zdwk,代码行数:51,代码来源:mok_zdwk_cron.php

示例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';
 }
开发者ID:Bobcatou,项目名称:thenewreaganvision,代码行数:14,代码来源:admin.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;
 }
开发者ID:siriuzwhite,项目名称:alpha,代码行数:14,代码来源:updater.php

示例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 &copy; <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 '邮件发送成功!';
}
开发者ID:chajianku,项目名称:haotian_signtz,代码行数:48,代码来源:send.php

示例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'));
            }
        }
    }
}
开发者ID:chajianku,项目名称:lwl12_resign,代码行数:21,代码来源:lwl12_resign_cron.php

示例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);
    }
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:24,代码来源:wmzz_mailer_cron.php

示例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);
}
开发者ID:MoeGakuen,项目名称:xy_import,代码行数:6,代码来源:xy_import_callback.php


注:本文中的option::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。