Exemplo n.º 1
0
         $db->query($_sql);
     } catch (PDOException $e) {
         $nv_Request->set_Session('maxstep', 4);
         $db_config['error'] = $e->getMessage();
         trigger_error($e->getMessage());
         break;
     }
 }
 unset($sql_create_table);
 $sql = 'SELECT * FROM ' . $db_config['prefix'] . '_' . NV_LANG_DATA . '_modules ORDER BY weight ASC';
 $result = $db->query($sql);
 $modules = $result->fetchAll();
 foreach ($modules as $key => $row) {
     $setmodule = $row['title'];
     if (in_array($row['module_file'], $modules_exit)) {
         $sm = nv_setup_data_module(NV_LANG_DATA, $setmodule);
         if ($sm != 'OK_' . $setmodule) {
             die('error set module: ' . $setmodule);
         }
     } else {
         unset($modules[$key]);
         $db->query('DELETE FROM ' . $db_config['prefix'] . '_' . NV_LANG_DATA . '_modules WHERE title=' . $db->quote($setmodule));
     }
 }
 // Cai dat du lieu mau he thong
 $filesavedata = NV_LANG_DATA;
 $lang_data = NV_LANG_DATA;
 if (!file_exists(NV_ROOTDIR . '/install/data_' . $lang_data . '.php')) {
     $filesavedata = 'en';
 }
 include_once NV_ROOTDIR . '/install/data_' . $filesavedata . '.php';
Exemplo n.º 2
0
 $lang_module['modules'] = '';
 $lang_module['vmodule_add'] = '';
 $lang_module['blocks'] = '';
 $lang_module['autoinstall'] = '';
 $lang_global['mod_modules'] = '';
 $module_name = 'modules';
 require_once NV_ROOTDIR . '/' . NV_ADMINDIR . '/modules/functions.php';
 $module_name = '';
 $array_module_setup = explode(',', NV_MODULE_SETUP_DEFAULT);
 $modules_exit = nv_scandir(NV_ROOTDIR . '/modules', $global_config['check_module']);
 $result = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $keylang . '_modules ORDER BY weight ASC');
 while ($row = $result->fetch()) {
     $setmodule = $row['title'];
     $row['module_file'] = $row['module_file'];
     if (in_array($row['module_file'], $modules_exit) and in_array($setmodule, $array_module_setup)) {
         nv_setup_data_module($keylang, $setmodule);
     } else {
         $sth = $db->prepare('DELETE FROM ' . $db_config['prefix'] . '_' . $keylang . '_modules WHERE title= :module');
         $sth->bindParam(':module', $setmodule, PDO::PARAM_STR);
         $sth->execute();
     }
 }
 // Cai dat du lieu mau
 $global_config['site_home_module'] = 'users';
 $_site_home_module = $db->query("SELECT config_value FROM " . $db_config['prefix'] . "_config WHERE module = 'global' AND config_name = 'site_home_module' AND lang=" . $db->quote($global_config['site_lang']))->fetchColumn();
 if (!empty($_site_home_module)) {
     $result = $db->query("SELECT COUNT(*) FROM " . $db_config['prefix'] . "_" . $keylang . "_modules where title=" . $db->quote($_site_home_module));
     if ($result->fetchColumn()) {
         $global_config['site_home_module'] = $_site_home_module;
     }
 }
Exemplo n.º 3
0
            $admin_file = (file_exists(NV_ROOTDIR . '/modules/' . $modrow['basename'] . '/admin.functions.php') and file_exists(NV_ROOTDIR . '/modules/' . $modrow['basename'] . '/admin/main.php')) ? 1 : 0;
            $main_file = (file_exists(NV_ROOTDIR . '/modules/' . $modrow['basename'] . '/functions.php') and file_exists(NV_ROOTDIR . '/modules/' . $modrow['basename'] . '/funcs/main.php')) ? 1 : 0;
            $custom_title = preg_replace('/(\\W+)/i', ' ', $setmodule);
            try {
                $sth = $db->prepare("INSERT INTO " . NV_MODULES_TABLE . "\n\t\t\t\t\t(title, module_file, module_data, module_upload, custom_title, admin_title, set_time, main_file, admin_file, theme, mobile, description, keywords, groups_view, weight, act, admins, rss) VALUES\n\t\t\t\t\t(:title, :module_file, :module_data, :module_upload, :custom_title, '', " . NV_CURRENTTIME . ", " . $main_file . ", " . $admin_file . ", '', '', '', '', '6', " . $weight . ", 0, '',1)\n\t\t\t\t");
                $sth->bindParam(':title', $setmodule, PDO::PARAM_STR);
                $sth->bindParam(':module_file', $modrow['basename'], PDO::PARAM_STR);
                $sth->bindParam(':module_data', $modrow['table_prefix'], PDO::PARAM_STR);
                $sth->bindParam(':module_upload', $setmodule, PDO::PARAM_STR);
                $sth->bindParam(':custom_title', $custom_title, PDO::PARAM_STR);
                $sth->execute();
            } catch (PDOException $e) {
                trigger_error($e->getMessage());
            }
            $nv_Cache->delMod('modules');
            $return = nv_setup_data_module(NV_LANG_DATA, $setmodule, $sample);
            if ($return == 'OK_' . $setmodule) {
                nv_setup_block_module($setmodule);
                $sth = $db->prepare('UPDATE ' . NV_MODULES_TABLE . ' SET act=1 WHERE title=:title');
                $sth->bindParam(':title', $setmodule, PDO::PARAM_STR);
                $sth->execute();
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['modules'] . ' ' . $setmodule, '', $admin_info['userid']);
                Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=edit&mod=' . $setmodule);
                die;
            }
        }
    }
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
    die;
}
$page_title = $lang_module['modules'];
Exemplo n.º 4
0
<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 2-17-2010 0:5
 */
if (!defined('NV_IS_FILE_MODULES')) {
    die('Stop!!!');
}
$contents = 'NO_' . $module_name;
$modname = $nv_Request->get_title('mod', 'post');
$sample = $nv_Request->get_int('sample', 'post', 0);
if (!empty($modname) and preg_match($global_config['check_module'], $modname)) {
    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_global['recreate'] . ' module "' . $modname . '"', '', $admin_info['userid']);
    $contents = nv_setup_data_module(NV_LANG_DATA, $modname, $sample);
}
include NV_ROOTDIR . '/includes/header.php';
echo $contents;
include NV_ROOTDIR . '/includes/footer.php';
Exemplo n.º 5
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 2-17-2010 0:5
 */
if (!defined('NV_IS_FILE_MODULES')) {
    die('Stop!!!');
}
$contents = 'NO_' . $module_name;
$module_name = filter_text_input('mod', 'post');
if (!empty($module_name) and preg_match($global_config['check_module'], $module_name)) {
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_resetup_modul', "module_name  " . $module_name, $admin_info['userid']);
    $contents = nv_setup_data_module(NV_LANG_DATA, $module_name);
}
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";