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


PHP emMsg函数代码示例

本文整理汇总了PHP中emMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP emMsg函数的具体用法?PHP emMsg怎么用?PHP emMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了emMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: callback_init

function callback_init()
{
    $Path = EMLOG_ROOT . "/content/plugins/download/";
    $InstallFile = $Path . 'install.php';
    if (is_file($InstallFile) === true) {
        include_once $InstallFile;
        $Check = DownloadMe_Install_Check();
        if ($Check === true) {
            #"安装成功!";
            @rename($InstallFile, $InstallFile . '.Download');
            if (is_file($Path . DOWNLOAD_CACHE_NAME . "_Inc.php") === true) {
                @rename($Path . DOWNLOAD_CACHE_NAME . "_Inc.php", EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . "_Inc.php");
            }
            if (is_file($Path . DOWNLOAD_CACHE_NAME . "_Gip.php") === true) {
                @rename($Path . DOWNLOAD_CACHE_NAME . "_Gip.php", EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . "_Gip.php");
            }
            if (is_file($Path . "Version.php") === true) {
                @unlink($Path . "Version.php");
            }
        }
    } elseif (is_file($InstallFile . '.Download') === true) {
        @rename($InstallFile . '.Download', $InstallFile);
        callback_init();
    } else {
        emMsg('安装文件 ( /content/plugins/download/install.php ) 缺失,请重新下载插件安装包');
    }
    DownloadMe_Up();
    # 写入缓存
}
开发者ID:LockGit,项目名称:emlog,代码行数:29,代码来源:download_callback.php

示例2: getView

 public static function getView($template, $ext = '.php')
 {
     if (!is_dir(TEMPLATE_PATH)) {
         emMsg('当前使用的模板已被删除或损坏,请登录后台更换其他模板。', BLOG_URL . 'admin/template.php');
     }
     return TEMPLATE_PATH . $template . $ext;
 }
开发者ID:MikeCoder,项目名称:mblog,代码行数:7,代码来源:view.php

示例3: __construct

 /**
  * 构造函数
  */
 function __construct()
 {
     if (!function_exists('mysql_connect')) {
         emMsg('服务器PHP不支持MySql数据库');
     }
     if (!($this->conn = @mysql_connect(SAE_MYSQL_HOST_M . ':' . SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS))) {
         switch ($this->geterrno()) {
             case 2005:
                 emMsg("连接数据库失败,数据库地址错误或者数据库服务器不可用");
                 break;
             case 2003:
                 emMsg("连接数据库失败,数据库端口错误");
                 break;
             case 2006:
                 emMsg("连接数据库失败,数据库服务器不可用");
                 break;
             case 1045:
                 emMsg("连接数据库失败,数据库用户名或密码错误");
                 break;
             default:
                 emMsg("连接数据库失败,请检查数据库信息。错误编号:" . $this->geterrno());
                 break;
         }
     }
     if ($this->getMysqlVersion() > '4.1') {
         mysql_query("SET NAMES 'utf8'");
     }
     @mysql_select_db(SAE_MYSQL_DB, $this->conn) or emMsg("连接数据库失败,未找到您填写的数据库");
 }
开发者ID:rsmelody,项目名称:learngit,代码行数:32,代码来源:mysql.php

示例4: query

 /**
  * 发送查询语句
  *
  */
 function query($sql, $ignore_err = FALSE)
 {
     $this->result = @mysql_query($sql, $this->conn);
     $this->queryCount++;
     if (!$ignore_err && !$this->result) {
         emMsg("SQL语句执行错误:{$sql} <br />" . $this->geterror());
     } else {
         return $this->result;
     }
 }
开发者ID:xiaokun123,项目名称:xiaokun_emlog,代码行数:14,代码来源:mysql.php

示例5: getInstance

 public static function getInstance()
 {
     if (class_exists('mysqli', FALSE)) {
         return MySqlii::getInstance();
     } else {
         if (class_exists('mysql', FALSE)) {
             return MySql::getInstance();
         } else {
             emMsg('服务器空间PHP不支持MySql数据库');
         }
     }
 }
开发者ID:flyysr,项目名称:emlog,代码行数:12,代码来源:database.php

示例6: addComment

 function addComment($params)
 {
     $name = isset($_POST['comname']) ? addslashes(trim($_POST['comname'])) : '';
     $content = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : '';
     $mail = isset($_POST['commail']) ? addslashes(trim($_POST['commail'])) : '';
     $url = isset($_POST['comurl']) ? addslashes(trim($_POST['comurl'])) : '';
     $imgcode = isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
     $blogId = isset($_POST['gid']) ? intval($_POST['gid']) : -1;
     $pid = isset($_POST['pid']) ? intval($_POST['pid']) : 0;
     if (ISLOGIN === true) {
         $CACHE = Cache::getInstance();
         $user_cache = $CACHE->readCache('user');
         $name = addslashes($user_cache[UID]['name_orig']);
         $mail = addslashes($user_cache[UID]['mail']);
         $url = addslashes(BLOG_URL);
     }
     if ($url && strncasecmp($url, 'http', 4)) {
         $url = 'http://' . $url;
     }
     doAction('comment_post');
     $Comment_Model = new Comment_Model();
     $Comment_Model->setCommentCookie($name, $mail, $url);
     if ($Comment_Model->isLogCanComment($blogId) === false) {
         emMsg('评论失败:该文章已关闭评论');
     } elseif ($Comment_Model->isCommentExist($blogId, $name, $content) === true) {
         emMsg('评论失败:已存在相同内容评论');
     } elseif (ROLE == ROLE_VISITOR && $Comment_Model->isCommentTooFast() === true) {
         emMsg('评论失败:您提交评论的速度太快了,请稍后再发表评论');
     } elseif (empty($name)) {
         emMsg('评论失败:请填写姓名');
     } elseif (strlen($name) > 20) {
         emMsg('评论失败:姓名不符合规范');
     } elseif ($mail != '' && !checkMail($mail)) {
         emMsg('评论失败:邮件地址不符合规范');
     } elseif (ISLOGIN == false && $Comment_Model->isNameAndMailValid($name, $mail) === false) {
         emMsg('评论失败:禁止使用管理员昵称或邮箱评论');
     } elseif (!empty($url) && preg_match("/^(http|https)\\:\\/\\/[^<>'\"]*\$/", $url) == false) {
         emMsg('评论失败:主页地址不符合规范', 'javascript:history.back(-1);');
     } elseif (empty($content)) {
         emMsg('评论失败:请填写评论内容');
     } elseif (strlen($content) > 8000) {
         emMsg('评论失败:内容不符合规范');
     } elseif (ROLE == ROLE_VISITOR && Option::get('comment_needchinese') == 'y' && !preg_match('/[\\x{4e00}-\\x{9fa5}]/iu', $content)) {
         emMsg('评论失败:评论内容需包含中文');
     } elseif (ISLOGIN == false && Option::get('comment_code') == 'y' && session_start() && (empty($imgcode) || $imgcode !== $_SESSION['code'])) {
         emMsg('评论失败:验证码错误');
     } else {
         $_SESSION['code'] = null;
         $Comment_Model->addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid);
     }
 }
开发者ID:flyysr,项目名称:emlog,代码行数:51,代码来源:comment_controller.php

示例7: delTwitter

 function delTwitter($tid)
 {
     $author = ROLE == ROLE_ADMIN ? '' : 'and author=' . UID;
     $query = $this->db->query("select img from " . DB_PREFIX . "twitter where id={$tid} {$author}");
     $row = $this->db->fetch_array($query);
     // del tw
     $this->db->query("DELETE FROM " . DB_PREFIX . "twitter where id={$tid} {$author}");
     if ($this->db->affected_rows() < 1) {
         emMsg('权限不足!', './');
     }
     // del reply
     $this->db->query("DELETE FROM " . DB_PREFIX . "reply where tid={$tid}");
     // del pic
     if (!empty($row['img'])) {
         $fpath = str_replace('thum-', '', $row['img']);
         if ($fpath != $row['img']) {
             @unlink('../' . $fpath);
         }
         @unlink('../' . $row['img']);
     }
 }
