• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nv_preg_quote函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cron_dump_autobackup

function cron_dump_autobackup()
{
    global $db, $db_config, $global_config, $client_info;
    $result = true;
    $current_day = mktime(0, 0, 0, date("n", NV_CURRENTTIME), date("j", NV_CURRENTTIME), date("Y", NV_CURRENTTIME));
    $w_day = $current_day - $global_config['dump_backup_day'] * 86400;
    $contents = array();
    $contents['savetype'] = $global_config['dump_backup_ext'] == "sql" ? "sql" : "gz";
    $file_ext = $contents['savetype'] == "sql" ? "sql" : "sql.gz";
    $log_dir = NV_ROOTDIR . "/" . NV_LOGS_DIR . "/dump_backup";
    $contents['filename'] = $log_dir . "/" . md5(nv_genpass(10) . $client_info['session_id']) . "_" . $current_day . "." . $file_ext;
    if (!file_exists($contents['filename'])) {
        $files = scandir($log_dir);
        foreach ($files as $file) {
            unset($mc);
            if (preg_match("/^([a-zA-Z0-9]+)\\_([0-9]+)\\.(" . nv_preg_quote($file_ext) . ")/", $file, $mc)) {
                if (intval($mc[2]) > 0 and intval($mc[2]) < $w_day) {
                    @unlink($log_dir . "/" . $file);
                }
            }
        }
        $contents['tables'] = array();
        $res = $db->sql_query("SHOW TABLES LIKE '" . $db_config['prefix'] . "_%'");
        while ($item = $db->sql_fetchrow($res)) {
            $contents['tables'][] = $item[0];
        }
        $db->sql_freeresult($res);
        $contents['type'] = "all";
        include NV_ROOTDIR . "/includes/core/dump.php";
        if (!nv_dump_save($contents)) {
            $result = false;
        }
    }
    return $result;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:35,代码来源:dump_autobackup.php


示例2: viewdirtree

/**
 * viewdirtree()
 *
 * @param mixed $dir
 * @param mixed $currentpath
 * @return
 */
function viewdirtree($dir, $currentpath)
{
    global $array_dirname, $global_config, $module_file;
    $pattern = !empty($dir) ? '/^(' . nv_preg_quote($dir) . ')\\/([^\\/]+)$/' : '/^([^\\/]+)$/';
    $_dirlist = preg_grep($pattern, array_keys($array_dirname));
    $content = '';
    foreach ($_dirlist as $_dir) {
        $check_allow_upload_dir = nv_check_allow_upload_dir($_dir);
        if (!empty($check_allow_upload_dir)) {
            $class_li = ($_dir == $currentpath or strpos($currentpath, $_dir . '/') !== false) ? 'open collapsable' : 'expandable';
            $style_color = $_dir == $currentpath ? ' style="color:red"' : '';
            $tree = array();
            $tree['class1'] = $class_li;
            $tree['class2'] = nv_set_dir_class($check_allow_upload_dir) . ' pos' . nv_string_to_filename($dir);
            $tree['style'] = $style_color;
            $tree['title'] = $_dir;
            $tree['titlepath'] = basename($_dir);
            $content2 = viewdirtree($_dir, $currentpath);
            $xtpl = new XTemplate('foldlist.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
            $xtpl->assign('DIRTREE', $tree);
            if (empty($content2)) {
                $content2 = '<li class="hide">&nbsp;</li>';
            }
            if (!empty($content2)) {
                $xtpl->assign('TREE_CONTENT', $content2);
                $xtpl->parse('tree.tree_content');
            }
            $xtpl->parse('tree');
            $content .= $xtpl->text('tree');
        }
    }
    return $content;
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:40,代码来源:folderlist.php


示例3: cron_auto_del_temp_download

function cron_auto_del_temp_download()
{
    $dir = NV_ROOTDIR . '/' . NV_TEMP_DIR;
    $result = true;
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            if (preg_match('/^(' . nv_preg_quote(NV_TEMPNAM_PREFIX) . ')[a-zA-Z0-9\\_\\.]+$/', $file)) {
                if (filemtime($dir . '/' . $file) + 600 < NV_CURRENTTIME) {
                    if (is_file($dir . '/' . $file)) {
                        if (!@unlink($dir . '/' . $file)) {
                            $result = false;
                        }
                    } else {
                        $rt = nv_deletefile($dir . '/' . $file, true);
                        if ($rt[0] == 0) {
                            $result = false;
                        }
                    }
                }
            }
        }
        closedir($dh);
        clearstatcache();
    }
    return $result;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:26,代码来源:temp_download_destroy.php


示例4: viewdirtree

/**
 * viewdirtree()
 * 
 * @param mixed $dir
 * @param mixed $currentpath
 * @return
 */
function viewdirtree($dir, $currentpath)
{
    global $dirlist, $global_config, $module_file;
    $pattern = !empty($dir) ? "/^(" . nv_preg_quote($dir) . ")\\/([^\\/]+)\$/" : "/^([^\\/]+)\$/";
    $_dirlist = preg_grep($pattern, $dirlist);
    $content = "";
    foreach ($_dirlist as $_dir) {
        $check_allow_upload_dir = nv_check_allow_upload_dir($_dir);
        if (!empty($check_allow_upload_dir)) {
            $class_li = ($_dir == $currentpath or strpos($currentpath, $_dir . '/') !== false) ? "open collapsable" : "expandable";
            $style_color = $_dir == $currentpath ? ' style="color:red"' : '';
            $tree = array();
            $tree['class1'] = $class_li;
            $tree['class2'] = nv_set_dir_class($check_allow_upload_dir) . " pos" . nv_string_to_filename($dir);
            $tree['style'] = $style_color;
            $tree['title'] = $_dir;
            $tree['titlepath'] = basename($_dir);
            $content2 = viewdirtree($_dir, $currentpath);
            $xtpl = new XTemplate("foldlist.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
            $xtpl->assign("DIRTREE", $tree);
            if (!empty($content2)) {
                $xtpl->assign("TREE_CONTENT", $content2);
                $xtpl->parse('tree.tree_content');
            }
            $xtpl->parse('tree');
            $content .= $xtpl->text('tree');
        }
    }
    return $content;
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:37,代码来源:folderlist.php


示例5: nv_is_myreferer

/**
 * nv_is_myreferer()
 *
 * @param string $referer
 * @return
 */
function nv_is_myreferer($referer = '')
{
    if (empty($referer)) {
        $referer = urldecode(nv_getenv('HTTP_REFERER'));
    }
    if (empty($referer)) {
        return 2;
    }
    $server_name = preg_replace('/^[w]+\\./', '', nv_getenv('HTTP_HOST'));
    $referer = preg_replace(array('/^[a-zA-Z]+\\:\\/\\/([w]+\\.)?/', '/^[w]+\\./'), '', $referer);
    if (preg_match('/^' . nv_preg_quote($server_name) . '/', $referer)) {
        return 1;
    }
    return 0;
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:21,代码来源:functions.php


示例6: cron_auto_del_temp_download

function cron_auto_del_temp_download()
{
    $dir = NV_ROOTDIR . "/" . NV_TEMP_DIR;
    $files = nv_scandir($dir, "/^(" . nv_preg_quote(NV_TEMPNAM_PREFIX) . ")[a-zA-Z0-9\\_\\.]+\$/");
    $result = true;
    if (!empty($files)) {
        foreach ($files as $file) {
            if (filemtime($dir . '/' . $file) + 600 < NV_CURRENTTIME) {
                if (!@unlink($dir . '/' . $file)) {
                    $result = false;
                }
            }
            clearstatcache();
        }
    }
    return $result;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:17,代码来源:temp_download_destroy.php


示例7: cron_dump_autobackup

/**
 * cron_dump_autobackup()
 *
 * @return
 */
function cron_dump_autobackup()
{
    global $db, $db_config, $global_config, $client_info;
    $result = true;
    $current_day = mktime(0, 0, 0, date('n', NV_CURRENTTIME), date('j', NV_CURRENTTIME), date('Y', NV_CURRENTTIME));
    $w_day = $current_day - $global_config['dump_backup_day'] * 86400;
    $contents = array();
    $contents['savetype'] = $global_config['dump_backup_ext'] == 'sql' ? 'sql' : 'gz';
    $file_ext = $contents['savetype'] == 'sql' ? 'sql' : 'sql.gz';
    $log_dir = NV_ROOTDIR . '/' . NV_LOGS_DIR . '/dump_backup';
    $contents['filename'] = $log_dir . '/' . md5(nv_genpass(10) . $client_info['session_id']) . '_' . $current_day . '.' . $file_ext;
    if (!file_exists($contents['filename'])) {
        if ($dh = opendir($log_dir)) {
            while (($file = readdir($dh)) !== false) {
                if (preg_match('/^([a-zA-Z0-9]+)\\_([0-9]+)\\.(' . nv_preg_quote($file_ext) . ')/', $file, $m)) {
                    if (intval($m[2]) > 0 and intval($m[2]) < $w_day) {
                        @unlink($log_dir . '/' . $file);
                    }
                }
            }
            closedir($dh);
            clearstatcache();
        }
        if ($global_config['dump_autobackup']) {
            $contents['tables'] = array();
            $res = $db->query("SHOW TABLES LIKE '" . $db_config['prefix'] . "_%'");
            while ($item = $res->fetch(3)) {
                $contents['tables'][] = $item[0];
            }
            $res->closeCursor();
            $contents['type'] = 'all';
            include NV_ROOTDIR . '/includes/core/dump.php';
            if (!nv_dump_save($contents)) {
                $result = false;
            }
        }
    }
    return $result;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:44,代码来源:dump_autobackup.php


示例8: strlen

        if (isset($request_uri_array[1][0])) {
            $lop = strlen($request_uri_array[0]) + 1;
            $_GET[NV_OP_VARIABLE] = substr($matches[1], $lop);
        }
    }
} elseif (preg_match('/<(.*)s(.*)c(.*)r(.*)i(.*)p(.*)t(.*)>/i', urldecode($request_uri))) {
    header('HTTP/1.1 301 Moved Permanently');
    Header('Location: ' . $base_siteurl);
    die;
} elseif (isset($_GET[NV_OP_VARIABLE])) {
    if (preg_match('/([a-z0-9\\-\\_\\.\\/]+)' . nv_preg_quote($global_config['rewrite_exturl']) . '$/i', $_GET[NV_OP_VARIABLE], $matches)) {
        $_GET[NV_OP_VARIABLE] = $matches[1];
        define('NV_REWRITE_EXTURL', true);
    }
} else {
    if (preg_match('/^(' . $base_siteurl_quote . '([a-z0-9\\-\\_\\.\\/]+)(' . nv_preg_quote($global_config['rewrite_endurl']) . '|' . nv_preg_quote($global_config['rewrite_exturl']) . '))\\?(.*)$/i', $request_uri, $matches)) {
        header('HTTP/1.1 301 Moved Permanently');
        Header('Location: ' . $matches[1]);
        die;
    } elseif (!empty($global_config['rewrite_op_mod']) and preg_match('/^' . $base_siteurl_quote . 'tag\\/([^\'\\?\\&]+)$/i', $request_uri, $matches)) {
        $_GET[NV_NAME_VARIABLE] = $global_config['rewrite_op_mod'];
        $_GET[NV_OP_VARIABLE] = 'tag';
        $_GET['alias'] = urldecode($matches[1]);
    } elseif ($global_config['rewrite_optional'] and preg_match('/^' . $base_siteurl_quote . '([a-z0-9\\-]+)\\/tag\\/([^\'\\?\\&]+)$/i', $request_uri, $matches)) {
        $_GET[NV_NAME_VARIABLE] = $matches[1];
        $_GET[NV_OP_VARIABLE] = 'tag';
        $_GET['alias'] = urldecode($matches[2]);
    } elseif (preg_match('/^' . $base_siteurl_quote . '([a-z]{2}+)\\/([a-z0-9\\-]+)\\/tag\\/([^\'\\?\\&]+)$/i', $request_uri, $matches)) {
        $_GET[NV_LANG_VARIABLE] = $matches[1];
        $_GET[NV_NAME_VARIABLE] = $matches[2];
        $_GET[NV_OP_VARIABLE] = 'tag';
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:request_uri.php


示例9: die

 * @Author VINADES.,JSC ([email protected])
 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 2-2-2010 12:55
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$path = nv_check_path_upload($nv_Request->get_string('path', 'post'));
$check_allow_upload_dir = nv_check_allow_upload_dir($path);
if (!isset($check_allow_upload_dir['delete_dir']) or $check_allow_upload_dir['delete_dir'] !== true) {
    die('ERROR_' . $lang_module['notlevel']);
}
if (empty($path) or $path == NV_UPLOADS_DIR) {
    die('ERROR_' . $lang_module['notlevel']);
}
$d = nv_deletefile(NV_ROOTDIR . '/' . $path, true);
if ($d[0]) {
    if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/([a-z0-9\\-\\_\\/]+)$/i', $path, $m)) {
        @nv_deletefile(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $m[1], true);
    }
    $result = $db->query("SELECT did FROM " . NV_UPLOAD_GLOBALTABLE . "_dir WHERE dirname='" . $path . "' OR dirname LIKE '" . $path . "/%'");
    while (list($did) = $result->fetch(3)) {
        $db->query('DELETE FROM ' . NV_UPLOAD_GLOBALTABLE . '_file WHERE did = ' . $did);
        $db->query('DELETE FROM ' . NV_UPLOAD_GLOBALTABLE . '_dir WHERE did = ' . $did);
    }
    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['deletefolder'], $path, $admin_info['userid']);
    echo 'OK';
} else {
    die('ERROR_' . $d[1]);
}
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:delfolder.php


示例10: nv_get_viewImage

function nv_get_viewImage($fileName)
{
    global $array_thumb_config;
    if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/(([a-z0-9\\-\\_\\/]+\\/)*([a-z0-9\\-\\_\\.]+)(\\.(gif|jpg|jpeg|png)))$/i', $fileName, $m)) {
        $viewFile = NV_FILES_DIR . '/' . $m[1];
        if (file_exists(NV_ROOTDIR . '/' . $viewFile)) {
            $size = @getimagesize(NV_ROOTDIR . '/' . $viewFile);
            return array($viewFile, $size[0], $size[1]);
        } else {
            $m[2] = rtrim($m[2], '/');
            if (isset($array_thumb_config[NV_UPLOADS_DIR . '/' . $m[2]])) {
                $thumb_config = $array_thumb_config[NV_UPLOADS_DIR . '/' . $m[2]];
            } else {
                $thumb_config = $array_thumb_config[''];
                $_arr_path = explode('/', NV_UPLOADS_DIR . '/' . $m[2]);
                while (sizeof($_arr_path) > 1) {
                    array_pop($_arr_path);
                    $_path = implode('/', $_arr_path);
                    if (isset($array_thumb_config[$_path])) {
                        $thumb_config = $array_thumb_config[$_path];
                        break;
                    }
                }
            }
            $viewDir = NV_FILES_DIR;
            if (!empty($m[2])) {
                if (!is_dir(NV_ROOTDIR . '/' . $m[2])) {
                    $e = explode('/', $m[2]);
                    $cp = NV_FILES_DIR;
                    foreach ($e as $p) {
                        if (is_dir(NV_ROOTDIR . '/' . $cp . '/' . $p)) {
                            $viewDir .= '/' . $p;
                        } else {
                            $mk = nv_mkdir(NV_ROOTDIR . '/' . $cp, $p);
                            if ($mk[0] > 0) {
                                $viewDir .= '/' . $p;
                            }
                        }
                        $cp .= '/' . $p;
                    }
                }
            }
            $image = new image(NV_ROOTDIR . '/' . $fileName, NV_MAX_WIDTH, NV_MAX_HEIGHT);
            if ($thumb_config['thumb_type'] == 4) {
                $thumb_width = $thumb_config['thumb_width'];
                $thumb_height = $thumb_config['thumb_height'];
                $maxwh = max($thumb_width, $thumb_height);
                if ($image->fileinfo['width'] > $image->fileinfo['height']) {
                    $thumb_config['thumb_width'] = 0;
                    $thumb_config['thumb_height'] = $maxwh;
                } else {
                    $thumb_config['thumb_width'] = $maxwh;
                    $thumb_config['thumb_height'] = 0;
                }
            }
            $image->resizeXY($thumb_config['thumb_width'], $thumb_config['thumb_height']);
            if ($thumb_config['thumb_type'] == 4) {
                $image->cropFromCenter($thumb_width, $thumb_height);
            }
            $image->save(NV_ROOTDIR . '/' . $viewDir, $m[3] . $m[4], $thumb_config['thumb_quality']);
            $create_Image_info = $image->create_Image_info;
            $error = $image->error;
            $image->close();
            if (empty($error)) {
                return array($viewDir . '/' . basename($create_Image_info['src']), $create_Image_info['width'], $create_Image_info['height']);
            }
        }
    } else {
        $size = @getimagesize(NV_ROOTDIR . '/' . $fileName);
        return array($viewFile, $size[0], $size[1]);
    }
    return false;
}
开发者ID:hongoctrien,项目名称:module_c34to40,代码行数:73,代码来源:news.php


示例11: nv_check_path_upload

/**
 * nv_check_path_upload()
 *
 * @param mixed $path
 * @return
 */
function nv_check_path_upload($path)
{
    global $allow_upload_dir;
    $path = htmlspecialchars(trim($path), ENT_QUOTES);
    $path = rtrim($path, "/");
    if (empty($path)) {
        return "";
    }
    $path = NV_ROOTDIR . "/" . $path;
    if (($path = realpath($path)) === false) {
        return "";
    }
    $path = str_replace("\\", "/", $path);
    $path = str_replace(NV_ROOTDIR . "/", "", $path);
    $result = false;
    foreach ($allow_upload_dir as $dir) {
        $dir = nv_preg_quote($dir);
        if (preg_match("/^" . $dir . "/", $path)) {
            $result = true;
            break;
        }
    }
    if ($result === false) {
        return "";
    }
    return $path;
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:33,代码来源:functions.php


示例12: nv_rewrite_change

/**
 * nv_rewrite_change()
 *
 * @param mixed $rewrite_optional
 * @return
 */
function nv_rewrite_change($array_config_global)
{
    global $sys_info, $lang_module;
    $rewrite_rule = $filename = '';
    $endurl = $array_config_global['rewrite_endurl'] == $array_config_global['rewrite_exturl'] ? nv_preg_quote($array_config_global['rewrite_endurl']) : nv_preg_quote($array_config_global['rewrite_endurl']) . "|" . nv_preg_quote($array_config_global['rewrite_exturl']);
    if ($sys_info['supports_rewrite'] == "rewrite_mode_iis") {
        $filename = NV_ROOTDIR . "/web.config";
        $rulename = 0;
        $rewrite_rule .= "\n";
        $rewrite_rule .= "                <rule name=\"nv_rule_" . ++$rulename . "\">\n";
        $rewrite_rule .= "                    <match url=\"^\" ignoreCase=\"false\" />\n";
        $rewrite_rule .= "                    <conditions>\n";
        $rewrite_rule .= "                    \t\t<add input=\"{REQUEST_FILENAME}\" pattern=\"/robots.txt\$\" />\n";
        $rewrite_rule .= "                    </conditions>\n";
        $rewrite_rule .= "                    <action type=\"Rewrite\" url=\"robots.php?action={HTTP_HOST}\" appendQueryString=\"false\" />\n";
        $rewrite_rule .= "                </rule>\n";
        $rewrite_rule .= "                <rule name=\"nv_rule_" . ++$rulename . "\">\n";
        $rewrite_rule .= "                    <match url=\"^(.*?)Sitemap\\.xml\$\" ignoreCase=\"false\" />\n";
        $rewrite_rule .= "                    <action type=\"Rewrite\" url=\"index.php?" . NV_NAME_VARIABLE . "=SitemapIndex\" appendQueryString=\"false\" />\n";
        $rewrite_rule .= "                </rule>\n";
        $rewrite_rule .= "                <rule name=\"nv_rule_" . ++$rulename . "\">\n";
        $rewrite_rule .= "                    <match url=\"^(.*?)Sitemap\\-([a-z]{2})\\.xml\$\" ignoreCase=\"false\" />\n";
        $rewrite_rule .= "                    <action type=\"Rewrite\" url=\"index.php?" . NV_LANG_VARIABLE . "={R:2}&amp;" . NV_NAME_VARIABLE . "=SitemapIndex\" appendQueryString=\"false\" />\n";
        $rewrite_rule .= "                </rule>\n";
        $rewrite_rule .= "                <rule name=\"nv_rule_" . ++$rulename . "\">\n";
        $rewrite_rule .= "                    <match url=\"^(.*?)Sitemap\\-([a-z]{2})\\.([a-zA-Z0-9-]+)\\.xml\$\" ignoreCase=\"false\" />\n";
        $rewrite_rule .= "                    <action type=\"Rewrite\" url=\"index.php?" . NV_LANG_VARIABLE . "={R:2}&amp;" . NV_NAME_VARIABLE . "={R:3}&amp;" . NV_OP_VARIABLE . "=Sitemap\" appendQueryString=\"false\" />\n";
        $rewrite_rule .= "                </rule>\n";
        if ($sys_info['zlib_support']) {
            $rewrite_rule .= "                <rule name=\"nv_rule_" . ++$rulename . "\">\n";
            $rewrite_rule .= "                    <match url=\"^((?!http(s?)|ftp\\:\\/\\/).*)\\.(css|js)\$\" ignoreCase=\"false\" />\n";
            $rewrite_rule .= "                    <action type=\"Rewrite\" url=\"CJzip.php?file={R:1}.{R:3}\" appendQueryString=\"false\" />\n";
            $rewrite_rule .= "                </rule>\n";
        }
        $rewrite_rule .= "                <rule name=\"nv_rule_rewrite\">\n";
        $rewrite_rule .= "                \t<match url=\"(.*)(" . $endurl . ")\$\" ignoreCase=\"false\" />\n";
        $rewrite_rule .= "                \t<conditions logicalGrouping=\"MatchAll\">\n";
        $rewrite_rule .= "                \t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" negate=\"true\" />\n";
        $rewrite_rule .= "                 \t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" ignoreCase=\"false\" negate=\"true\" />\n";
        $rewrite_rule .= "                \t</conditions>\n";
        $rewrite_rule .= "                \t<action type=\"Rewrite\" url=\"index.php\" />\n";
        $rewrite_rule .= "                </rule>\n";
        $rewrite_rule = nv_rewrite_rule_iis7($rewrite_rule);
    } elseif ($sys_info['supports_rewrite'] == "rewrite_mode_apache") {
        $filename = NV_ROOTDIR . "/.htaccess";
        $htaccess = "";
        $rewrite_rule = "##################################################################################\n";
        $rewrite_rule .= "#nukeviet_rewrite_start //Please do not change the contents of the following lines\n";
        $rewrite_rule .= "##################################################################################\n\n";
        $rewrite_rule .= "#Options +FollowSymLinks\n\n";
        $rewrite_rule .= "<IfModule mod_rewrite.c>\n";
        $rewrite_rule .= "RewriteEngine On\n";
        $rewrite_rule .= "#RewriteBase " . NV_BASE_SITEURL . "\n";
        $rewrite_rule .= "RewriteCond %{REQUEST_FILENAME} /robots.txt\$ [NC]\n";
        $rewrite_rule .= "RewriteRule ^ robots.php?action=%{HTTP_HOST} [L]\n";
        $rewrite_rule .= "RewriteRule ^(.*?)Sitemap\\.xml\$ index.php?" . NV_NAME_VARIABLE . "=SitemapIndex [L]\n";
        $rewrite_rule .= "RewriteRule ^(.*?)Sitemap\\-([a-z]{2})\\.xml\$ index.php?" . NV_LANG_VARIABLE . "=\$2&" . NV_NAME_VARIABLE . "=SitemapIndex [L]\n";
        $rewrite_rule .= "RewriteRule ^(.*?)Sitemap\\-([a-z]{2})\\.([a-zA-Z0-9-]+)\\.xml\$ index.php?" . NV_LANG_VARIABLE . "=\$2&" . NV_NAME_VARIABLE . "=\$3&" . NV_OP_VARIABLE . "=Sitemap [L]\n";
        if ($sys_info['zlib_support']) {
            $rewrite_rule .= "RewriteRule ^((?!http(s?)|ftp\\:\\/\\/).*)\\.(css|js)\$ CJzip.php?file=\$1.\$3 [L]\n";
        }
        $rewrite_rule .= "RewriteCond %{REQUEST_FILENAME} !-f\n";
        $rewrite_rule .= "RewriteCond %{REQUEST_FILENAME} !-d\n";
        $rewrite_rule .= "RewriteRule (.*)(" . $endurl . ")\$ index.php\n";
        $rewrite_rule .= "</IfModule>\n\n";
        $rewrite_rule .= "#nukeviet_rewrite_end\n";
        $rewrite_rule .= "##################################################################################\n\n";
        if (file_exists($filename)) {
            $htaccess = @file_get_contents($filename);
            if (!empty($htaccess)) {
                $htaccess = preg_replace("/[\n]*[\\#]+[\n]+\\#nukeviet\\_rewrite\\_start(.*)\\#nukeviet\\_rewrite\\_end[\n]+[\\#]+[\n]*/s", "\n", $htaccess);
                $htaccess = trim($htaccess);
            }
        }
        $htaccess .= "\n\n" . $rewrite_rule;
        $rewrite_rule = $htaccess;
    }
    $errormess = false;
    if (!empty($filename) and !empty($rewrite_rule)) {
        $savefile = true;
        try {
            file_put_contents($filename, $rewrite_rule, LOCK_EX);
            if (!file_exists($filename) or filesize($filename) == 0) {
                $errormess .= sprintf($lang_module['err_writable'], NV_BASE_SITEURL . $filename);
                $savefile = false;
            }
        } catch (exception $e) {
            $savefile = false;
        }
        if (!$savefile) {
            $errormess .= sprintf($lang_module['err_writable'], NV_BASE_SITEURL . basename($filename));
        }
    }
    return $errormess;
//.........这里部分代码省略.........
开发者ID:atarubi,项目名称:nuke-viet,代码行数:101,代码来源:admin_functions.php


示例13: nv_getFileInfo

/**
 * nv_getFileInfo()
 *
 * @param mixed $pathimg
 * @param mixed $file
 * @return
 */
function nv_getFileInfo($pathimg, $file)
{
    global $array_images, $array_flash, $array_archives, $array_documents;
    clearstatcache();
    unset($matches);
    preg_match("/([a-zA-Z0-9\\.\\-\\_\\s\\(\\)]+)\\.([a-zA-Z0-9]+)\$/", $file, $matches);
    $info = array();
    $info['name'] = $file;
    if (isset($file[17])) {
        $info['name'] = substr($matches[1], 0, 13 - strlen($matches[2])) . '...' . $matches[2];
    }
    $info['ext'] = $matches[2];
    $info['type'] = 'file';
    $stat = @stat(NV_ROOTDIR . '/' . $pathimg . '/' . $file);
    $info['filesize'] = $stat['size'];
    $info['src'] = NV_ASSETS_DIR . '/images/file.gif';
    $info['srcwidth'] = 32;
    $info['srcheight'] = 32;
    $info['size'] = '|';
    $ext = strtolower($matches[2]);
    if (in_array($ext, $array_images)) {
        $size = @getimagesize(NV_ROOTDIR . '/' . $pathimg . '/' . $file);
        $info['type'] = 'image';
        $info['src'] = $pathimg . '/' . $file;
        $info['srcwidth'] = intval($size[0]);
        $info['srcheight'] = intval($size[1]);
        $info['size'] = intval($size[0]) . '|' . intval($size[1]);
        if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/([a-z0-9\\-\\_\\.\\/]+)$/i', $pathimg . '/' . $file, $m)) {
            if (($thub_src = nv_get_viewImage($pathimg . '/' . $file)) !== false) {
                $info['src'] = $thub_src[0];
                $info['srcwidth'] = $thub_src[1];
                $info['srcheight'] = $thub_src[2];
            }
        }
        if ($info['srcwidth'] > 80) {
            $info['srcheight'] = round(80 / $info['srcwidth'] * $info['srcheight']);
            $info['srcwidth'] = 80;
        }
        if ($info['srcheight'] > 80) {
            $info['srcwidth'] = round(80 / $info['srcheight'] * $info['srcwidth']);
            $info['srcheight'] = 80;
        }
    } elseif (in_array($ext, $array_flash)) {
        $info['type'] = 'flash';
        $info['src'] = NV_ASSETS_DIR . '/images/flash.gif';
        if ($matches[2] == 'swf') {
            $size = @getimagesize(NV_ROOTDIR . '/' . $pathimg . '/' . $file);
            if (isset($size, $size[0], $size[1])) {
                $info['size'] = $size[0] . '|' . $size[1];
            }
        }
    } elseif (in_array($ext, $array_archives)) {
        $info['src'] = NV_ASSETS_DIR . '/images/zip.gif';
    } elseif (in_array($ext, $array_documents)) {
        if ($ext == 'doc' or $ext == 'docx') {
            $info['src'] = NV_ASSETS_DIR . '/images/msword.png';
        } elseif ($ext == 'xls' or $ext == 'xlsx') {
            $info['src'] = NV_ASSETS_DIR . '/images/excel.png';
        } elseif ($ext == 'pdf') {
            $info['src'] = NV_ASSETS_DIR . '/images/pdf.png';
        } else {
            $info['src'] = NV_ASSETS_DIR . '/images/doc.gif';
        }
    }
    $info['userid'] = 0;
    $info['mtime'] = $stat['mtime'];
    return $info;
}
开发者ID:nukeviet,项目名称:nukeviet,代码行数:75,代码来源:functions.php


示例14: nv_is_file

/**
 * nv_is_file()
 *
 * @param mixed $filepath
 * @param mixed $folders
 * @return
 */
function nv_is_file($filepath, $folders = array())
{
    if (empty($folders)) {
        $folders = array(NV_UPLOADS_DIR, NV_ASSETS_DIR . '/images');
    } elseif (!is_array($folders)) {
        $folders = array($folders);
    }
    $filepath = htmlspecialchars(trim(NV_DOCUMENT_ROOT . $filepath), ENT_QUOTES);
    $filepath = rtrim($filepath, '/');
    if (empty($filepath)) {
        return false;
    }
    if (($filepath = realpath($filepath)) === false) {
        return false;
    }
    $filepath = str_replace("\\", '/', $filepath);
    $file_exists = 0;
    foreach ($folders as $folder) {
        if (preg_match('/^' . nv_preg_quote(NV_ROOTDIR . '/' . $folder) . '/', $filepath) and is_file($filepath)) {
            $file_exists++;
        }
    }
    return $file_exists > 0 ? true : false;
}
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:filesystem_functions.php


示例15: nv_getextension

}
$newalt = $nv_Request->get_title('newalt', 'post', $newname, 1);
$ext = nv_getextension($file);
$newname = $newname . '.' . $ext;
if ($file != $newname) {
    $newname2 = $newname;
    $i = 1;
    while (file_exists(NV_ROOTDIR . '/' . $path . '/' . $newname2)) {
        $newname2 = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1_' . $i . '\\2', $newname);
        ++$i;
    }
    $newname = $newname2;
    if (!@rename(NV_ROOTDIR . '/' . $path . '/' . $file, NV_ROOTDIR . '/' . $path . '/' . $newname)) {
        die('ERROR_' . $lang_module['errorNotRenameFile']);
    }
    if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/(([a-z0-9\\-\\_\\/]+\\/)*([a-z0-9\\-\\_\\.]+)(\\.(gif|jpg|jpeg|png|bmp)))$/i', $path . '/' . $file, $m)) {
        @nv_deletefile(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $m[1]);
    }
    if (isset($array_dirname[$path])) {
        $info = nv_getFileInfo($path, $newname);
        $sth = $db->prepare("UPDATE " . NV_UPLOAD_GLOBALTABLE . "_file SET name = '" . $info['name'] . "', src = '" . $info['src'] . "', title = '" . $newname . "', alt = :newalt WHERE did = " . $array_dirname[$path] . " AND title = '" . $file . "'");
        $sth->bindParam(':newalt', $newalt, PDO::PARAM_STR);
        $sth->execute();
    }
    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['rename'], $path . '/' . $file . ' -> ' . $path . '/' . $newname, $admin_info['userid']);
} else {
    $sth = $db->prepare("UPDATE " . NV_UPLOAD_GLOBALTABLE . "_file SET alt = :newalt WHERE did = " . $array_dirname[$path] . " AND title = '" . $file . "'");
    $sth->bindParam(':newalt', $newalt, PDO::PARAM_STR);
    $sth->execute();
    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['rename'], $path . '/' . $file . ' -> ' . $path . '/' . $newname, $admin_info['userid']);
}
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:renameimg.php


示例16: VALUES

     $db->sql_query("REPLACE INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', 'timestamp', " . $timestamp . ")");
     nv_save_file_config_global();
 }
 if (in_array('clearsession', $deltype)) {
     $ssDir = NV_ROOTDIR . "/" . NV_SESSION_SAVE_PATH;
     $files = nv_clear_files($ssDir, NV_SESSION_SAVE_PATH);
     foreach ($files as $file) {
         $xtpl->assign('DELFILE', $file);
         $xtpl->parse('main.delfile.loop');
     }
 }
 if (in_array('clearfiletemp', $deltype)) {
     $dir = NV_ROOTDIR . "/" . NV_TEMP_DIR;
     if ($dh = opendir($dir)) {
         while (($file = readdir($dh)) !== false) {
             if (preg_match("/^(" . nv_preg_quote(NV_TEMPNAM_PREFIX) . ")[a-zA-Z0-9\\_\\.]+\$/", $file)) {
                 if (is_file($dir . '/' . $file)) {
                     if (@unlink($dir . '/' . $file)) {
                         $xtpl->assign('DELFILE', NV_TEMP_DIR . '/' . $file);
                         $xtpl->parse('main.delfile.loop');
                     }
                 } else {
                     $rt = nv_deletefile($dir . '/' . $file, true);
                     if ($rt[0] == 1) {
                         $xtpl->assign('DELFILE', NV_TEMP_DIR . '/' . $file);
                         $xtpl->parse('main.delfile.loop');
                     }
                 }
             }
         }
         closedir($dh);
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:clearsystem.php


示例17: BoldKeywordInStr

/**
 * BoldKeywordInStr()
 *
 * @param mixed $str
 * @param mixed $keyword
 * @return
 */
function BoldKeywordInStr($str, $keyword, $logic)
{
    $str = nv_br2nl($str);
    $str = nv_nl2br($str, ' ');
    $str = nv_unhtmlspecialchars(strip_tags(trim($str)));
    $pos = false;
    if ($logic == 'AND') {
        $array_keyword = array($keyword, nv_EncString($keyword));
    } else {
        $keyword .= ' ' . nv_EncString($keyword);
        $array_keyword = explode(' ', $keyword);
        $array_keyword = array_unique($array_keyword);
    }
    foreach ($array_keyword as $k) {
        if (preg_match('/^(.*?)' . nv_preg_quote($k) . '/uis', $str, $matches)) {
            $strlen = nv_strlen($str);
            $kstrlen = nv_strlen($k);
            $residual = $strlen - 300;
            if ($residual > 0) {
                $lstrlen = nv_strlen($matches[1]);
                $rstrlen = $strlen - $lstrlen - $kstrlen;
                $medium = round((300 - $kstrlen) / 2);
                if ($lstrlen <= $medium) {
                    $str = nv_clean60($str, 300);
                } elseif ($rstrlen <= $medium) {
                    $str = nv_substr($str, $residual, 300);
                    $str = nv_substr_clean($str, 'l');
                } else {
                    $str = nv_substr($str, $lstrlen - $medium, $strlen - $lstrlen + $medium);
                    $str = nv_substr($str, 0, 300);
                    $str = nv_substr_clean($str, 'lr');
                }
            }
            $pos = true;
            break;
        }
    }
    if (!$pos) {
        return nv_clean60($str, 300);
    }
    $pattern = array();
    foreach ($array_keyword as $k) {
        $pattern[] = '/(' . nv_preg_quote($k) . ')/uis';
    }
    $str = preg_replace($pattern, '{\\1}', $str);
    $str = str_replace(array('{', '}'), array('<span class="keyword">', '</span>'), $str);
    return $str;
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:55,代码来源:functions.php


示例18: nv_redirect_decrypt

/**
 * nv_redirect_decrypt()
 *
 * @param tring $string
 * @param boolean $insite
 * @return string
 *
 */
function nv_redirect_decrypt($string, $insite = true)
{
    if (empty($string)) {
        return '';
    }
    if (preg_match('/[^a-z0-9\\-\\_\\,]/i', $string)) {
        return '';
    }
    $string = nv_base64_decode($string);
    if (!$string) {
        return '';
    }
    global $crypt;
    $url = $crypt->aes_decrypt($string, NV_CHECK_SESSION);
    if (empty($url)) {
        return '';
    }
    if (preg_match('/^(http|https|ftp|gopher)\\:\\/\\//i', $url)) {
        if ($insite and !preg_match('/^' . nv_preg_quote(NV_MY_DOMAIN) . '/', $url)) {
            return '';
        }
        if (!nv_is_url($url)) {
            return '';
        }
    } elseif (!nv_is_url(NV_MY_DOMAIN . $url)) {
        return '';
    }
    return $url;
}
开发者ID:nukeviet,项目名称:nukeviet,代码行数:37,代码来源:functions.php


示例19: nv_check_bot

/**
 * nv_check_bot()
 *
 * @return
 */
function nv_check_bot()
{
    global $client_info;
    $file_bots = NV_ROOTDIR . "/" . NV_DATADIR . "/bots.config";
    $bots = (file_exists($file_bots) and filesize($file_bots)) ? unserialize(file_get_contents($file_bots)) : array();
    if (empty($bots) and file_exists(NV_ROOTDIR . "/includes/bots.php")) {
        include NV_ROOTDIR . "/includes/bots.php";
    }
    if (empty($bots)) {
        return array();
    }
    foreach ($bots as $name => $values) {
        $is_bot = false;
        if ($values['agent'] and preg_match('#' . str_replace('\\*', '.*?', nv_preg_quote($values['agent'], '#')) . '#i', $client_info['agent'])) {
            $is_bot = true;
        }
        if (!empty($values['ips']) and ($is_bot or !$values['agent'])) {
            $is_bot = false;
            $ips = implode("|", array_map("nv_preg_quote", explode("|", $values['ips'])));
            if (preg_match("/^" . $ips . "/", $client_info['ip'])) {
                $is_bot = true;
            }
        }
        if ($is_bot) {
            return array('name' => $name, 'agent' => $values['agent'], 'ip' => $client_info['ip'], 'allowed' => $values['allowed']);
        }
    }
    return array();
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:34,代码来源:functions.php


示例20: nv_redirect_decrypt

/**
 * nv_redirect_decrypt()
 *
 * @param tring $string
 * @param boolean $insite
 * @return string
 *
 */
function nv_redirect_decrypt($string, $insite = true)
{
    global $global_config, 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nv_redirect_encrypt函数代码示例发布时间:2022-05-15
下一篇:
PHP nv_parse_ini_file函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap