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


PHP nv_unhtmlspecialchars函数代码示例

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


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

示例1: nv_aleditor

 function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '')
 {
     // Create class instance.
     $editortoolbar = array(array('Link', 'Unlink', 'Image', 'Table', 'Font', 'FontSize', 'RemoveFormat'), array('Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent', 'TextColor', 'BGColor', 'Source'));
     $CKEditor = new CKEditor();
     // Do not print the code directly to the browser, return it instead
     $CKEditor->returnOutput = true;
     $CKEditor->config['skin'] = 'v2';
     $CKEditor->config['entities'] = false;
     //$CKEditor->config['enterMode'] = 2;
     $CKEditor->config['language'] = NV_LANG_INTERFACE;
     $CKEditor->config['toolbar'] = $editortoolbar;
     // Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
     //   $CKEditor->basePath = '/ckeditor/'
     // If not set, CKEditor will try to detect the correct path.
     $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
     // Set global configuration (will be used by all instances of CKEditor).
     if (!empty($width)) {
         $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
     }
     if (!empty($height)) {
         $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
     }
     // Change default textarea attributes
     $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
     $val = nv_unhtmlspecialchars($val);
     return $CKEditor->editor($textareaname, $val);
 }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:28,代码来源:content.php

示例2: nv_aleditor