开发者ID:MikeCoder,项目名称:mblog,代码行数:21,代码来源:twitter_model.php

示例8: plugin_setting_view

function plugin_setting_view()
{
    if (!is_writable(EMLOG_ROOT . '/content/templates')) {
        emMsg('主题文件不可写。如果您使用的是Unix/Linux主机,请修改主题目录 (content/templates) 下所有文件的权限为777。如果您使用的是Windows主机,请联系管理员,将该目录下所有文件设为everyone可写');
    }
    $themeName = isset($_GET['themeName']) ? $_GET['themeName'] : THEMESEDITOR_CTHEME;
    $themeseditor_theme_list = getThemsList();
    $themeseditor_theme_files = getThemFileList($themeName);
    if (isset($_GET['themeFileName']) && isset($_GET['themeName'])) {
        $themeFileName = $_GET['themeFileName'];
    } elseif (isset($_GET['themeName'])) {
        $themeFileName = $themeseditor_theme_files[0];
    } else {
        $themeFileName = THEMESEDITOR_CFILE;
    }
    if (isset($_GET['themeFileName'])) {
        themeseditor_setting_config($themeName, $themeFileName, null);
    }
    $themeseditor_theme_content = getThemFileContent($themeName, $themeFileName);
    $mode = getEditorMode($themeName, $themeFileName);
    include EMLOG_ROOT . '/content/plugins/themeseditor/themeseditor_setting_view.php';
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:22,代码来源:themeseditor_setting.php

示例9: preg_replace

    $pludir = preg_replace("/^([^\\/]+)\\/.*/", "\$1", $plugin);
    if (true === emDeleteFile('../content/plugins/' . $pludir)) {
        $CACHE->updateCache('options');
        emDirect("./plugin.php?activate_del=1");
    } else {
        emDirect("./plugin.php?error_a=1");
    }
}
//上传zip插件
if ($action == 'upload_zip') {
    $zipfile = isset($_FILES['pluzip']) ? $_FILES['pluzip'] : '';
    if ($zipfile['error'] == 4) {
        emDirect("./plugin.php?action=install&error_d=1");
    }
    if (!$zipfile || $zipfile['error'] >= 1 || empty($zipfile['tmp_name'])) {
        emMsg('插件上传失败');
    }
    if (getFileSuffix($zipfile['name']) != 'zip') {
        emDirect("./plugin.php?action=install&error_a=1");
    }
    $ret = emUnZip($zipfile['tmp_name'], '../content/plugins/', 'plugin');
    switch ($ret) {
        case 0:
            emDirect("./plugin.php?activate_install=1#tpllib");
            break;
        case -1:
            emDirect("./plugin.php?action=install&error_e=1");
            break;
        case 1:
        case 2:
            emDirect("./plugin.php?action=install&error_b=1");
开发者ID:szshenjian,项目名称:JIEWU,代码行数:31,代码来源:plugin.php

示例10: PasswordHash

    //密码加密存储
    $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) {
        $result .= '<p style="color:red;margin:10px 20px;">警告:请手动删除根目录下安装文件:install.php</p> ';
    }
    $result .= "<p style=\"text-align:right;\"><a href=\"./\">访问首页</a> | <a href=\"./admin/\">登录后台</a></p>";
    emMsg($result, 'none');
}
开发者ID:LockGit,项目名称:emlog,代码行数:31,代码来源:install.php

