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

PHP nv_save_file_config_global函数代码示例

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

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



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

示例1: COUNT

         $result = $db->query("SELECT COUNT(*) FROM " . $db_config['prefix'] . "_" . NV_LANG_DATA . "_modules where title='news'");
         if ($result->fetchColumn()) {
             $global_config['rewrite_op_mod'] = 'news';
             $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = 'news' WHERE lang='sys' AND module = 'global' AND config_name = 'rewrite_op_mod'");
         }
     }
 } catch (PDOException $e) {
     trigger_error($e->getMessage());
     die($e->getMessage());
 }
 nv_save_file_config();
 $array_config_rewrite = array('rewrite_optional' => $global_config['rewrite_optional'], 'rewrite_endurl' => $global_config['rewrite_endurl'], 'rewrite_exturl' => $global_config['rewrite_exturl'], 'rewrite_op_mod' => $global_config['rewrite_op_mod'], 'ssl_https' => 0);
 $rewrite = nv_rewrite_change($array_config_rewrite);
 if (empty($rewrite[0])) {
     $error .= sprintf($lang_module['file_not_writable'], $rewrite[1]);
 } elseif (nv_save_file_config_global()) {
     ++$step;
     $nv_Request->set_Session('maxstep', $step);
     nv_save_file_config();
     @rename(NV_ROOTDIR . '/' . $file_config_temp, NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_CONFIG_FILENAME);
     if (is_writable(NV_ROOTDIR . '/robots.txt')) {
         $contents = file_get_contents(NV_ROOTDIR . '/robots.txt');
         $check_rewrite_file = nv_check_rewrite_file();
         if ($check_rewrite_file) {
             $content_sitemap = 'Sitemap: ' . NV_MY_DOMAIN . NV_BASE_SITEURL . 'sitemap.xml';
         } else {
             $content_sitemap = 'Sitemap: ' . NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php/SitemapIndex' . $global_config['rewrite_endurl'];
         }
         $contents = str_replace('Sitemap: http://yousite.com/?nv=SitemapIndex', $content_sitemap, $contents);
         file_put_contents(NV_ROOTDIR . '/robots.txt', $contents, LOCK_EX);
     }
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:index.php


示例2: array

    $sth->bindValue(':config_name', 'upload_alt_require', PDO::PARAM_STR);
    $sth->bindValue(':config_value', $array_config_define['upload_alt_require'], PDO::PARAM_STR);
    $sth->execute();
    $sth->bindValue(':config_name', 'upload_auto_alt', PDO::PARAM_STR);
    $sth->bindValue(':config_value', $array_config_define['upload_auto_alt'], PDO::PARAM_STR);
    $sth->execute();
    $array_config_define = array();
    $array_config_define['nv_max_width'] = $nv_Request->get_int('nv_max_width', 'post');
    $array_config_define['nv_max_height'] = $nv_Request->get_int('nv_max_height', 'post');
    $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'define' AND config_name = :config_name");
    foreach ($array_config_define as $config_name => $config_value) {
        $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
        $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
        $sth->execute();
    }
    nv_save_file_config_global();
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
    die;
}
$page_title = $lang_module['uploadconfig'];
$xtpl = new XTemplate('uploadconfig.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('MODULE_NAME', $module_name);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('OP', $op);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_MAX_WIDTH', NV_MAX_WIDTH);
$xtpl->assign('NV_MAX_HEIGHT', NV_MAX_HEIGHT);
$sys_max_size = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$p_size = $sys_max_size / 100;
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:uploadconfig.php


示例3: nv_setup_data_module

function nv_setup_data_module($lang, $module_name)
{
    global $db, $db_config, $global_config;
    $return = 'NO_' . $module_name;
    $sql = "SELECT `module_file`, `module_data` FROM `" . $db_config['prefix'] . "_" . $lang . "_modules` WHERE `title`=" . $db->dbescape($module_name);
    $result = $db->sql_query($sql);
    $numrows = $db->sql_numrows($result);
    if ($numrows == 1) {
        list($module_file, $module_data) = $db->sql_fetchrow($result);
        $module_version = array();
        $version_file = NV_ROOTDIR . "/modules/" . $module_file . "/version.php";
        if (file_exists($version_file)) {
            include $version_file;
        }
        $arr_modfuncs = (isset($module_version['modfuncs']) and !empty($module_version['modfuncs'])) ? array_map("trim", explode(",", $module_version['modfuncs'])) : array();
        //xoa du lieu tai bang _config
        $sql = "DELETE FROM `" . NV_CONFIG_GLOBALTABLE . "` WHERE `lang`=" . $db->dbescape($lang) . " AND `module`=" . $db->dbescape($module_name);
        $db->sql_query($sql);
        nv_save_file_config_global();
        if (file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/action.php')) {
            $sql_recreate_module = array();
            include NV_ROOTDIR . '/modules/' . $module_file . '/action.php';
            if (!empty($sql_create_module)) {
                foreach ($sql_create_module as $sql) {
                    if (!$db->sql_query($sql)) {
                        return $return;
                    }
                }
            }
        }
        $arr_func_id = array();
        $arr_show_func = array();
        $new_funcs = nv_scandir(NV_ROOTDIR . '/modules/' . $module_file . '/funcs', $global_config['check_op_file']);
        if (!empty($new_funcs)) {
            // get default layout
            $layout_array = nv_scandir(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/layout', $global_config['check_op_layout']);
            if (!empty($layout_array)) {
                $layout_array = preg_replace($global_config['check_op_layout'], "\\1", $layout_array);
            }
            $array_layout_func_default = array();
            $xml = simplexml_load_file(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/config.ini');
            $layoutdefault = (string) $xml->layoutdefault;
            $layout = $xml->xpath('setlayout/layout');
            for ($i = 0; $i < count($layout); $i++) {
                $layout_name = (string) $layout[$i]->name;
                if (in_array($layout_name, $layout_array)) {
                    $layout_funcs = $layout[$i]->xpath('funcs');
                    for ($j = 0; $j < count($layout_funcs); $j++) {
                        $mo_funcs = (string) $layout_funcs[$j];
                        $mo_funcs = explode(":", $mo_funcs);
                        $m = $mo_funcs[0];
                        $arr_f = explode(",", $mo_funcs[1]);
                        foreach ($arr_f as $f) {
                            $array_layout_func_default[$m][$f] = $layout_name;
                        }
                    }
                }
            }
            // end get default layout
            $arr_func_id_old = array();
            $sql = "SELECT `func_id`, `func_name` FROM `" . $db_config['prefix'] . "_" . $lang . "_modfuncs` WHERE `in_module`=" . $db->dbescape($module_name);
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
                $arr_func_id_old[$row['func_name']] = $row['func_id'];
            }
            $new_funcs = preg_replace($global_config['check_op_file'], "\\1", $new_funcs);
            $new_funcs = array_flip($new_funcs);
            foreach (array_keys($new_funcs) as $func) {
                $show_func = 0;
                $weight = 0;
                $layout = isset($array_layout_func_default[$module_name][$func]) ? $array_layout_func_default[$module_name][$func] : $layoutdefault;
                if (isset($arr_func_id_old[$func]) and isset($arr_func_id_old[$func]) > 0) {
                    $arr_func_id[$func] = $arr_func_id_old[$func];
                    $db->sql_query("UPDATE `" . $db_config['prefix'] . "_" . $lang . "_modfuncs` SET `layout`=" . $db->dbescape($layout) . ", `show_func`= " . $show_func . ", `subweight`='0' WHERE `func_id`=" . $arr_func_id[$func] . "");
                } else {
                    $sql = "INSERT INTO `" . $db_config['prefix'] . "_" . $lang . "_modfuncs` (`func_id`, `func_name`, `func_custom_name`, `in_module`, `show_func`, `in_submenu`, `subweight`, `layout`, `setting`) VALUES (NULL, " . $db->dbescape($func) . ", " . $db->dbescape(ucfirst($func)) . ", " . $db->dbescape($module_name) . ", " . $show_func . ", 0, " . $weight . ", " . $db->dbescape($layout) . ", '')";
                    $arr_func_id[$func] = $db->sql_query_insert_id($sql);
                }
            }
            $subweight = 0;
            foreach ($arr_modfuncs as $func) {
                if (isset($arr_func_id[$func])) {
                    $func_id = $arr_func_id[$func];
                    $arr_show_func[] = $func_id;
                    $show_func = 1;
                    $subweight++;
                    $sql = "UPDATE `" . $db_config['prefix'] . "_" . $lang . "_modfuncs` SET `subweight`=" . $subweight . ", show_func=" . $show_func . " WHERE `func_id`=" . $db->dbescape($func_id);
                    $db->sql_query($sql);
                }
            }
        } else {
            //xoa du lieu tai bang _modfuncs
            $sql = "DELETE FROM `" . $db_config['prefix'] . "_" . $lang . "_modfuncs` WHERE `in_module`=" . $db->dbescape($module_name);
            $db->sql_query($sql);
        }
        if (isset($module_version['uploads_dir']) and !empty($module_version['uploads_dir'])) {
            foreach ($module_version['uploads_dir'] as $path) {
                $cp = '';
                $arr_p = explode("/", $path);
                foreach ($arr_p as $p) {
//.........这里部分代码省略.........
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:101,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP nv_scandir函数代码示例发布时间:2022-05-15
下一篇:
PHP nv_redirect_encrypt函数代码示例发布时间: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