function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '', $path = '', $currentpath = '')
{
    global $module_name, $admin_info, $client_info;
    if (empty($path) and empty($currentpath)) {
        $path = NV_UPLOADS_DIR;
        $currentpath = NV_UPLOADS_DIR;
        if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
            $currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
            $path = NV_UPLOADS_DIR . '/' . $module_name;
        } elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
            $currentpath = NV_UPLOADS_DIR . '/' . $module_name;
        }
    }
    $CKEditor = new CKEditor();
    $CKEditor->returnOutput = true;
    if (preg_match("/^(Internet Explorer v([0-9])\\.([0-9]))+\$/", $client_info['browser']['name'], $m)) {
        $jwplayer = $m[2] < 8 ? false : true;
    } else {
        $jwplayer = true;
    }
    if ($jwplayer) {
        $CKEditor->config['extraPlugins'] = 'jwplayer';
        $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'jwplayer', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    } else {
        $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    }
    $CKEditor->config['skin'] = 'v2';
    $CKEditor->config['entities'] = false;
    $CKEditor->config['enterMode'] = 2;
    $CKEditor->config['language'] = NV_LANG_INTERFACE;
    $CKEditor->config['toolbar'] = $editortoolbar;
    $CKEditor->config['pasteFromWordRemoveFontStyles'] = true;
    $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
    if (!empty($width)) {
        $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
    }
    if (!empty($height)) {
        $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
    }
    $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
    $CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=image&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=flash&path=" . $path . "&currentpath=" . $currentpath;
    if (!empty($admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&currentpath=" . $currentpath;
    }
    if (in_array('images', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserImageUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&type=image&currentpath=" . $currentpath;
    }
    if (in_array('flash', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserFlashUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&type=flash&currentpath=" . $currentpath;
    }
    $val = nv_unhtmlspecialchars($val);
    return $CKEditor->editor($textareaname, $val);
}
开发者ID:VoDongMy,项目名称:VoDongMy,代码行数:55,代码来源:nv.php

示例3: BoldKeywordInStr

/**
 * BoldKeywordInStr()
 * 
 * @param mixed $str
 * @param mixed $keyword
 * @return
 */
function BoldKeywordInStr($str, $keyword, $logic)
{
    global $db;
    $str = nv_br2nl($str);
    $str = nv_nl2br($str, " ");
    $str = nv_unhtmlspecialchars(strip_tags(trim($str)));
    $str = $db->unfixdb($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) {
        unset($matches);
        if (preg_match("/^(.*?)" . 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[] = "/(" . preg_quote($k) . ")/uis";
    }
    $str = preg_replace($pattern, "{\\1}", $str);
    $str = str_replace(array("{", "}"), array("<span class=\"keyword\">", "</span>"), $str);
    return $str;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:58,代码来源:functions.php

示例4: nv_aleditor

/**
 * nv_aleditor()
 * 
 * @param mixed $textareaname
 * @param string $width
 * @param string $height
 * @param string $val
 * @return
 */
function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '')
{
    global $module_name, $admin_info;
    $currentpath = NV_UPLOADS_DIR;
    $path = NV_UPLOADS_DIR;
    if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
        $currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
        $path = NV_UPLOADS_DIR . '/' . $module_name;
    } elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
        $currentpath = NV_UPLOADS_DIR . '/' . $module_name;
    }
    // Create class instance.
    $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    $CKEditor = new CKEditor();
    // Do not print the code directly to the browser, return it instead
    $CKEditor->returnOutput = true;
    $CKEditor->config['skin'] = 'kama';
    $CKEditor->config['entities'] = false;
    //$CKEditor->config['enterMode'] = 2;
    $CKEditor->config['language'] = NV_LANG_INTERFACE;
    $CKEditor->config['toolbar'] = $editortoolbar;
    // Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
    //   $CKEditor->basePath = '/ckeditor/'
    // If not set, CKEditor will try to detect the correct path.
    $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
    // Set global configuration (will be used by all instances of CKEditor).
    if (!empty($width)) {
        $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
    }
    if (!empty($height)) {
        $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
    }
    // Change default textarea attributes
    $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
    $CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=image&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=flash&path=" . $path . "&currentpath=" . $currentpath;
    if (!empty($admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&currentpath=" . $currentpath;
    }
    if (in_array('images', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserImageUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&type=image&currentpath=" . $currentpath;
    }
    if (in_array('flash', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserFlashUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&type=flash&currentpath=" . $currentpath;
    }
    $val = nv_unhtmlspecialchars($val);
    return $CKEditor->editor($textareaname, $val);
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:58,代码来源:nv.php

示例5: 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

示例6: nv_write_lang_mod_admin

function nv_write_lang_mod_admin($mod, $lang, $arr_new_lang)
{
    global $funname;
    if (!empty($arr_new_lang)) {
        if (file_exists(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php')) {
            $content_lang = file_get_contents(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php');
            $content_lang = trim($content_lang);
            $content_lang = rtrim($content_lang, '?>');
        } else {
            $content_lang = "<?php\n\n";
            $content_lang .= "/**\n";
            $content_lang .= "* @Project NUKEVIET 4.x\n";
            $content_lang .= "* @Author VINADES.,JSC (contact@vinades.vn)\n";
            $content_lang .= "* @Copyright (C) " . date("Y") . " VINADES.,JSC. All rights reserved\n";
            $content_lang .= "* @Language " . $language_array[$dirlang]['name'] . "\n";
            $content_lang .= "* @License CC BY-SA (http://creativecommons.org/licenses/by-sa/4.0/)\n";
            $content_lang .= "* @Createdate " . gmdate("M d, Y, h:i:s A", time()) . "\n";
            $content_lang .= "*/\n";
            $content_lang .= "\nif( ! defined( 'NV_ADMIN' ) or ! defined( 'NV_MAINFILE' ) )";
            $content_lang .= " die( 'Stop!!!' );\n\n";
            $array_translator['info'] = isset($array_translator['info']) ? $array_translator['info'] : "";
            $content_lang .= "\$lang_translator['author'] = 'VINADES.,JSC (contact@vinades.vn)';\n";
            $content_lang .= "\$lang_translator['createdate'] = '" . date('d/m/Y, H:i') . "';\n";
            $content_lang .= "\$lang_translator['copyright'] = 'Copyright (C) ' . date( 'Y' ) . ' VINADES.,JSC. All rights reserved';\n";
            $content_lang .= "\$lang_translator['info'] = '';\n";
            $content_lang .= "\$lang_translator['langtype'] = 'lang_module';\n";
            $content_lang .= "\n";
        }
        $content_lang .= "\n\n//Lang for function " . $funname . "\n";
        foreach ($arr_new_lang as $lang_key => $lang_value) {
            $lang_value = nv_unhtmlspecialchars($lang_value);
            $lang_value = str_replace("\\'", "'", $lang_value);
            $lang_value = str_replace("'", "\\'", $lang_value);
            $lang_value = nv_nl2br($lang_value);
            $lang_value = str_replace('<br />', '<br />', $lang_value);
            $content_lang .= "\$lang_module['" . $lang_key . "'] = '" . $lang_value . "';\n";
        }
        if (!is_writable(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php')) {
            if (substr($sys_info['os'], 0, 3) != 'WIN') {
                chmod(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php', 0777);
            }
        }
        file_put_contents(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php', $content_lang, LOCK_EX);
    }
}
开发者ID:hpleduit,项目名称:module-nvtools,代码行数:45,代码来源:addfun.php

示例7: die

             die('ERROR|' . (empty($ftp->error) ? $lang_module['ftp_error_detect_root'] : (string) $ftp->error));
         }
         $ftp->close();
         die('OK|' . $ftp_root);
     }
     $ftp->close();
     die('ERROR|' . $lang_module['ftp_error_detect_root']);
 }
 if ($nv_Request->isset_request('ftp_server', 'post')) {
     $array_config['ftp_check_login'] = 0;
     if (!empty($array_config['ftp_server']) and !empty($array_config['ftp_user_name']) and !empty($array_config['ftp_user_pass'])) {
         $ftp_server = nv_unhtmlspecialchars($array_config['ftp_server']);
         $ftp_port = intval($array_config['ftp_port']);
         $ftp_user_name = nv_unhtmlspecialchars($array_config['ftp_user_name']);
         $ftp_user_pass = nv_unhtmlspecialchars($array_config['ftp_user_pass']);
         $ftp_path = nv_unhtmlspecialchars($array_config['ftp_path']);
         if (!defined('NV_FTP_CLASS')) {
             require NV_ROOTDIR . '/includes/class/ftp.class.php';
         }
         $ftp = new NVftp($ftp_server, $ftp_user_name, $ftp_user_pass, array('timeout' => 10), $ftp_port);
         if (!empty($ftp->error)) {
             $array_config['ftp_check_login'] = 3;
             $error = (string) $ftp->error;
         } elseif ($ftp->chdir($ftp_path) === false) {
             $array_config['ftp_check_login'] = 2;
             $error = $lang_global['ftp_error_path'];
         } else {
             $check_files = array(NV_CACHEDIR, NV_DATADIR, "images", "includes", "index.php", "js", "language", NV_LOGS_DIR, "mainfile.php", "modules", NV_SESSION_SAVE_PATH, "themes", NV_TEMP_DIR, NV_UPLOADS_DIR);
             $list_files = $ftp->listDetail($ftp_path, 'all');
             $a = 0;
             if (!empty($list_files)) {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:ftp.php

示例8: nv_save_file_config_global


//.........这里部分代码省略.........
    $my_domains[] = NV_SERVER_NAME;
    $config_variable['my_domains'] = implode(',', array_unique($my_domains));
    $config_variable['check_rewrite_file'] = nv_check_rewrite_file();
    $config_variable['allow_request_mods'] = NV_ALLOW_REQUEST_MODS != '' ? NV_ALLOW_REQUEST_MODS : "request";
    $config_variable['request_default_mode'] = NV_REQUEST_DEFAULT_MODE != '' ? trim(NV_REQUEST_DEFAULT_MODE) : 'request';
    $config_variable['session_save_path'] = NV_SESSION_SAVE_PATH;
    $config_variable['log_errors_list'] = NV_LOG_ERRORS_LIST;
    $config_variable['display_errors_list'] = NV_DISPLAY_ERRORS_LIST;
    $config_variable['send_errors_list'] = NV_SEND_ERRORS_LIST;
    $config_variable['error_log_path'] = NV_LOGS_DIR . '/error_logs';
    $config_variable['error_log_filename'] = NV_ERRORLOGS_FILENAME;
    $config_variable['error_log_fileext'] = NV_LOGS_EXT;
    $config_variable['error_send_email'] = $config_variable['error_send_email'];
    $config_name_array = array('file_allowed_ext', 'forbid_extensions', 'forbid_mimes', 'allow_sitelangs', 'openid_servers', 'allow_request_mods', 'config_sso');
    if (empty($config_variable['openid_servers'])) {
        $config_variable['openid_mode'] = 0;
    }
    if ($config_variable['is_user_forum']) {
        $forum_files = @scandir(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet');
        if (!empty($forum_files) and in_array('is_user.php', $forum_files) and in_array('changepass.php', $forum_files) and in_array('editinfo.php', $forum_files) and in_array('login.php', $forum_files) and in_array('logout.php', $forum_files) and in_array('lostpass.php', $forum_files) and in_array('register.php', $forum_files)) {
            $content_config .= "define( 'NV_IS_USER_FORUM', true );\n\n";
        } else {
            $config_variable['is_user_forum'] = 0;
        }
    }
    foreach ($config_variable as $c_config_name => $c_config_value) {
        if ($c_config_name == 'config_sso') {
            $config_sso = empty($c_config_value) ? '' : nv_var_export(unserialize($c_config_value));
            $content_config .= "\$global_config['" . $c_config_name . "']=" . $config_sso . ";\n";
        } elseif (in_array($c_config_name, $config_name_array)) {
            if (!empty($c_config_value)) {
                $c_config_value = "'" . implode("','", array_map("trim", explode(',', $c_config_value))) . "'";
            } else {
                $c_config_value = '';
            }
            $content_config .= "\$global_config['" . $c_config_name . "']=array(" . $c_config_value . ");\n";
        } else {
            if (preg_match('/^\\d+$/', $c_config_value) and $c_config_name != 'facebook_client_id') {
                $content_config .= "\$global_config['" . $c_config_name . "']=" . $c_config_value . ";\n";
            } else {
                $c_config_value = nv_unhtmlspecialchars($c_config_value);
                if (!preg_match("/^[a-z0-9\\-\\_\\.\\,\\;\\:\\@\\/\\s]+\$/i", $c_config_value) and $c_config_name != 'my_domains') {
                    $c_config_value = nv_htmlspecialchars($c_config_value);
                }
                $content_config .= "\$global_config['" . $c_config_name . "']='" . $c_config_value . "';\n";
            }
        }
    }
    $content_config .= "\$global_config['array_theme_type']=" . nv_var_export(array_filter(array_map('trim', explode(',', NV_THEME_TYPE)))) . ";\n";
    //allowed_html_tags
    if (!empty($allowed_html_tags)) {
        $allowed_html_tags = "'" . implode("','", array_map('trim', explode(',', $allowed_html_tags))) . "'";
    } else {
        $allowed_html_tags = '';
    }
    $content_config .= "\$global_config['allowed_html_tags']=array(" . $allowed_html_tags . ");\n";
    //Xac dinh cac search_engine
    $engine_allowed = file_exists(NV_ROOTDIR . '/' . NV_DATADIR . '/search_engine.xml') ? nv_object2array(simplexml_load_file(NV_ROOTDIR . '/' . NV_DATADIR . '/search_engine.xml')) : array();
    $content_config .= "\$global_config['engine_allowed']=" . nv_var_export($engine_allowed) . ";\n";
    $content_config .= "\n";
    $language_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/langs.ini', true);
    $tmp_array = array();
    $lang_array_exit = nv_scandir(NV_ROOTDIR . "/language", "/^[a-z]{2}+\$/");
    foreach ($lang_array_exit as $lang) {
        $tmp_array[$lang] = $language_array[$lang];
    }
    unset($language_array);
    $content_config .= "\$language_array=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/br.ini', true);
    $content_config .= "\$nv_parse_ini_browsers=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/mobile.ini', true);
    $content_config .= "\$nv_parse_ini_mobile=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/os.ini', true);
    $content_config .= "\$nv_parse_ini_os=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/timezone.ini', true);
    $content_config .= "\$nv_parse_ini_timezone=" . nv_var_export($tmp_array) . ";\n";
    $rewrite = array();
    $global_config['rewrite_optional'] = $config_variable['rewrite_optional'];
    $global_config['rewrite_op_mod'] = $config_variable['rewrite_op_mod'];
    $global_config['rewrite_endurl'] = $config_variable['rewrite_endurl'];
    $global_config['rewrite_exturl'] = $config_variable['rewrite_exturl'];
    if ($config_variable['check_rewrite_file']) {
        require NV_ROOTDIR . '/includes/rewrite.php';
    } else {
        require NV_ROOTDIR . '/includes/rewrite_index.php';
    }
    $content_config .= "\n";
    $nv_plugin_area = array();
    $_sql = 'SELECT * FROM ' . $db_config['prefix'] . '_plugin ORDER BY plugin_area ASC, weight ASC';
    $_query = $db->query($_sql);
    while ($row = $_query->fetch()) {
        $nv_plugin_area[$row['plugin_area']][] = $row['plugin_file'];
    }
    $content_config .= "\$nv_plugin_area=" . nv_var_export($nv_plugin_area) . ";\n\n";
    $content_config .= "\$rewrite_keys=" . nv_var_export(array_keys($rewrite)) . ";\n";
    $content_config .= "\$rewrite_values=" . nv_var_export(array_values($rewrite)) . ";\n";
    $return = file_put_contents(NV_ROOTDIR . "/" . NV_DATADIR . "/config_global.php", trim($content_config), LOCK_EX);
    nv_delete_all_cache();
    return $return;
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:101,代码来源:admin_functions.php

示例9: array_intersect

            $in_groups = array_intersect($in_groups, array_keys($groups_list));
            $in_groups_hiden = array_diff($array_old_groups, array_keys($groups_list));
            $in_groups = array_unique(array_merge($in_groups, $in_groups_hiden));
            $in_groups_del = array_diff($array_old_groups, $in_groups);
            if (!empty($in_groups_del)) {
                foreach ($in_groups_del as $gid) {
                    nv_groups_del_user($gid, $userid);
                }
            }
            $in_groups_add = array_diff($in_groups, $array_old_groups);
            if (!empty($in_groups_add)) {
                foreach ($in_groups_add as $gid) {
                    nv_groups_add_user($gid, $userid);
                }
            }
            $db->query("UPDATE " . NV_USERS_GLOBALTABLE . " SET\n\t\t\t\tusername=" . $db->quote($_user['username']) . ",\n\t\t\t\tmd5username='" . nv_md5safe($_user['username']) . "',\n\t\t\t\tpassword=" . $db->quote($password) . ",\n\t\t\t\temail=" . $db->quote($_user['email']) . ",\n\t\t\t\tfirst_name=" . $db->quote($_user['first_name']) . ",\n\t\t\t\tlast_name=" . $db->quote($_user['last_name']) . ",\n\t\t\t\tgender=" . $db->quote($_user['gender']) . ",\n\t\t\t\tphoto=" . $db->quote(nv_unhtmlspecialchars($_user['photo'])) . ",\n\t\t\t\tbirthday=" . $_user['birthday'] . ",\n\t\t\t\tsig=" . $db->quote($_user['sig']) . ",\n\t\t\t\tquestion=" . $db->quote($_user['question']) . ",\n\t\t\t\tanswer=" . $db->quote($_user['answer']) . ",\n\t\t\t\tview_mail=" . $_user['view_mail'] . ",\n\t\t\t\tin_groups='" . implode(',', $in_groups) . "'\n\t\t\t\tWHERE userid=" . $userid);
            if (!empty($array_field_config)) {
                $db->query('UPDATE ' . NV_USERS_GLOBALTABLE . '_info SET ' . implode(', ', $query_field) . ' WHERE userid=' . $userid);
            }
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_user', 'userid ' . $userid, $admin_info['userid']);
            Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name);
            exit;
        }
    }
} else {
    $_user = $row;
    $_user['password1'] = $_user['password2'] = '';
    $_user['birthday'] = !empty($_user['birthday']) ? date('d/m/Y', $_user['birthday']) : '';
    $_user['in_groups'] = $array_old_groups;
    if (!empty($_user['sig'])) {
        $_user['sig'] = nv_br2nl($_user['sig']);
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:edit.php

示例10: list

    include NV_ROOTDIR . '/includes/footer.php';
}
$error = '';
$savecat = 0;
$incomplete = $nv_Request->get_bool('incomplete', 'get,post', false);
list($tid, $title, $alias, $description, $image, $keywords) = array(0, '', '', '', '', '');
$currentpath = NV_UPLOADS_DIR . '/' . $module_upload;
$savecat = $nv_Request->get_int('savecat', 'post', 0);
if (!empty($savecat)) {
    $tid = $nv_Request->get_int('tid', 'post', 0);
    $keywords = $nv_Request->get_title('keywords', 'post', '');
    $alias = $nv_Request->get_title('alias', 'post', '');
    $description = $nv_Request->get_string('description', 'post', '');
    $description = nv_nl2br(nv_htmlspecialchars(strip_tags($description)), '<br />');
    $alias = str_replace('&', ' ', $alias);
    $alias = str_replace('-', ' ', nv_unhtmlspecialchars($alias));
    $keywords = explode(',', $keywords);
    $keywords[] = $alias;
    $keywords = array_map('strip_punctuation', $keywords);
    $keywords = array_map('trim', $keywords);
    $keywords = array_diff($keywords, array(''));
    $keywords = array_unique($keywords);
    $keywords = implode(',', $keywords);
    $alias = str_replace(' ', '-', strip_punctuation($alias));
    $image = $nv_Request->get_string('image', 'post', '');
    if (nv_is_file($image, NV_UPLOADS_DIR . '/' . $module_upload)) {
        $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
        $image = substr($image, $lu);
    } else {
        $image = '';
    }
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:tags.php

示例11: change

function change($text)
{
    $text = nv_unhtmlspecialchars(trim(nv_convert(strip_tags($text))));
    $text = str_replace(array('"', '>', '<', '´', '`'), array('&quot;', '&gt;', '&lt;', '&#180;', '&#96;'), $text);
    //if($strip==1)
    //{
    //$text = strip_tags($text);
    //}
    return $text;
}
开发者ID:anhyeuviolet,项目名称:feednews,代码行数:10,代码来源:global.function.php

示例12: nv_clean60

/**
 * nv_clean60()
 *
 * @param mixed $string
 * @param integer $num
 * @return
 */
function nv_clean60($string, $num = 60, $specialchars = false)
{
    global $global_config;
    $string = nv_unhtmlspecialchars($string);
    $len = nv_strlen($string);
    if ($num and $num < $len) {
        if (ord(nv_substr($string, $num, 1)) == 32) {
            $string = nv_substr($string, 0, $num) . '...';
        } elseif (strpos($string, ' ') === false) {
            $string = nv_substr($string, 0, $num);
        } else {
            $string = nv_clean60($string, $num - 1);
        }
    }
    if ($specialchars) {
        $string = nv_htmlspecialchars($string);
    }
    return $string;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:26,代码来源:utf8_functions.php

示例13: filter_text_input

    $mods = $array_modul;
    $limit = 3;
    $is_generate_page = false;
}
$key = filter_text_input('search_query', 'get', '', 0, NV_MAX_SEARCH_LENGTH);
$len_key = 0;
$logic = filter_text_input('logic', 'get', 'OR');
if ($logic != 'AND') {
    $logic = 'OR';
}
$checkss = filter_text_input('search_ss', 'get', '', 1, 32);
$ss = md5($client_info['session_id'] . $global_config['sitekey']);
if (!preg_match("/^[a-z0-9]{32}\$/", $checkss) or $checkss != $ss) {
    $key = "";
} else {
    $key = nv_unhtmlspecialchars($key);
    if ($logic == 'OR') {
        $key = preg_replace(array("/^([\\S]{1})\\s/uis", "/\\s([\\S]{1})\\s/uis", "/\\s([\\S]{1})\$/uis"), " ", $key);
    }
    $key = strip_punctuation($key);
    $key = trim($key);
    $len_key = nv_strlen($key);
    $key = nv_htmlspecialchars($key);
}
if ($len_key < NV_MIN_SEARCH_LENGTH) {
    die('&nbsp;&nbsp;');
}
$pages = $nv_Request->get_int('page', 'get', 0);
$contents = "";
$ss = md5($client_info['session_id'] . $global_config['sitekey']);
foreach ($mods as $m_name => $m_values) {
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:adv.php

示例14: gmdate

 $content_lang .= "\$lang_translator['author'] = 'VINADES.,JSC (contact@vinades.vn)';\n";
 $content_lang .= "\$lang_translator['createdate'] = '" . gmdate("d/m/Y, H:i") . "';\n";
 $content_lang .= "\$lang_translator['copyright'] = '@Copyright (C) " . gmdate("Y") . " VINADES.,JSC. All rights reserved';\n";
 $content_lang .= "\$lang_translator['info'] = '';\n";
 $content_lang .= "\$lang_translator['langtype'] = 'lang_module';\n\n";
 $content_langvi = $content_lang;
 $is_search = false;
 foreach ($data_site as $data_i) {
     $array_modfuncs[] = $data_i['file'];
     $lang_value = nv_unhtmlspecialchars($data_i['title']);
     $lang_value = str_replace('$', '\\$', $lang_value);
     $lang_value = str_replace("'", "\\'", $lang_value);
     $lang_value = nv_nl2br($lang_value);
     $lang_value = str_replace('<br  />', '<br />', $lang_value);
     $content_lang .= "\$lang_module['" . $data_i['file'] . "'] = \"" . $lang_value . "\";\n";
     $lang_value = nv_unhtmlspecialchars($data_i['titlevi']);
     $lang_value = str_replace('$', '\\$', $lang_value);
     $lang_value = str_replace("'", "\\'", $lang_value);
     $lang_value = nv_nl2br($lang_value);
     $lang_value = str_replace('<br  />', '<br />', $lang_value);
     $content_langvi .= "\$lang_module['" . $data_i['file'] . "'] = '" . $lang_value . "';\n";
     $content = "<?php\n\n";
     $content .= NV_FILEHEAD . "\n\n";
     $content .= "if ( ! defined( 'NV_IS_MOD_" . strtoupper($data_system['module_data']) . "' ) ) die( 'Stop!!!' );\n\n";
     $content .= "\$page_title = \$module_info['custom_title'];\n";
     $content .= "\$key_words = \$module_info['keywords'];\n\n";
     $content .= "\$array_data = array();\n\n";
     $content .= "\n\n";
     $content .= "\$contents = nv_theme_" . $data_system['module_data'] . "_" . $data_i['file'] . "( \$array_data );\n\n";
     $content .= "include NV_ROOTDIR . '/includes/header.php';\n";
     if ($data_i['ajax']) {
开发者ID:hoangvtien,项目名称:module-nvtools,代码行数:31,代码来源:main.php

示例15: elseif

                 $path_file_lang = NV_ROOTDIR . '/modules/' . $mod_file . '/language/block.' . $matches[1] . '.' . $matches[2] . '_' . NV_LANG_DATA . '.php';
             } elseif (file_exists(NV_ROOTDIR . '/modules/' . $mod_file . '/language/block.' . $matches[1] . '.' . $matches[2] . '_en.php')) {
                 $path_file_lang = NV_ROOTDIR . '/modules/' . $mod_file . '/language/block.' . $matches[1] . '.' . $matches[2] . '_en.php';
             }
         }
     }
     if (empty($row['title'])) {
         $row['title'] = str_replace('_', ' ', $matches[1] . ' ' . $matches[2]);
     }
 } else {
     $error[] = $lang_module['block_error_nsblock'];
 }
 $row['link'] = $nv_Request->get_title('link', 'post', '');
 $row['template'] = nv_substr($nv_Request->get_title('template', 'post', '', 0), 0, 55);
 $row['position'] = $nv_Request->get_title('position', 'post', '', 0);
 $row['position'] = nv_substr(nv_unhtmlspecialchars($row['position']), 0, 55);
 if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $nv_Request->get_string('exp_time', 'post'), $m)) {
     $row['exp_time'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
 } else {
     $row['exp_time'] = 0;
 }
 $row['active_device'] = $nv_Request->get_typed_array('active_device', 'post', 'int');
 if (in_array('1', $row['active_device']) or in_array('2', $row['active_device']) and in_array('3', $row['active_device']) and in_array('4', $row['active_device'])) {
     $row['active'] = 1;
 } else {
     $row['active'] = implode(',', $row['active_device']);
 }
 $groups_view = $nv_Request->get_array('groups_view', 'post', array());
 $row['groups_view'] = !empty($groups_view) ? implode(',', nv_groups_post(array_intersect($groups_view, array_keys($groups_list)))) : '';
 $all_func = ($nv_Request->get_int('all_func', 'post') == 1 and ((preg_match($global_config['check_block_module'], $row['file_name']) or preg_match($global_config['check_block_theme'], $row['file_name'])) and preg_match('/^global\\.([a-zA-Z0-9\\-\\_\\.]+)\\.php$/', $row['file_name']))) ? 1 : 0;
 $array_funcid_post = $nv_Request->get_array('func_id', 'post');
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:block_content.php


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