本文整理汇总了PHP中option::add方法的典型用法代码示例。如果您正苦于以下问题:PHP option::add方法的具体用法?PHP option::add怎么用?PHP option::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类option
的用法示例。
在下文中一共展示了option::add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callback_init
function callback_init()
{
global $m;
$codedata = '<div class="alert alert-danger" role="alert"><b>错误:</b>未设置多说代码!<a href="index.php?mod=admin:setplug&plug=weirdoga_dscomment">去设置</a></div>';
$titledata = '留言板';
option::add('weirdoga_dscomment_code', $codedata);
option::add('weirdoga_dscomment_title', $titledata);
}
示例2: 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);
}
示例3: callback_init
function callback_init()
{
global $m;
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "weixinArticle` (\r\n`id` int(255) NOT NULL AUTO_INCREMENT ,\r\n`uid` int(255) NOT NULL ,\r\n`cont` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,\r\n`num` int(255) NULL DEFAULT NULL ,\r\n`lastdo` date NOT NULL DEFAULT '0000-00-00' ,\r\nPRIMARY KEY (`id`, `uid`),\r\nUNIQUE INDEX `uid` (`uid`) USING BTREE \r\n)\r\nENGINE=MyISAM\r\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\r\nCHECKSUM=0\r\nROW_FORMAT=DYNAMIC\r\nDELAY_KEY_WRITE=0\r\n;");
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "weixinArticle_data` (\r\n`id` int(255) NOT NULL AUTO_INCREMENT ,\r\n`uid` int(255) NOT NULL DEFAULT 0 ,\r\n`pid` int(255) NOT NULL DEFAULT 0 ,\r\n`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\r\n`status` int(10) NOT NULL DEFAULT 0 ,\r\n`msg` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,\r\n`remain` int(255) NOT NULL DEFAULT 0 ,\r\nPRIMARY KEY (`id`)\r\n)\r\nENGINE=MyISAM\r\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\r\nCHECKSUM=0\r\nROW_FORMAT=DYNAMIC\r\nDELAY_KEY_WRITE=0\r\n;");
cron::set('weixinArticle', 'plugins/weixinArticle/weixinArticle_cron.php', 0, 0, 0);
option::add('plugin_weixinArticle', 'a:7:{s:5:"sleep";s:1:"0";s:4:"lmax";s:1:"0";s:4:"cmax";s:1:"0";s:3:"max";s:1:"0";s:3:"rem";s:1:"5";s:7:"defcont";s:72:"欢迎使用 StusGame 贴吧云灌水
这是一个默认的灌水内容";s:6:"device";s:1:"4";}');
}
示例4: callback_init
function callback_init()
{
global $m;
$data = '<br/><div class="alert alert-info alert-dismissable" style="width:60%;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{$anno}
</div>';
option::add('wmzz_anno_set');
option::add('wmzz_anno_tpl', $data);
option::add('wmzz_anno_doa', 'a:0:{}');
}
示例5: callback_init
function callback_init()
{
option::add('wmzz_ds_code');
}
示例6: define
define('SYSTEM_NO_CHECK_VER', true);
define('SYSTEM_NO_CHECK_LOGIN', true);
define('SYSTEM_NO_PLUGIN', true);
include '../init.php';
global $m, $i;
$cv = option::get('core_version');
if (!empty($cv) && $cv >= '4.0') {
msg('您的云签到已升级到 V4.0 版本,请勿重复更新<br/><br/>请立即删除 /setup/update3.9to4.0.php');
}
//------------------------------------------------//
option::add('toolpw', '');
option::add('sign_scan', '1');
option::add('system_keywords', '贴吧云签到');
option::add('system_description', '贴吧云签到');
option::add('bbs_us', '');
option::add('bbs_pw', '');
$i['tabpart'][] = 'tieba';
foreach ($i['tabpart'] as $value) {
$m->query('ALTER TABLE `' . DB_PREFIX . $value . '`
MODIFY COLUMN `id` int(30) UNSIGNED NOT NULL AUTO_INCREMENT FIRST ,
MODIFY COLUMN `uid` int(30) UNSIGNED NOT NULL AFTER `id`,
MODIFY COLUMN `pid` int(30) UNSIGNED NOT NULL DEFAULT 0 AFTER `uid`,
MODIFY COLUMN `fid` int(30) UNSIGNED NOT NULL DEFAULT 0 AFTER `pid`;
', true);
$m->query('ALTER TABLE `' . DB_PREFIX . $value . '`
DROP COLUMN `lastdo`,
ADD COLUMN `latest` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 AFTER `status`;
', true);
$m->query('ALTER TABLE `' . DB_PREFIX . $value . '`
MODIFY COLUMN `status` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 AFTER `no`;
', true);
示例7: define
<?php
define('SYSTEM_NO_ERROR', true);
define('SYSTEM_NO_CHECK_VER', true);
define('SYSTEM_NO_CHECK_LOGIN', true);
define('SYSTEM_NO_PLUGIN', true);
include '../init.php';
global $m, $i;
$cv = option::get('core_version');
if (!empty($cv) && $cv >= '4.5') {
msg('您的云签到已升级到 V4.5 版本,请勿重复更新<br/><br/>请立即删除 /setup/update4.4to4.5.php');
}
$i['tabpart'][] = 'tieba';
foreach ($i['tabpart'] as $value) {
$m->query('ALTER TABLE `' . DB_PREFIX . $value . '` MODIFY COLUMN `status` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `no`;');
}
option::add('csrf', '0');
option::set('core_version', '4.5');
unlink(__FILE__);
msg('您的云签到已成功升级到 V4.5 版本,请立即删除 /setup/update4.4to4.5.php,谢谢', SYSTEM_URL);
示例8: callback_init
function callback_init()
{
option::add('plugin_wmzz_recaptcha', 'a:2:{s:2:"ak";s:0:"";s:2:"sk";s:0:"";}');
}
示例9: define
define('SYSTEM_NO_CHECK_VER', true);
define('SYSTEM_ONLY_CHECK_LOGIN', true);
define('SYSTEM_NO_PLUGIN', true);
require '../init.php';
global $m;
error_reporting(0);
if (ROLE == 'admin') {
$cv = option::get('core_version');
if (!empty($cv) && $cv >= '3.8') {
msg('您的云签到已升级到 V3.8 版本,请勿重复更新<br/><br/>请立即删除 /setup/update3.45to3.48.php');
}
option::add('core_version', '3.8');
option::add('isapp', '0');
option::add('cron_asyn', '0');
option::add('mail_ssl', '0');
option::add('baidu_name', '1');
option::set('sign_sleep', option::get('sign_sleep') * 1000);
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "plugins` (\r\n`id` int(10) NOT NULL AUTO_INCREMENT ,\r\n`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\r\n`status` tinyint(1) NOT NULL DEFAULT 0 ,\r\n`options` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,\r\nPRIMARY KEY (`id`),\r\nUNIQUE INDEX `name` (`name`) USING BTREE \r\n)\r\nENGINE=MyISAM\r\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\r\nCHECKSUM=0\r\nROW_FORMAT=DYNAMIC\r\nDELAY_KEY_WRITE=0\r\n;");
$plugins = unserialize(option::get('actived_plugins'));
foreach ($plugins as $plug) {
if (isset($i['opt']['plugin_' . $plug])) {
$set = $i['opt']['plugin_' . $plug];
} else {
$set = '';
}
$m->query("INSERT IGNORE INTO `" . DB_NAME . "`.`" . DB_PREFIX . "plugins` (`name`,`status`,`options`) VALUES ('{$plug}','1','{$set}');");
}
$m->query("ALTER TABLE `" . DB_PREFIX . "cron` ADD COLUMN `desc` text NULL AFTER `no`;");
$m->query("ALTER TABLE `" . DB_PREFIX . "cron` DROP COLUMN `status`;", true);
cron::aset('system_sign', array('desc' => '每天对所有贴吧进行签到' . "\n" . '忽略或卸载此任务会导致停止签到'));
cron::add('system_sign_retry', array('orde' => '1', 'file' => 'lib/cron_system_sign_retry.php', 'no' => '0', 'desc' => '对所有签到失败的贴吧进行复签' . "\n" . '忽略或卸载此任务会导致停止复签', 'freq' => '0'));
示例10: callback_init
function callback_init()
{
option::add(salt, getRandStr(10));
}