示例11: emFecthFile

    }
    $DB = Database::getInstance();
    $setchar = $DB->getMysqlVersion() > '4.1' ? "ALTER DATABASE `" . DB_NAME . "` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" : '';
    $temp_file = emFecthFile(OFFICIAL_SERVICE_HOST . $upsql);
    if (!$temp_file) {
        exit('error_down');
    }
    $sql = file($temp_file);
    @unlink($temp_file);
    array_unshift($sql, $setchar);
    $query = '';
    foreach ($sql as $value) {
        if (!$value || $value[0] == '#') {
            continue;
        }
        $value = str_replace("{db_prefix}", DB_PREFIX, trim($value));
        if (preg_match("/\\;\$/i", $value)) {
            $query .= $value;
            $DB->query($query);
            $query = '';
        } else {
            $query .= $value;
        }
    }
    $CACHE->updateCache();
    exit('succ');
}
//phpinfo()
if ($action == 'phpinfo') {
    @phpinfo() or emMsg("phpinfo函数被禁用!");
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:index.php

示例12: checkToken

 /**
  * 检查token,防御CSRF攻击
  */
 public static function checkToken()
 {
     $token = isset($_REQUEST['token']) ? addslashes($_REQUEST['token']) : '';
     if ($token != self::genToken()) {
         emMsg('权限不足,token error');
     }
 }
开发者ID:MikeCoder,项目名称:mblog,代码行数:10,代码来源:loginauth.php

示例13: define

/**
 * 手机版本
 *
 * @copyright (c) Emlog All Rights Reserved
 */
require_once '../init.php';
define('TEMPLATE_PATH', EMLOG_ROOT . '/m/view/');
$isgzipenable = 'n';
//手机浏览关闭gzip压缩
$index_lognum = 5;
$site_title = Option::get('blogname');
$logid = isset($_GET['post']) ? intval($_GET['post']) : '';
$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';
if (Option::get('ismobile') == 'n') {
    emMsg('站点未开启手机访问', BLOG_URL);
}
$navi_cache = $CACHE->readCache('navi');
$user_cache = $CACHE->readCache('user');
// 首页
if (empty($action) && empty($logid)) {
    $Log_Model = new Log_Model();
    $page = isset($_GET['page']) ? abs(intval($_GET['page'])) : 1;
    $sqlSegment = "ORDER BY top DESC ,date DESC";
    $sta_cache = $CACHE->readCache('sta');
    $lognum = $sta_cache['lognum'];
    $pageurl = './?page=';
    $logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
    $page_url = pagination($lognum, $index_lognum, $page, $pageurl);
    include View::getView('header');
    include View::getView('log');
开发者ID:LockGit,项目名称:emlog,代码行数:30,代码来源:index.php

示例14: isset

//安装模板
if ($action == 'install') {
    include View::getView('header');
    require_once View::getView('template_install');
    include View::getView('footer');
    View::output();
}
//上传zip模板
if ($action == 'upload_zip') {
    LoginAuth::checkToken();
    $zipfile = isset($_FILES['tplzip']) ? $_FILES['tplzip'] : '';
    if ($zipfile['error'] == 4) {
        emDirect("./template.php?action=install&error_d=1");
    }
    if (!$zipfile || $zipfile['error'] >= 1 || empty($zipfile['tmp_name'])) {
        emMsg('模板上传失败');
    }
    if (getFileSuffix($zipfile['name']) != 'zip') {
        emDirect("./template.php?action=install&error_a=1");
    }
    $ret = emUnZip($zipfile['tmp_name'], '../content/templates/', 'tpl');
    switch ($ret) {
        case 0:
            emDirect("./template.php?activate_install=1#tpllib");
            break;
        case -2:
            emDirect("./template.php?action=install&error_e=1");
            break;
        case 1:
        case 2:
            emDirect("./template.php?action=install&error_b=1");
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:template.php

示例15: emDirect

            $CACHE->updateCache(array('sort', 'logsort'));
            emDirect("./admin_log.php?active_move=1");
            break;
        case 'change_author':
            if (ROLE != ROLE_ADMIN) {
                emMsg('权限不足!', './');
            }
            foreach ($logs as $val) {
                $Log_Model->updateLog(array('author' => $author), $val);
            }
            $CACHE->updateCache('sta');
            emDirect("./admin_log.php?active_change_author=1");
            break;
        case 'check':
            if (ROLE != ROLE_ADMIN) {
                emMsg('权限不足!', './');
            }
            $Log_Model->checkSwitch($gid, 'y');
            $CACHE->updateCache();
            emDirect("./admin_log.php?active_ck=1");
            break;
        case 'uncheck':
            if (ROLE != ROLE_ADMIN) {
                emMsg('权限不足!', './');
            }
            $Log_Model->checkSwitch($gid, 'n');
            $CACHE->updateCache();
            emDirect("./admin_log.php?active_unck=1");
            break;
    }
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:admin_log.php


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