當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Option::getDefWidget方法代碼示例

本文整理匯總了PHP中Option::getDefWidget方法的典型用法代碼示例。如果您正苦於以下問題:PHP Option::getDefWidget方法的具體用法?PHP Option::getDefWidget怎麽用?PHP Option::getDefWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Option的用法示例。


在下文中一共展示了Option::getDefWidget方法的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");
}
開發者ID:szshenjian,項目名稱:JIEWU,代碼行數:31,代碼來源:widgets.php

示例2: emMsg

 $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>";
 if (DEL_INSTALLER === 1 && !@unlink('./install.php') || DEL_INSTALLER === 0) {
開發者ID:LockGit,項目名稱:emlog,代碼行數:31,代碼來源:install.php


注:本文中的Option::getDefWidget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。