本文整理汇总了PHP中Option::getWidgetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::getWidgetTitle方法的具体用法?PHP Option::getWidgetTitle怎么用?PHP Option::getWidgetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::getWidgetTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
Option::updateOption("widgets{$i}", $widgets_str);
}
}
unset($custom_widget[$rmwg]);
$custom_widget_str = addslashes(serialize($custom_widget));
Option::updateOption('custom_widget', $custom_widget_str);
}
break;
}
$CACHE->updateCache('options');
emDirect("./widgets.php?activated=1");
}
//保存组件排序
if ($action == 'compages') {
$wgNum = isset($_POST['wgnum']) ? intval($_POST['wgnum']) : 1;
//侧边栏编号 1、2、3 ……
$widgets = isset($_POST['widgets']) ? serialize($_POST['widgets']) : '';
Option::updateOption("widgets{$wgNum}", $widgets);
$CACHE->updateCache('options');
emDirect("./widgets.php?activated=true&wg={$wgNum}");
}
//恢复组件设置到初始安装状态
if ($action == 'reset') {
$widget_title = serialize(Option::getWidgetTitle());
$default_widget = serialize(Option::getDefWidget());
Option::updateOption("widget_title", $widget_title);
Option::updateOption("custom_widget", 'a:0:{}');
Option::updateOption("widgets1", $default_widget);
$CACHE->updateCache('options');
emDirect("./widgets.php?activated=1");
}
示例2: emMsg
$fp = @fopen('config.php', 'w');
$fw = @fwrite($fp, $config);
if (!$fw) {
emMsg('配置文件(config.php)不可写。如果您使用的是Unix/Linux主机,请修改该文件的权限为777。如果您使用的是Windows主机,请联系管理员,将此文件设为可写');
}
fclose($fp);
//密码加密存储
$PHPASS = new PasswordHash(8, true);
$adminpw = $PHPASS->HashPassword($adminpw);
$dbcharset = 'utf8';
$type = 'MYISAM';
$table_charset_sql = $DB->getMysqlVersion() > '4.1' ? 'ENGINE=' . $type . ' DEFAULT CHARSET=' . $dbcharset . ';' : 'ENGINE=' . $type . ';';
if ($DB->getMysqlVersion() > '4.1') {
$DB->query("ALTER DATABASE `{$db_name}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;", true);
}
$widgets = Option::getWidgetTitle();
$sider_wg = Option::getDefWidget();
$widget_title = serialize($widgets);
$widgets = serialize($sider_wg);
define('BLOG_URL', getBlogUrl());
$sql = "\nDROP TABLE IF EXISTS {$db_prefix}blog;\nCREATE TABLE {$db_prefix}blog (\n gid int(10) unsigned NOT NULL auto_increment,\n title varchar(255) NOT NULL default '',\n date bigint(20) NOT NULL,\n content longtext NOT NULL,\n excerpt longtext NOT NULL,\n alias VARCHAR(200) NOT NULL DEFAULT '',\n author int(10) NOT NULL default '1',\n sortid int(10) NOT NULL default '-1',\n type varchar(20) NOT NULL default 'blog',\n views int(10) unsigned NOT NULL default '0',\n comnum int(10) unsigned NOT NULL default '0',\n attnum int(10) unsigned NOT NULL default '0',\n top enum('n','y') NOT NULL default 'n',\n sortop enum('n','y') NOT NULL default 'n',\n hide enum('n','y') NOT NULL default 'n',\n checked enum('n','y') NOT NULL default 'y',\n allow_remark enum('n','y') NOT NULL default 'y',\n password varchar(255) NOT NULL default '',\n template varchar(255) NOT NULL default '',\n PRIMARY KEY (gid),\n KEY date (date),\n KEY author (author),\n KEY sortid (sortid),\n KEY type (type),\n KEY views (views),\n KEY comnum (comnum),\n KEY hide (hide)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}blog (gid,title,date,content,excerpt,author,views,comnum,attnum,top,sortop,hide,allow_remark,password) VALUES (1, '欢迎使用emlog', '" . time() . "', '恭喜您成功安装了emlog,这是系统自动生成的演示文章。编辑或者删除它,然后开始您的创作吧!', '', 1, 0, 0, 0, 'n', 'n', 'n', 'y', '');\nDROP TABLE IF EXISTS {$db_prefix}attachment;\nCREATE TABLE {$db_prefix}attachment (\n aid int(10) unsigned NOT NULL auto_increment,\n blogid int(10) unsigned NOT NULL default '0',\n filename varchar(255) NOT NULL default '',\n filesize int(10) NOT NULL default '0',\n filepath varchar(255) NOT NULL default '',\n addtime bigint(20) NOT NULL default '0',\n width int(10) NOT NULL default '0',\n height int(10) NOT NULL default '0',\n mimetype varchar(40) NOT NULL default '',\n thumfor int(10) NOT NULL default 0,\n PRIMARY KEY (aid),\n KEY blogid (blogid)\n)" . $table_charset_sql . "\nDROP TABLE IF EXISTS {$db_prefix}comment;\nCREATE TABLE {$db_prefix}comment (\n cid int(10) unsigned NOT NULL auto_increment,\n gid int(10) unsigned NOT NULL default '0',\n pid int(10) unsigned NOT NULL default '0',\n date bigint(20) NOT NULL,\n poster varchar(20) NOT NULL default '',\n comment text NOT NULL,\n mail varchar(60) NOT NULL default '',\n url varchar(75) NOT NULL default '',\n ip varchar(128) NOT NULL default '',\n hide enum('n','y') NOT NULL default 'n',\n PRIMARY KEY (cid),\n KEY gid (gid),\n KEY date (date),\n KEY hide (hide)\n)" . $table_charset_sql . "\nDROP TABLE IF EXISTS {$db_prefix}options;\nCREATE TABLE {$db_prefix}options (\noption_id INT( 11 ) UNSIGNED NOT NULL auto_increment,\noption_name VARCHAR( 255 ) NOT NULL ,\noption_value LONGTEXT NOT NULL ,\nPRIMARY KEY (option_id),\nKEY option_name (option_name)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('blogname','点滴记忆');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('bloginfo','使用emlog搭建的站点');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('site_title','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('site_description','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('site_key','emlog');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('log_title_style','0');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('blogurl','" . BLOG_URL . "');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('icp','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('footer_info','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('admin_perpage_num','15');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('rss_output_num','0');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('rss_output_fulltext','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_lognum','10');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_comnum','10');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_twnum','10');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_newtwnum','5');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_newlognum','5');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_randlognum','5');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('index_hotlognum','5');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_subnum','20');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('nonce_templet','default');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('admin_style','default');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('tpl_sidenum','1');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_code','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_needchinese','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_interval',60);\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isgravatar','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isthumbnail','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('att_maxsize','20480');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('att_type','rar,zip,gif,jpg,jpeg,png,txt,pdf,docx,doc,xls,xlsx');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('att_imgmaxw','420');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('att_imgmaxh','460');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_paging','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_pnum','10');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('comment_order','newer');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('login_code','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('reply_code','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('iscomment','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('ischkcomment','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('ischkreply','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isurlrewrite','0');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isalias','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isalias_html','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isgzipenable','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isxmlrpcenable','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('ismobile','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('isexcerpt','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('excerpt_subnum','300');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('istwitter','y');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('istreply','n');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('topimg','content/templates/default/images/top/default.jpg');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('custom_topimgs','a:0:{}');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('timezone','8');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('active_plugins','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('widget_title','{$widget_title}');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('custom_widget','a:0:{}');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('widgets1','{$widgets}');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('widgets2','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('widgets3','');\nINSERT INTO {$db_prefix}options (option_name, option_value) VALUES ('widgets4','');\nDROP TABLE IF EXISTS {$db_prefix}link;\nCREATE TABLE {$db_prefix}link (\n id int(10) unsigned NOT NULL auto_increment,\n sitename varchar(30) NOT NULL default '',\n siteurl varchar(75) NOT NULL default '',\n description varchar(255) NOT NULL default '',\n hide enum('n','y') NOT NULL default 'n',\n taxis int(10) unsigned NOT NULL default '0',\n PRIMARY KEY (id)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}link (id, sitename, siteurl, description, taxis) VALUES (1, 'emlog', 'http://www.emlog.net', 'emlog官方主页', 0);\nDROP TABLE IF EXISTS {$db_prefix}navi;\nCREATE TABLE {$db_prefix}navi (\n id int(10) unsigned NOT NULL auto_increment,\n naviname varchar(30) NOT NULL default '',\n url varchar(75) NOT NULL default '',\n newtab enum('n','y') NOT NULL default 'n',\n hide enum('n','y') NOT NULL default 'n',\n taxis int(10) unsigned NOT NULL default '0',\n pid int(10) unsigned NOT NULL default '0',\n isdefault enum('n','y') NOT NULL default 'n',\n type tinyint(3) unsigned NOT NULL default '0',\n type_id int(10) unsigned NOT NULL default '0',\n PRIMARY KEY (id)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}navi (id, naviname, url, taxis, isdefault, type) VALUES (1, '首页', '', 1, 'y', 1);\nINSERT INTO {$db_prefix}navi (id, naviname, url, taxis, isdefault, type) VALUES (2, '微语', 't', 2, 'y', 2);\nINSERT INTO {$db_prefix}navi (id, naviname, url, taxis, isdefault, type) VALUES (3, '登录', 'admin', 3, 'y', 3);\nDROP TABLE IF EXISTS {$db_prefix}tag;\nCREATE TABLE {$db_prefix}tag (\n tid int(10) unsigned NOT NULL auto_increment,\n tagname varchar(60) NOT NULL default '',\n gid text NOT NULL,\n PRIMARY KEY (tid),\n KEY tagname (tagname)\n)" . $table_charset_sql . "\nDROP TABLE IF EXISTS {$db_prefix}sort;\nCREATE TABLE {$db_prefix}sort (\n sid int(10) unsigned NOT NULL auto_increment,\n sortname varchar(255) NOT NULL default '',\n alias VARCHAR(200) NOT NULL DEFAULT '',\n taxis int(10) unsigned NOT NULL default '0',\n pid int(10) unsigned NOT NULL default '0',\n description text NOT NULL,\n template varchar(255) NOT NULL default '',\n PRIMARY KEY (sid)\n)" . $table_charset_sql . "\nDROP TABLE IF EXISTS {$db_prefix}twitter;\nCREATE TABLE {$db_prefix}twitter (\nid INT NOT NULL AUTO_INCREMENT,\ncontent text NOT NULL,\nimg varchar(200) DEFAULT NULL,\nauthor int(10) NOT NULL default '1',\ndate bigint(20) NOT NULL,\nreplynum int(10) unsigned NOT NULL default '0',\nPRIMARY KEY (id),\nKEY author (author)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}twitter (id, content, img, author, date, replynum) VALUES (1, '使用微语记录您身边的新鲜事', '', 1, '" . time() . "', 0);\nDROP TABLE IF EXISTS {$db_prefix}reply;\nCREATE TABLE {$db_prefix}reply (\n id int(10) unsigned NOT NULL auto_increment,\n tid int(10) unsigned NOT NULL default '0',\n date bigint(20) NOT NULL,\n name varchar(20) NOT NULL default '',\n content text NOT NULL,\n hide enum('n','y') NOT NULL default 'n',\n ip varchar(128) NOT NULL default '',\n PRIMARY KEY (id),\n KEY gid (tid),\n KEY hide (hide)\n)" . $table_charset_sql . "\nDROP TABLE IF EXISTS {$db_prefix}user;\nCREATE TABLE {$db_prefix}user (\n uid int(10) unsigned NOT NULL auto_increment,\n username varchar(32) NOT NULL default '',\n password varchar(64) NOT NULL default '',\n nickname varchar(20) NOT NULL default '',\n role varchar(60) NOT NULL default '',\n ischeck enum('n','y') NOT NULL default 'n',\n photo varchar(255) NOT NULL default '',\n email varchar(60) NOT NULL default '',\n description varchar(255) NOT NULL default '',\nPRIMARY KEY (uid),\nKEY username (username)\n)" . $table_charset_sql . "\nINSERT INTO {$db_prefix}user (uid, username, password, role) VALUES (1,'{$admin}','" . $adminpw . "','admin');";
$array_sql = preg_split("/;[\r\n]/", $sql);
foreach ($array_sql as $sql) {
$sql = trim($sql);
if ($sql) {
$DB->query($sql);
}
}
//重建缓存
$CACHE->updateCache();
$result .= "\n\t\t<p style=\"font-size:24px; border-bottom:1px solid #E6E6E6; padding:10px 0px;\">恭喜,安装成功!</p>\n\t\t<p>您的emlog已经安装好了,现在可以开始您的创作了,就这么简单!</p>\n\t\t<p><b>用户名</b>:{$admin}</p>\n\t\t<p><b>密 码</b>:您刚才设定的密码</p>";