예제 #1
0
 function nv_block_data_config_html($module, $data_block, $lang_block)
 {
     global $lang_module;
     if (defined('NV_EDITOR')) {
         require NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
     }
     $htmlcontent = htmlspecialchars(nv_editor_br2nl($data_block['htmlcontent']));
     if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
         $html = nv_add_editor_js() . nv_aleditor("htmlcontent", '100%', '150px', $htmlcontent);
     } else {
         $html = "<textarea style=\"width: 100%\" name=\"htmlcontent\" id=\"htmlcontent\" cols=\"20\" rows=\"8\">" . $htmlcontent . "</textarea>";
     }
     return '<tr><td colspan="2">' . $lang_block['htmlcontent'] . '<br>' . $html . '</td></tr>';
 }
예제 #2
0
/**
 * phpinfo_array()
 *
 * @param integer $option
 * @param bool $return
 * @return
 * INFO_GENERAL => 1 The configuration line, php.ini location, build date, Web Server, System and more.
 * INFO_CREDITS => 2 PHP Credits. See also phpcredits().
 * INFO_CONFIGURATION => 4 Current Local and Master values for PHP directives. See also ini_get().
 * INFO_MODULES => 8 Loaded modules and their respective settings. See also get_loaded_extensions().
 * INFO_ENVIRONMENT => 16 Environment Variable information that's also available in $_ENV.
 * INFO_VARIABLES => 32 Shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).
 * INFO_LICENSE => 64 PHP License information. See also the license FAQ.
 * INFO_ALL => -1 Shows all of the above.
 */
function phpinfo_array($option = 1, $return = false)
{
    global $sys_info;
    $pi = array();
    if (nv_function_exists('phpinfo')) {
        ob_start();
        phpinfo($option);
        $info = preg_replace(array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms', '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#', "#[ \t]+#", '#&nbsp;#', '# +#', '# class=".*?"#', '%&#039;%', '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>' . '<h1>PHP Version (.*?)</h1>(?:\\n+?)</td></tr>#', '#<h1><a href="(?:.*?)\\?=(.*?)">PHP Credits</a></h1>#', '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#', "# +#", '#<tr>#', '#</tr>#'), array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ', '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' . "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>', '<tr><td>PHP Credits Egg</td><td>$1</td></tr>', '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'), ob_get_clean());
        $sections = explode('<h2>', strip_tags($info, '<h2><th><td>'));
        unset($sections[0]);
        foreach ($sections as $section) {
            $n = substr($section, 0, strpos($section, '</h2>'));
            preg_match_all('#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', $section, $askapache, PREG_SET_ORDER);
            foreach ($askapache as $m) {
                $pi[$n][$m[1]] = (isset($m[2]) and !isset($m[3]) || $m[2] == $m[3]) ? $m[2] : array_slice($m, 2);
            }
        }
    }
    return $return === false ? print_r($pi) : $pi;
}
예제 #3
0
function nv_admin_theme($contents, $head_site = 1)
{
    global $global_config, $lang_global, $admin_mods, $site_mods, $admin_menu_mods, $module_name, $module_file, $module_info, $admin_info, $db, $page_title, $submenu, $select_options, $op, $set_active_op, $array_lang_admin, $my_head, $my_footer, $array_mod_title, $array_url_instruction, $op, $client_info;
    $dir_template = '';
    if ($head_site == 1) {
        $file_name_tpl = 'main.tpl';
        if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system/' . $file_name_tpl)) {
            $dir_template = NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system';
        } else {
            $dir_template = NV_ROOTDIR . '/themes/admin_default/system';
            $global_config['admin_theme'] = 'admin_default';
        }
    } else {
        $file_name_tpl = 'content.tpl';
        if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system/' . $file_name_tpl)) {
            $dir_template = NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system';
        } else {
            $dir_template = NV_ROOTDIR . '/themes/admin_default/system';
            $global_config['admin_theme'] = 'admin_default';
        }
    }
    $global_config['site_name'] = empty($global_config['site_name']) ? NV_SERVER_NAME : $global_config['site_name'];
    $xtpl = new XTemplate($file_name_tpl, $dir_template);
    $xtpl->assign('NV_SITE_COPYRIGHT', $global_config['site_name'] . ' [' . $global_config['site_email'] . '] ');
    $xtpl->assign('NV_SITE_NAME', $global_config['site_name']);
    $xtpl->assign('NV_SITE_TITLE', $global_config['site_name'] . ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['admin_page'] . ' ' . NV_TITLEBAR_DEFIS . ' ' . $module_info['custom_title']);
    $xtpl->assign('SITE_DESCRIPTION', $global_config['site_description']);
    $xtpl->assign('NV_CHECK_PASS_MSTIME', (intval($global_config['admin_check_pass_time']) - 62) * 1000);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('NV_ADMINDIR', NV_ADMINDIR);
    $xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
    $xtpl->assign('NV_ASSETS_DIR', NV_ASSETS_DIR);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('MODULE_FILE', $module_file);
    $xtpl->assign('NV_ADMIN_THEME', $global_config['admin_theme']);
    $xtpl->assign('LANG', $lang_global);
    if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/css/' . $module_file . '.css')) {
        $xtpl->assign('NV_CSS_MODULE_THEME', NV_BASE_SITEURL . 'themes/' . $global_config['admin_theme'] . '/css/' . $module_file . '.css');
        $xtpl->parse('main.css_module');
    } elseif (file_exists(NV_ROOTDIR . '/themes/admin_default/css/' . $module_file . '.css')) {
        $xtpl->assign('NV_CSS_MODULE_THEME', NV_BASE_SITEURL . 'themes/admin_default/css/' . $module_file . '.css');
        $xtpl->parse('main.css_module');
    }
    $xtpl->assign('NV_LANG_VARIABLE', NV_LANG_VARIABLE);
    $xtpl->assign('NV_LANG_INTERFACE', NV_LANG_INTERFACE);
    $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
    $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
    $xtpl->assign('NV_SITE_TIMEZONE_OFFSET', round(NV_SITE_TIMEZONE_OFFSET / 3600));
    $xtpl->assign('NV_CURRENTTIME', nv_date('T', NV_CURRENTTIME));
    $xtpl->assign('NV_COOKIE_PREFIX', $global_config['cookie_prefix']);
    if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/js/' . $module_file . '.js')) {
        $xtpl->assign('NV_JS_MODULE', NV_BASE_SITEURL . 'themes/' . $global_config['admin_theme'] . '/js/' . $module_file . '.js');
        $xtpl->parse('main.module_js');
    }
    if (defined('NV_EDITOR') and nv_function_exists('nv_add_editor_js')) {
        $xtpl->assign('NV_ADD_EDITOR_JS', nv_add_editor_js());
        $xtpl->parse('main.nv_add_editor_js');
    }
    if ($head_site == 1) {
        $xtpl->assign('NV_GO_CLIENTSECTOR', $lang_global['go_clientsector']);
        $lang_site = !empty($site_mods) ? NV_LANG_DATA : $global_config['site_lang'];
        $xtpl->assign('NV_GO_CLIENTSECTOR_URL', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . $lang_site);
        $xtpl->assign('NV_LOGOUT', $lang_global['admin_logout_title']);
        if (!empty($array_lang_admin)) {
            $xtpl->assign('NV_LANGDATA', $lang_global['langdata']);
            $xtpl->assign('NV_LANGDATA_CURRENT', $array_lang_admin[NV_LANG_DATA]);
            foreach ($array_lang_admin as $lang_i => $lang_name) {
                $xtpl->assign('DISABLED', $lang_i == NV_LANG_DATA ? " class=\"disabled\"" : "");
                $xtpl->assign('LANGVALUE', $lang_name);
                $xtpl->assign('LANGOP', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . $lang_i);
                $xtpl->parse('main.langdata.option');
            }
            $xtpl->parse('main.langdata');
        }
        // Top_menu
        $top_menu = $admin_mods;
        if (sizeof($top_menu) > 8) {
            if ($module_name != 'authors') {
                unset($top_menu['authors']);
            }
            if ($module_name != 'language') {
                unset($top_menu['language']);
            }
        }
        foreach ($top_menu as $m => $v) {
            if (!empty($v['custom_title'])) {
                $array_submenu = nv_get_submenu($m);
                $xtpl->assign('TOP_MENU_CLASS', $array_submenu ? ' class="dropdown"' : '');
                $xtpl->assign('TOP_MENU_HREF', $m);
                $xtpl->assign('TOP_MENU_NAME', $v['custom_title']);
                if (!empty($array_submenu)) {
                    $xtpl->parse('main.top_menu_loop.has_sub');
                    foreach ($array_submenu as $mop => $submenu_i) {
                        $xtpl->assign('SUBMENULINK', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m . '&amp;' . NV_OP_VARIABLE . '=' . $mop);
                        $xtpl->assign('SUBMENUTITLE', $submenu_i);
                        $xtpl->parse('main.top_menu_loop.submenu.submenu_loop');
                    }
                    $xtpl->parse('main.top_menu_loop.submenu');
                }
                $xtpl->parse('main.top_menu_loop');
            }
        }
        $xtpl->parse('main.top_menu');
        $xtpl->assign('NV_DIGCLOCK', nv_date('H:i T l, d/m/Y', NV_CURRENTTIME));
        if ($admin_info['current_login'] >= NV_CURRENTTIME - 60) {
            if (!empty($admin_info['last_login'])) {
                $temp = sprintf($lang_global['hello_admin1'], $admin_info['username'], date('H:i d/m/Y', $admin_info['last_login']), $admin_info['last_ip']);
                $xtpl->assign('HELLO_ADMIN1', $temp);
                $xtpl->parse('main.hello_admin');
            } else {
                $temp = sprintf($lang_global['hello_admin3'], $admin_info['username']);
                $xtpl->assign('HELLO_ADMIN3', $temp);
                $xtpl->parse('main.hello_admin3');
            }
        } else {
            $temp = sprintf($lang_global['hello_admin2'], $admin_info['username'], nv_convertfromSec(NV_CURRENTTIME - $admin_info['current_login']), $admin_info['current_ip']);
            $xtpl->assign('HELLO_ADMIN2', $temp);
            $xtpl->parse('main.hello_admin2');
        }
        // Admin photo
        $xtpl->assign('ADMIN_USERNAME', $admin_info['username']);
        if (!empty($admin_info['photo']) and file_exists(NV_ROOTDIR . '/' . $admin_info['photo'])) {
            $xtpl->assign('ADMIN_PHOTO', NV_BASE_SITEURL . $admin_info['photo']);
        } else {
            $xtpl->assign('ADMIN_PHOTO', NV_BASE_SITEURL . 'themes/default/images/users/no_avatar.png');
        }
        // Vertical menu
        foreach ($admin_menu_mods as $m => $v) {
            $xtpl->assign('MENU_CLASS', $module_name == $m ? ' class="active"' : '');
            $xtpl->assign('MENU_HREF', $m);
            $xtpl->assign('MENU_NAME', $v);
            if ($m != $module_name) {
                $submenu = nv_get_submenu_mod($m);
                $xtpl->assign('MENU_CLASS', $submenu ? ' class="dropdown"' : '');
                if (!empty($submenu)) {
                    foreach ($submenu as $n => $l) {
                        $xtpl->assign('MENU_SUB_HREF', $m);
                        $xtpl->assign('MENU_SUB_OP', $n);
                        $xtpl->assign('MENU_SUB_NAME', (is_array($l) and isset($l['title'])) ? $l['title'] : $l);
                        $xtpl->parse('main.menu_loop.submenu.loop');
                    }
                    $xtpl->parse('main.menu_loop.submenu');
                }
            } elseif (!empty($submenu)) {
                foreach ($submenu as $n => $l) {
                    if (is_array($l) and isset($l['submenu'])) {
                        $_subtitle = $l['title'];
                        $_submenu_i = $l['submenu'];
                    } else {
                        $_subtitle = $l;
                        $_submenu_i = '';
                    }
                    $xtpl->assign('MENU_SUB_CURRENT', (!empty($op) and $op == $n or !empty($set_active_op) and $set_active_op == $n) ? 'subactive' : 'subcurrent');
                    $xtpl->assign('MENU_SUB_HREF', $m);
                    $xtpl->assign('MENU_SUB_OP', $n);
                    $xtpl->assign('MENU_SUB_NAME', $_subtitle);
                    $xtpl->assign('MENU_CLASS', '');
                    if (!empty($_submenu_i)) {
                        $xtpl->assign('MENU_CLASS', ' class="dropdown"');
                        foreach ($_submenu_i as $sn => $sl) {
                            $xtpl->assign('CUR_SUB_OP', $sn);
                            $xtpl->assign('CUR_SUB_NAME', $sl);
                            $xtpl->parse('main.menu_loop.current.submenu.loop');
                        }
                        $xtpl->parse('main.menu_loop.current.submenu');
                    }
                    $xtpl->parse('main.menu_loop.current');
                }
            }
            $xtpl->parse('main.menu_loop');
        }
        // Notification icon
        if ($global_config['notification_active']) {
            $xtpl->parse('main.notification');
            $xtpl->parse('main.notification_js');
        }
    }
    if (!empty($select_options)) {
        $xtpl->assign('PLEASE_SELECT', $lang_global['please_select']);
        foreach ($select_options as $value => $link) {
            $xtpl->assign('SELECT_NAME', $link);
            $xtpl->assign('SELECT_VALUE', $value);
            $xtpl->parse('main.select_option.select_option_loop');
        }
        $xtpl->parse('main.select_option');
    } elseif (isset($site_mods[$module_name]['main_file']) and $site_mods[$module_name]['main_file']) {
        $xtpl->assign('NV_GO_CLIENTMOD', $lang_global['go_clientmod']);
        $xtpl->parse('main.site_mods');
    }
    if (!empty($array_url_instruction)) {
        foreach ($array_url_instruction as $key => $value) {
            if ($op == $key and filter_var($value, FILTER_VALIDATE_URL)) {
                $xtpl->assign('NV_INSTRUCTION', $lang_global['go_instrucion']);
                $xtpl->assign('NV_URL_INSTRUCTION', $value);
                $xtpl->parse('main.url_instruction');
                break;
            }
        }
    }
    /**
     * Breadcrumbs
     * Note: If active is true, the link will be dismiss
     * If empty $array_mod_title and $page_title, breadcrumbs do not display
     * By default, breadcrumbs is $page_title
     */
    if (empty($array_mod_title) and !empty($page_title)) {
        $array_mod_title = array(0 => array('title' => $page_title, 'link' => '', 'active' => true));
    }
    if (!empty($array_mod_title)) {
        foreach ($array_mod_title as $breadcrumbs) {
            $xtpl->assign('BREADCRUMBS', $breadcrumbs);
            if (!empty($breadcrumbs['active'])) {
                $xtpl->parse('main.breadcrumbs.loop.active');
            }
            if (!empty($breadcrumbs['link']) and empty($breadcrumbs['active'])) {
                $xtpl->parse('main.breadcrumbs.loop.linked');
            } else {
                $xtpl->parse('main.breadcrumbs.loop.text');
            }
            $xtpl->parse('main.breadcrumbs.loop');
        }
        $xtpl->parse('main.breadcrumbs');
    }
    $xtpl->assign('THEME_ERROR_INFO', nv_error_info());
    $xtpl->assign('MODULE_CONTENT', $contents);
    $xtpl->assign('NV_COPYRIGHT', sprintf($lang_global['copyright'], $global_config['site_name']));
    if (defined('CKEDITOR')) {
        $xtpl->parse('main.ckeditor');
    }
    if (defined('NV_IS_SPADMIN') and $admin_info['level'] == 1) {
        $xtpl->parse('main.memory_time_usage');
    }
    if ($client_info['browser']['key'] == 'explorer' and $client_info['browser']['version'] < 9) {
        $xtpl->parse('main.lt_ie9');
    }
    $xtpl->parse('main');
    $sitecontent = $xtpl->text('main');
    if (!empty($my_head)) {
        $sitecontent = preg_replace('/(<\\/head>)/i', $my_head . "\\1", $sitecontent, 1);
    }
    if (!empty($my_footer)) {
        $sitecontent = preg_replace('/(<\\/body>)/i', $my_footer . "\\1", $sitecontent, 1);
    }
    return $sitecontent;
}
예제 #4
0
        }
    }
    if ($nv_Request->isset_request('edit', 'get')) {
        $post = $groupsList[$post['id']];
        $post['content'] = nv_editor_br2nl($post['content']);
        $post['exp_time'] = !empty($post['exp_time']) ? date("d.m.Y", $post['exp_time']) : "";
        $post['public'] = $post['public'] ? " checked=\"checked\"" : "";
    } else {
        $post['title'] = $post['content'] = $post['exp_time'] = "";
        $post['public'] = "";
    }
    if (!empty($post['content'])) {
        $post['content'] = nv_htmlspecialchars($post['content']);
    }
    $xtpl->assign('DATA', $post);
    if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
        $xtpl->parse('add.is_editor');
        $_cont = nv_aleditor('content', '100%', '300px', $post['content']);
    } else {
        $_cont = "<textarea style=\"width:100%;height:300px\" name=\"content\" id=\"content\">" . $post['content'] . "</textarea>";
    }
    $xtpl->assign('CONTENT', $_cont);
    $xtpl->parse('add');
    $contents = $xtpl->text('add');
    $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/popcalendar/popcalendar.js\"></script>\n";
    include NV_ROOTDIR . "/includes/header.php";
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . "/includes/footer.php";
    die;
}
//Danh sach nhom
예제 #5
0
/**
 * nv_html_site_js()
 *
 * @param bool $html
 * @return
 */
function nv_html_site_js($html = true)
{
    global $global_config, $module_info, $module_name, $module_file, $lang_global, $op, $client_info;
    $jsDef = "var nv_siteroot=\"" . NV_BASE_SITEURL . "\",nv_sitelang=\"" . NV_LANG_INTERFACE . "\",nv_name_variable=\"" . NV_NAME_VARIABLE . "\",nv_fc_variable=\"" . NV_OP_VARIABLE . "\",nv_lang_variable=\"" . NV_LANG_VARIABLE . "\",nv_module_name=\"" . $module_name . "\",nv_func_name=\"" . $op . "\",nv_is_user="******"NV_IS_USER") . ", nv_my_ofs=" . round(NV_SITE_TIMEZONE_OFFSET / 3600) . ",nv_my_abbr=\"" . nv_date("T", NV_CURRENTTIME) . "\",nv_cookie_prefix=\"" . $global_config['cookie_prefix'] . "\",nv_check_pass_mstime=" . (intval($global_config['user_check_pass_time']) - 62) * 1000 . ",nv_area_admin=0,theme_responsive=" . (int) ($global_config['current_theme_type'] == 'r');
    if (defined('NV_IS_DRAG_BLOCK')) {
        $jsDef .= ',drag_block=1,blockredirect="' . nv_base64_encode($client_info['selfurl']) . '",selfurl="' . $client_info['selfurl'] . '",block_delete_confirm="' . $lang_global['block_delete_confirm'] . '",block_outgroup_confirm="' . $lang_global['block_outgroup_confirm'] . '",blocks_saved="' . $lang_global['blocks_saved'] . '",blocks_saved_error="' . $lang_global['blocks_saved_error'] . '",post_url="' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=",func_id=' . $module_info['funcs'][$op]['func_id'] . ',module_theme="' . $global_config['module_theme'] . '"';
    }
    $jsDef .= ";";
    $return = array();
    $return[] = array('ext' => 0, 'content' => $jsDef);
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/jquery/jquery.min.js");
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/language/" . NV_LANG_INTERFACE . ".js");
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/global.js");
    if (defined('NV_IS_ADMIN')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/admin.js");
    }
    // module js
    if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/js/' . $module_file . '.js')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/js/' . $module_file . '.js');
    }
    if (defined('NV_EDITOR') and nv_function_exists('nv_add_editor_js')) {
        $editor_js = nv_add_editor_js();
        preg_match("/src\\s*=\\s*[\"']([^\"']+)[\"']/i", $editor_js, $matches);
        $return[] = array('ext' => 1, 'content' => $matches[1]);
    }
    if (defined('NV_IS_DRAG_BLOCK')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/ui/jquery.ui.core.min.js");
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/ui/jquery.ui.sortable.min.js");
    }
    if (!$html) {
        return $return;
    }
    $res = "";
    foreach ($return as $js) {
        if ($js['ext'] == 1) {
            $res .= "<script src=\"" . $js['content'] . "\"></script>" . PHP_EOL;
        } else {
            $res .= "<script>" . PHP_EOL;
            $res .= $js['content'] . PHP_EOL;
            $res .= "</script>" . PHP_EOL;
        }
    }
    return $res;
}
예제 #6
0
/**
 * nv_edit_plan_theme()
 *
 * @param mixed $contents
 * @return
 */
function nv_edit_plan_theme($contents)
{
    global $global_config, $module_file;
    $xtpl = new XTemplate('edit_plan.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('CONTENTS', $contents);
    $xtpl->assign('CLASS', $contents['is_error'] ? ' class="error"' : '');
    foreach ($contents['blang'][3] as $key => $blang) {
        $xtpl->assign('BLANG', array('key' => $key, 'title' => $blang['name'], 'selected' => $key == $contents['blang'][4] ? ' selected="selected"' : ''));
        $xtpl->parse('main.blang');
    }
    foreach ($contents['form'][2] as $form) {
        $xtpl->assign('FORM', array('key' => $form, 'title' => $form, 'selected' => $form == $contents['form'][3] ? ' selected="selected"' : ''));
        $xtpl->parse('main.form');
    }
    if ($contents['description'][5] and nv_function_exists('nv_aleditor')) {
        $description = nv_aleditor($contents['description'][1], $contents['description'][3], $contents['description'][4], $contents['description'][2]);
    } else {
        $description = '<textarea name="' . $contents['description'][1] . '" id="' . $contents['description'][1] . '" style="width:' . $contents['description'][3] . ';height:' . $contents['description'][4] . '">' . $contents['description'][2] . '</textarea>\\n';
    }
    $xtpl->assign('DESCRIPTION', $description);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
예제 #7
0
        $start_time = NV_CURRENTTIME;
    }
    if (empty($cron_name)) {
        $error = $lang_module['cron_name_empty'];
    } elseif (!empty($run_file) and !file_exists(NV_ROOTDIR . '/includes/cronjobs/' . $run_file)) {
        $error = $lang_module['file_not_exist'];
    } elseif (empty($run_func) or !preg_match($global_config['check_cron'], $run_func)) {
        $error = $lang_module['func_name_invalid'];
    } else {
        if (!empty($run_file) and preg_match('/^([a-zA-Z0-9\\-\\_\\.]+)\\.php$/', $run_file) and file_exists(NV_ROOTDIR . '/includes/cronjobs/' . $run_file)) {
            if (!defined('NV_IS_CRON')) {
                define('NV_IS_CRON', true);
            }
            require_once NV_ROOTDIR . '/includes/cronjobs/' . $run_file;
        }
        if (!nv_function_exists($run_func)) {
            $error = $lang_module['func_name_not_exist'];
        } else {
            if (!empty($params)) {
                $params = explode(',', $params);
                $params = array_map('trim', $params);
                $params = implode(',', $params);
            }
            $_sql = 'INSERT INTO ' . NV_CRONJOBS_GLOBALTABLE . '
				(start_time, inter_val, run_file, run_func, params, del, is_sys, act, last_time, last_result, ' . NV_LANG_INTERFACE . '_cron_name) VALUES
				(' . $start_time . ', ' . $interval . ', :run_file, :run_func, :params, ' . $del . ', 0, 1, 0, 0, :cron_name)';
            $data = array();
            $data['run_file'] = $run_file;
            $data['run_func'] = $run_func;
            $data['params'] = $params;
            $data['cron_name'] = $cron_name;
예제 #8
0
<?php

/**
 * @Project NUKEVIET BLOG 4.x
 * @Author PHAN TAN DUNG (phantandung92@gmail.com)
 * @Copyright (C) 2014 PHAN TAN DUNG. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Dec 11, 2013, 09:50:11 PM
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_blog_newsletters')) {
    function nv_blog_newsletters($block_config)
    {
        global $module_info, $global_config, $site_mods, $client_info, $module_name;
        $module = $block_config['module'];
        $module_file = $site_mods[$module]['module_file'];
        if (file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file . "/block.newsletters.tpl")) {
            $block_theme = $module_info['template'];
        } elseif (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/modules/" . $module_file . "/block.newsletters.tpl")) {
            $block_theme = $global_config['site_theme'];
        } else {
            $block_theme = "default";
        }
        // Goi css
        if ($module_name != $module and !defined('NV_IS_BLOG_CSS')) {
            global $my_head;
            $css_file = 'themes/' . $block_theme . '/css/' . $module_file . '.css';
            if (file_exists(NV_ROOTDIR . '/' . $css_file)) {
                define('NV_IS_BLOG_CSS', true);
예제 #9
0
function nv_siteinfo_getmodules()
{
    global $db_config;
    $sql = "SELECT DISTINCT `module_name` FROM `" . $db_config['prefix'] . "_logs`";
    $result = nv_db_cache($sql, 'module_name');
    $array_modules = array();
    if (!empty($result)) {
        foreach ($result as $row) {
            $array_modules[] = $row['module_name'];
        }
    }
    return $array_modules;
}
if (defined('NV_IS_GODADMIN')) {
    $submenu['system_info'] = $lang_module['site_configs_info'];
    if (nv_function_exists('phpinfo')) {
        $submenu['php_info_configuration'] = $lang_module['configuration_php'];
        $submenu['php_info_modules'] = $lang_module['extensions'];
        $submenu['php_info_environment'] = $lang_module['environment_php'];
        $submenu['php_info_variables'] = $lang_module['variables_php'];
        $allow_func[] = 'php_info_configuration';
        $allow_func[] = 'php_info_modules';
        $allow_func[] = 'php_info_environment';
        $allow_func[] = 'php_info_variables';
    }
    $allow_func[] = 'system_info';
    $allow_func[] = 'checkchmod';
    $allow_func[] = 'logs';
    $allow_func[] = 'logs_del';
    $submenu['logs'] = $lang_module['logs_title'];
}
                $lunarMonth = $diff + 10;
                if ($diff == $leapMonthDiff) {
                    $lunarLeap = 1;
                }
            }
        }
        if ($lunarMonth > 12) {
            $lunarMonth = $lunarMonth - 12;
        }
        if ($lunarMonth >= 11 && $diff < 4) {
            $lunarYear -= 1;
        }
        return array($lunarDay, $lunarMonth, $lunarYear, $lunarLeap);
    }
}
if (!nv_function_exists('convertLunar2Solar')) {
    /* Convert a lunar date to the corresponding solar date */
    function convertLunar2Solar($lunarDay, $lunarMonth, $lunarYear, $lunarLeap, $timeZone)
    {
        if ($lunarMonth < 11) {
            $a11 = getLunarMonth11($lunarYear - 1, $timeZone);
            $b11 = getLunarMonth11($lunarYear, $timeZone);
        } else {
            $a11 = getLunarMonth11($lunarYear, $timeZone);
            $b11 = getLunarMonth11($lunarYear + 1, $timeZone);
        }
        $k = INT(0.5 + ($a11 - 2415021.076998695) / 29.530588853);
        $off = $lunarMonth - 11;
        if ($off < 0) {
            $off += 12;
        }
 function nv_block_form_content($block_config)
 {
     global $db, $site_mods, $module_info, $module_name, $lang_module, $my_head, $user_info;
     $module = $block_config['module'];
     $filled = false;
     $answer_info = $old_answer_info = $form_info = array();
     $form_info = $db->query('SELECT * FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . ' WHERE status = 1 AND id = ' . $block_config['formid'])->fetch();
     if (!empty($form_info)) {
         if ($form_info['start_time'] > NV_CURRENTTIME or $form_info['end_time'] > 0 and $form_info['end_time'] < NV_CURRENTTIME or !nv_user_in_groups($form_info['groups_view'])) {
             return '';
         } else {
             // Lấy thông tin câu hỏi
             $question_info = $db->query("SELECT * FROM " . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . "_question WHERE fid = " . $block_config['formid'] . " AND status = 1 ORDER BY weight")->fetchAll();
             // Trạng thái trả lời
             if (defined('NV_IS_USER')) {
                 $sql = "SELECT * FROM " . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . "_answer WHERE fid = " . $block_config['formid'] . " AND who_answer = " . $user_info['userid'];
                 $_rows = $db->query($sql)->fetch();
                 if ($_rows) {
                     $filled = true;
                     $form_info['filled'] = true;
                     $answer_info = unserialize($_rows['answer']);
                 }
                 if (!empty($answer_info) and !$block_config['dis_form_answered']) {
                     return '';
                 }
             }
             if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $site_mods[$module]['module_file'] . '/block_form_content.tpl')) {
                 $block_theme = $module_info['template'];
             } else {
                 $block_theme = 'default';
             }
             if ($module != $module_name) {
                 $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/jquery/jquery.validate.min.js\"></script>\n";
                 $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/language/jquery.validator-" . NV_LANG_INTERFACE . ".js\"></script>\n";
                 $my_head .= "<script type=\"text/javascript\">\n";
                 $my_head .= "\$(document).ready(function(){\n\t\t\t\t\t\t\t\t\$('#question_form').validate({\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t });";
                 $my_head .= " </script>\n";
                 if (file_exists(NV_ROOTDIR . '/modules/' . $site_mods[$module]['module_file'] . '/language/' . NV_LANG_DATA . '.php')) {
                     require_once NV_ROOTDIR . '/modules/' . $site_mods[$module]['module_file'] . '/language/' . NV_LANG_DATA . '.php';
                 }
             } else {
                 return '';
             }
             $xtpl = new XTemplate('block_form_content.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $site_mods[$module]['module_file']);
             $xtpl->assign('LANG', $lang_module);
             $xtpl->assign('FORM', $form_info);
             $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
             $xtpl->assign('FORM_ACTION', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '/' . $form_info['id'] . '-' . $form_info['alias']);
             if ($block_config['dis_form_info']) {
                 $xtpl->parse('main.form_info');
             }
             if ($form_info['question_display'] == 'question_display_left') {
                 $xtpl->assign('FORM_LEFT', 'class="form-horizontal"');
             }
             foreach ($question_info as $row) {
                 $row['value'] = isset($answer_info[$row['qid']]) ? $answer_info[$row['qid']] : '';
                 $row['required'] = $row['required'] ? 'required' : '';
                 $xtpl->assign('QUESTION', $row);
                 if ($row['required']) {
                     $xtpl->parse('main.loop.required');
                 }
                 if ($row['question_type'] == 'textbox' or $row['question_type'] == 'number') {
                     if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                         $row['readonly'] = 'readonly="readonly"';
                     }
                     $xtpl->assign('QUESTION', $row);
                     $xtpl->parse('main.loop.textbox');
                 } elseif ($row['question_type'] == 'date') {
                     $row['value'] = empty($row['value']) ? '' : date('d/m/Y', $row['value']);
                     $row['datepicker'] = ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) ? '' : 'datepicker';
                     $xtpl->assign('QUESTION', $row);
                     $xtpl->parse('main.loop.date');
                 } elseif ($row['question_type'] == 'textarea') {
                     if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                         $row['readonly'] = 'readonly';
                     }
                     $row['value'] = nv_htmlspecialchars(nv_br2nl($row['value']));
                     $xtpl->assign('QUESTION', $row);
                     $xtpl->parse('main.loop.textarea');
                 } elseif ($row['question_type'] == 'editor') {
                     if (defined('NV_EDITOR')) {
                         require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
                     } elseif (!nv_function_exists('nv_aleditor') and file_exists(NV_ROOTDIR . '/' . NV_EDITORSDIR . '/ckeditor/ckeditor_php5.php')) {
                         define('NV_EDITOR', true);
                         define('NV_IS_CKEDITOR', true);
                         require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/ckeditor/ckeditor_php5.php';
                         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'] = '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);
                             $val = nv_unhtmlspecialchars($val);
                             return $CKEditor->editor($textareaname, $val);
                         }
                     }
                     if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
                         $row['value'] = nv_htmlspecialchars(nv_editor_br2nl($row['value']));
                         $edits = nv_aleditor('question[' . $row['qid'] . ']', '100%', '350px', $row['value']);
                         $xtpl->assign('EDITOR', $edits);
                         $xtpl->parse('main.loop.editor');
                     } else {
                         $row['value'] = nv_htmlspecialchars(nv_br2nl($row['value']));
                         $row['class'] = '';
                         $xtpl->assign('QUESTION', $row);
                         $xtpl->parse('main.loop.textarea');
                     }
                 } elseif ($row['question_type'] == 'select') {
                     $row['question_choices'] = unserialize($row['question_choices']);
                     foreach ($row['question_choices'] as $key => $value) {
                         $xtpl->assign('QUESTION_CHOICES', array('key' => $key, 'selected' => $key == $row['value'] ? ' selected="selected"' : '', "value" => $value));
                         $xtpl->parse('main.loop.select.loop');
                     }
                     if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                         $row['readonly'] = 'readonly="readonly"';
                     }
                     $xtpl->assign('QUESTION', $row);
                     $xtpl->parse('main.loop.select');
                 } elseif ($row['question_type'] == 'radio') {
                     $number = 0;
                     $row['question_choices'] = unserialize($row['question_choices']);
                     foreach ($row['question_choices'] as $key => $value) {
                         $row['readonly'] = '';
                         if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                             $row['readonly'] = 'onclick="return false;"';
                         }
                         $xtpl->assign('QUESTION_CHOICES', array('id' => $row['qid'] . '_' . $number++, 'key' => $key, 'checked' => $key == $row['value'] ? ' checked="checked"' : '', 'readonly' => $row['readonly'], "value" => $value));
                         $xtpl->parse('main.loop.radio');
                     }
                 } elseif ($row['question_type'] == 'checkbox') {
                     $row['readonly'] = '';
                     if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                         $row['readonly'] = 'onclick="return false;"';
                     }
                     $number = 0;
                     $row['question_choices'] = unserialize($row['question_choices']);
                     $valuecheckbox = !empty($row['value']) ? explode(',', $row['value']) : array();
                     foreach ($row['question_choices'] as $key => $value) {
                         $xtpl->assign('QUESTION_CHOICES', array('id' => $row['qid'] . '_' . $number++, 'key' => $key, 'checked' => in_array($key, $valuecheckbox) ? ' checked="checked"' : '', 'readonly' => $row['readonly'], "value" => $value));
                         $xtpl->parse('main.loop.checkbox');
                     }
                 } elseif ($row['question_type'] == 'multiselect') {
                     $valueselect = !empty($row['value']) ? explode(',', $row['value']) : array();
                     $row['question_choices'] = unserialize($row['question_choices']);
                     foreach ($row['question_choices'] as $key => $value) {
                         $xtpl->assign('QUESTION_CHOICES', array('key' => $key, 'selected' => in_array($key, $valueselect) ? ' selected="selected"' : '', "value" => $value));
                         $xtpl->parse('main.loop.multiselect.loop');
                     }
                     if ($answer_info and !$row['user_editable'] and isset($form_info['filled'])) {
                         $row['readonly'] = 'readonly="readonly"';
                     }
                     $xtpl->assign('QUESTION', $row);
                     $xtpl->parse('main.loop.multiselect');
                 }
                 if ($form_info['question_display'] == 'question_display_left') {
                     $xtpl->assign('LEFT', array('label' => 'class="col-sm-6 control-label"', 'div' => 'class="col-sm-18"'));
                 }
                 $xtpl->parse('main.loop');
             }
             $xtpl->parse('main');
             return $xtpl->text('main');
         }
     }
 }
예제 #12
0
파일: update.php 프로젝트: nukeplus/nuke
     exit;
 }
 if (!$array['errorStepMoveFile']) {
     // Tien trinh bat dau chay
     if ($nv_Request->isset_request('load', 'get')) {
         $func = $nv_Request->get_title('load', 'get', '');
         $nv_update_baseurl = NV_BASE_SITEURL . 'install/update.php?step=2&substep=3&load=' . $func;
         $old_module_version = $nv_update_config['updatelog']['old_version'];
         /*
          * Chuan hoa tra ve cho Ajax status|funcname|functitle|url|lang|message|stop|allcomplete status: - 0: That bai - 1: Thanh cong funcname: Ten ham tiep theo thuc hien functitle: Ten cong viec tiep theo se thuc hien url: Duong dan tiep theo duoc load lang: Cac ngon ngu bi loi message: Thong tin (duoc add vao functitle sau dau -) stop: Dung tien trinh allcomplete: Hoan tat tat ca tien trinh
          */
         $return = array('status' => '0', 'funcname' => 'NO', 'functitle' => 'NO', 'url' => 'NO', 'lang' => 'NO', 'message' => 'NO', 'stop' => '1', 'allcomplete' => '0');
         if (!isset($nv_update_config['updatelog']['data_list'][$func])) {
             $return['stop'] = '1';
         }
         if (!nv_function_exists($func)) {
             $return['stop'] = '1';
         }
         $check_return = call_user_func($func);
         // Goi ham thuc hien nang cap
         // Trang thai thuc hien
         $return['status'] = $check_return['status'] ? '1' : '0';
         $return['stop'] = ($check_return['status'] == 0 and $nv_update_config['updatelog']['data_list'][$func]['require'] == 2) ? '1' : '0';
         $return['message'] = $check_return['message'];
         $last_task = end($nv_update_config['updatelog']['data_list']);
         $last_task_key = key($nv_update_config['updatelog']['data_list']);
         // Kiem tra ket thuc tien trinh
         if ($last_task_key == $func and $return['stop'] == '0') {
             $return['allcomplete'] = '1';
             // Ghi lai de chuyen sang buoc tiep theo
             if ($nv_update_config['update_auto_type'] == 2) {
                }
                $_image->cropFromCenter($width, $height);
                $_image->save(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/', $basename, $quality);
                if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename)) {
                    $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename;
                }
            }
        } elseif (nv_is_url($file)) {
            $imgsource = $file;
        } else {
            $imgsource = '';
        }
        return $imgsource;
    }
}
if (!nv_function_exists('nv_block_videos_groups_tabs')) {
    function nv_block_config_videos_groups_tabs($module, $data_block, $lang_block)
    {
        global $site_mods, $nv_Cache;
        $html_input = '';
        $html = '';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['blockid'] . '</td>';
        $html .= '<td><select name="config_blockid" class="form-control w200">';
        $html .= '<option value="0"> -- </option>';
        $sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_block_cat ORDER BY weight ASC';
        $list = $nv_Cache->db($sql, '', $module);
        foreach ($list as $l) {
            $html .= '<option value="' . $l['bid'] . '" ' . ($data_block['blockid'] == $l['bid'] ? ' selected="selected"' : '') . '>' . $l['title'] . '</option>';
        }
        $html .= '</select>';
예제 #14
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 3/9/2010 23:25
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_comment_new')) {
    function nv_block_comment_new($module, $data_block, $lang_block)
    {
        global $module_config, $db;
        $html = '<tr>';
        $html .= '	<td>' . $lang_block['titlelength'] . '</td>';
        $html .= '	<td><input type="text" name="config_titlelength" class="form-control w200" size="5" value="' . $data_block['titlelength'] . '"/><span class="help-block">' . $lang_block['titlenote'] . '</span></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '	<td>' . $lang_block['numrow'] . '</td>';
        $html .= '	<td><input type="text" name="config_numrow" class="form-control w200" size="5" value="' . $data_block['numrow'] . '"/></td>';
        $html .= '</tr>';
        return $html;
    }
    function nv_block_comment_new_submit($module, $lang_block)
    {
        global $nv_Request;
        $return = array();
        $return['error'] = array();
                }
                $_image->cropFromCenter($width, $height);
                $_image->save(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/', $basename, $quality);
                if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename)) {
                    $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename;
                }
            }
        } elseif (nv_is_url($file)) {
            $imgsource = $file;
        } else {
            $imgsource = '';
        }
        return $imgsource;
    }
}
if (!nv_function_exists('nv_block_category_tab_new')) {
    function nv_block_config_category_tab_new($module, $data_block, $lang_block)
    {
        global $site_mods;
        $html = '<tr>';
        $html .= '<td>' . $lang_block['numrow'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_numrow" size="5" value="' . $data_block['numrow'] . '"/></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['title_length'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_title_length" size="5" value="' . $data_block['title_length'] . '"/></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['width'] . ' (px)</td>';
        $html .= '<td><input type="number" class="form-control w200" name="config_width" size="5" value="' . $data_block['width'] . '"/></td>';
        $html .= '</tr>';
예제 #16
0
<?php

/**
 * @Author Kenny Nguyen (nguyentiendat713@gmail.com)
 * @License GNU/GPL version 2 or any later version
 * @Createdate Jan 28, 2015, 04:00:00 PM
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_blog_news_tags')) {
    function nv_check_theme($mod_file)
    {
        global $global_config;
        if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/' . $mod_file . '/news_tags.tpl')) {
            $block_theme = $global_config['site_theme'];
        } else {
            $block_theme = 'default';
        }
        return $block_theme;
    }
    function nv_block_config_news_tags($module, $data_block, $lang_block)
    {
        global $site_mods;
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['numrow'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_numrow" size="5" value="' . $data_block['numrow'] . '"/></td>';
        $html .= '</tr>';
        $html .= "<tr>";
        $html .= "<td>" . $lang_block['tagsort'] . "</td>";
        $html .= "<td>";
예제 #17
0
        }
        $db->query('DELETE FROM ' . NV_MOD_TABLE . '_files WHERE download_id=' . $id);
        $db->query('DELETE FROM ' . NV_MOD_TABLE . '_detail WHERE id=' . $id);
        $sql = 'SELECT * FROM ' . NV_MOD_TABLE . '_tags_id WHERE id=' . $id;
        $result = $db->query($sql);
        while ($tag = $result->fetch()) {
            $sql = 'UPDATE ' . NV_MOD_TABLE . '_tags SET numdownload=numdownload-1 WHERE did=' . $tag['did'];
            $db->query($sql);
        }
        $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_tags_id WHERE id=' . $id;
        $db->query($sql);
        // Xoa thong bao loi
        nv_delete_notification(NV_LANG_DATA, $module_name, 'report', $id);
    }
    // Resets the contents of the opcode cache
    if ($delfile and nv_function_exists('opcache_reset')) {
        opcache_reset();
    }
    $nv_Cache->delMod($module_name);
    nv_insert_logs(NV_LANG_DATA, $module_data, $lang_module['download_filequeue_del'], $row['title'], $admin_info['userid']);
    die('OK');
}
// List file
$page_title = $lang_module['download_filemanager'];
$where = array();
$base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
$array_search = array('q' => $nv_Request->get_title('q', 'get', ''), 'catid' => $nv_Request->get_int('catid', 'get', 0), 'active' => $nv_Request->get_int('active', 'get', '-1'), 'per_page' => $nv_Request->get_int('per_page', 'get', '30'));
if (empty($list_cats)) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=cat-content');
    exit;
}
<?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 3/9/2010 23:25
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_news_block_news')) {
    function nv_block_config_news($module, $data_block, $lang_block)
    {
        $html = '<tr>';
        $html .= '	<td>' . $lang_block['numrow'] . '</td>';
        $html .= '	<td><input type="text" name="config_numrow" class="form-control w100" size="5" value="' . $data_block['numrow'] . '"/></td>';
        $html .= '</tr>';
        return $html;
    }
    function nv_block_config_news_submit($module, $lang_block)
    {
        global $nv_Request;
        $return = array();
        $return['error'] = array();
        $return['config'] = array();
        $return['config']['numrow'] = $nv_Request->get_int('config_numrow', 'post', 0);
        return $return;
    }
    function nv_news_block_news($block_config, $mod_data)
예제 #19
0
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
phpCAS::setNoCasServerValidation();
// set the language to french
//phpCAS::setLang(PHPCAS_LANG_FRENCH);
phpCAS::handleLogoutRequests(false);
// https://wiki.jasig.org/display/casum/single+sign+out#SingleSignOut-Howitworks
// force CAS authentication
phpCAS::forceAuthentication();
// logout if desired
if (defined('CAS_LOGOUT_URL_REDIRECT')) {
    phpCAS::logoutWithRedirectService(CAS_LOGOUT_URL_REDIRECT);
}
$username = phpCAS::getUser();
if (!empty($username)) {
    if (nv_function_exists('ldap_connect')) {
        $ldapconn = ldap_connect($global_config['config_sso']['ldap_host_url']);
        ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $global_config['config_sso']['ldap_version']);
        ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
        if (!empty($global_config['config_sso']['ldap_bind_dn']) and !empty($global_config['config_sso']['ldap_bind_pw'])) {
            $ldapbind = ldap_bind($ldapconn, $global_config['config_sso']['ldap_bind_dn'], $global_config['config_sso']['ldap_bind_pw']);
        } else {
            $ldapbind = ldap_bind($ldapconn);
        }
        if ($ldapbind) {
            // verify binding
            $result = ldap_search($ldapconn, $global_config['config_sso']['user_contexts'], '(uid=' . $username . ')');
            $data = ldap_get_entries($ldapconn, $result);
            $attribs = array('identity' => md5($username . '@' . $cas_host), 'result' => 'is_res', 'id' => $username, 'server' => $server, 'current_mode' => 4);
            foreach ($global_config['config_sso']['config_field'] as $key => $ckey) {
                if (!empty($ckey) and isset($data[0][$ckey])) {
예제 #20
0
/**
 * nv_xmlOutput()
 *
 * @param string $content
 * @param mixed $lastModified
 * @return void
 */
function nv_xmlOutput($content, $lastModified)
{
    if (class_exists('tidy')) {
        $tidy_options = array('input-xml' => true, 'output-xml' => true, 'indent' => true, 'indent-cdata' => true, 'wrap' => false);
        $tidy = new tidy();
        $tidy->parseString($content, $tidy_options, 'utf8');
        $tidy->cleanRepair();
        $content = (string) $tidy;
    } else {
        $content = trim($content);
    }
    @Header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastModified) . ' GMT');
    @Header('Expires: ' . gmdate('D, d M Y H:i:s', $lastModified) . ' GMT');
    @Header('Content-Type: text/xml; charset=utf-8');
    if (!empty($_SERVER['SERVER_SOFTWARE']) and strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
        @Header('Cache-Control: no-cache, pre-check=0, post-check=0');
    } else {
        @Header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
    }
    @Header('Pragma: no-cache');
    $encoding = 'none';
    if (nv_function_exists('gzencode') and isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
        $encoding = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') ? 'gzip' : (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') ? 'deflate' : 'none');
        if ($encoding != 'none') {
            if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') && preg_match('/^Mozilla\\/4\\.0 \\(compatible; MSIE ([0-9]\\.[0-9])/i', $_SERVER['HTTP_USER_AGENT'], $matches)) {
                $version = floatval($matches[1]);
                if ($version < 6 || $version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1')) {
                    $encoding = 'none';
                }
            }
        }
    }
    if ($encoding != 'none') {
        $content = gzencode($content, 6, $encoding == 'gzip' ? FORCE_GZIP : FORCE_DEFLATE);
        header('Content-Encoding: ' . $encoding);
        header('Vary: Accept-Encoding');
    }
    print_r($content);
    die;
}
<?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 3/9/2010 23:25
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_block_counter_button')) {
    function nv_block_counter_button()
    {
        global $global_config, $db, $lang_global;
        if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/statistics/global.counter_button.tpl')) {
            $block_theme = $global_config['module_theme'];
        } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/statistics/global.counter_button.tpl')) {
            $block_theme = $global_config['site_theme'];
        } else {
            $block_theme = 'default';
        }
        $xtpl = new XTemplate('global.counter_button.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/statistics');
        $xtpl->assign('LANG', $lang_global);
        $xtpl->assign('IMG_PATH', NV_BASE_SITEURL . 'themes/' . $block_theme . '/');
        $sql = "SELECT c_type, c_count FROM " . NV_COUNTER_GLOBALTABLE . " WHERE (c_type='day' AND c_val='" . date('d', NV_CURRENTTIME) . "') OR (c_type='month' AND c_val='" . date('M', NV_CURRENTTIME) . "') OR (c_type='total' AND c_val='hits')";
        $query = $db->query($sql);
        while (list($c_type, $c_count) = $query->fetch(3)) {
            if ($c_type == 'day') {
                $xtpl->assign('COUNT_DAY', number_format($c_count));
<?php

/**
 * @Project Archives OF NUKEVIET 3.x
 * @Author PCD-GROUP (contact@dinhpc.com)
 * @Copyright (C) 2011 PCD-GROUP. All rights reserved
 * @Createdate July 27, 2011  11:24:58 AM 
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_archives_category')) {
    function nv_block_config_archives_category($module, $data_block, $lang_block)
    {
        global $db, $language_array;
        $html .= "<input type=\"text\" value=\"" . $data_block['title_length'] . "\" name=\"config_title_length\" />";
        return '<tr><td>' . $lang_block['title_length'] . '</td><td>' . $html . '</td></tr>';
    }
    function nv_block_config_archives_category_submit($module, $lang_block)
    {
        global $nv_Request;
        $return = array();
        $return['error'] = array();
        $return['config'] = array();
        $return['config']['title_length'] = $nv_Request->get_int('config_title_length', 'post', 0);
        return $return;
    }
    function nv_archives_category($block_config)
    {
        global $module_archives_cat, $module_info, $lang_module, $global_config, $site_mods;
        $module = $block_config['module'];
예제 #23
0
 * @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-1-2010 22:5
 */
if (!defined('NV_IS_FILE_SITEINFO')) {
    die('Stop!!!');
}
$page_title = $lang_module['site_configs_info'];
$info = array();
$info['website'] = array('caption' => $lang_module['site_configs_info'], 'field' => array(array('key' => $lang_module['site_domain'], 'value' => NV_MY_DOMAIN), array('key' => $lang_module['site_url'], 'value' => $global_config['site_url']), array('key' => $lang_module['site_root'], 'value' => NV_ROOTDIR), array('key' => $lang_module['site_script_path'], 'value' => $nv_Request->base_siteurl), array('key' => $lang_module['site_cookie_domain'], 'value' => $global_config['cookie_domain']), array('key' => $lang_module['site_cookie_path'], 'value' => $global_config['cookie_path']), array('key' => $lang_module['site_session_path'], 'value' => $sys_info['sessionpath']), array('key' => $lang_module['site_timezone'], 'value' => NV_SITE_TIMEZONE_NAME . (NV_SITE_TIMEZONE_GMT_NAME != NV_SITE_TIMEZONE_NAME ? ' (' . NV_SITE_TIMEZONE_GMT_NAME . ')' : ''))));
if (defined('NV_IS_GODADMIN')) {
    $global_config['version'] .= '<a href="' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=webtools&amp;' . NV_OP_VARIABLE . '=checkupdate">' . $lang_module['checkversion'] . '</a>';
}
$info['server'] = array('caption' => $lang_module['server_configs_info'], 'field' => array(array('key' => $lang_module['version'], 'value' => $global_config['version']), array('key' => $lang_module['server_phpversion'], 'value' => PHP_VERSION != '' ? PHP_VERSION : phpversion()), array('key' => $lang_module['server_api'], 'value' => (nv_function_exists('apache_get_version') ? apache_get_version() . ', ' : (nv_getenv('SERVER_SOFTWARE') != '' ? nv_getenv('SERVER_SOFTWARE') . ', ' : '')) . (PHP_SAPI != '' ? PHP_SAPI : php_sapi_name())), array('key' => $lang_module['server_phpos'], 'value' => $sys_info['os']), array('key' => $lang_module['server_databaseversion'], 'value' => $db->getAttribute(PDO::ATTR_DRIVER_NAME) . ' ' . $db->getAttribute(PDO::ATTR_SERVER_VERSION))));
if (defined('NV_IS_GODADMIN') and substr($sys_info['os'], 0, 3) != 'WIN') {
    $info['chmod'] = array('caption' => $lang_module['chmod'], 'field' => array(array('key' => NV_DATADIR, 'value' => is_writable(NV_ROOTDIR . '/' . NV_DATADIR) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_CACHEDIR, 'value' => is_writable(NV_ROOTDIR . '/' . NV_CACHEDIR) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_UPLOADS_DIR, 'value' => is_writable(NV_ROOTDIR . '/' . NV_UPLOADS_DIR) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_TEMP_DIR, 'value' => is_writable(NV_ROOTDIR . '/' . NV_TEMP_DIR) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/data_logs', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/dump_backup', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/error_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/error_logs', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/error_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/error_logs/errors256', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/error_logs/errors256') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/error_logs/old', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/error_logs/old') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/error_logs/tmp', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/error_logs/tmp') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/ip_logs', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/ip_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/ref_logs', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/ref_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']), array('key' => NV_LOGS_DIR . '/voting_logs', 'value' => is_writable(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/voting_logs') ? $lang_module['chmod_noneed'] : $lang_module['chmod_need'])));
    if ($dh = opendir(NV_ROOTDIR . '/' . NV_CACHEDIR)) {
        while (($modname = readdir($dh)) !== false) {
            if (preg_match('/^([a-z0-9\\_]+)$/', $modname)) {
                $info['chmod']['field'][] = array('key' => NV_CACHEDIR . '/' . $modname, 'value' => is_writable(NV_CACHEDIR . '/' . $modname) ? $lang_module['chmod_noneed'] : $lang_module['chmod_need']);
            }
        }
        closedir($dh);
    }
}
$xtpl = new XTemplate('system_info.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
$xtpl->assign('LANG', $lang_module);
foreach ($info as $key => $if) {
  * @param mixed $module
  * @param mixed $lang_block
  * @return
  */
 function nv_block_config_relates_blocks_submit($module, $lang_block)
 {
     global $nv_Request;
     $return = array();
     $return['error'] = array();
     $return['config'] = array();
     $return['config']['blockid'] = $nv_Request->get_int('config_blockid', 'post', 0);
     $return['config']['numrow'] = $nv_Request->get_int('config_numrow', 'post', 0);
     $return['config']['cut_num'] = $nv_Request->get_int('config_cut_num', 'post', 0);
     return $return;
 }
 if (!nv_function_exists('nv_get_price_tmp')) {
     function nv_get_price_tmp($module_name, $module_data, $module_file, $pro_id)
     {
         global $db, $db_config, $module_config, $discounts_config;
         $price = array();
         $pro_config = $module_config[$module_name];
         if (file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/site.functions.php')) {
             require_once NV_ROOTDIR . '/modules/' . $module_file . '/site.functions.php';
             $price = nv_get_price($pro_id, $pro_config['money_unit'], 1, false, $module_name);
         }
         return $price;
     }
 }
 /**
  * nv_relates_product()
  *
예제 #25
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 Jan 10, 2011 6:04:30 PM
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_block_data_config_banners')) {
    function nv_block_data_config_banners($module, $data_block, $lang_block)
    {
        global $db, $language_array;
        $html = "<select name=\"config_idplanbanner\">\n";
        $html .= "<option value=\"\">" . $lang_block['idplanbanner'] . "</option>\n";
        $query = "SELECT * FROM " . NV_BANNERS_GLOBALTABLE . "_plans WHERE (blang='" . NV_LANG_DATA . "' OR blang='') ORDER BY title ASC";
        $result = $db->query($query);
        while ($row_bpn = $result->fetch()) {
            $value = $row_bpn['title'] . " (";
            $value .= ((!empty($row_bpn['blang']) and isset($language_array[$row_bpn['blang']])) ? $language_array[$row_bpn['blang']]['name'] : $lang_block['blang_all']) . ", ";
            $value .= $row_bpn['form'] . ", ";
            $value .= $row_bpn['width'] . "x" . $row_bpn['height'] . "px";
            $value .= ")";
            $sel = $data_block['idplanbanner'] == $row_bpn['id'] ? ' selected' : '';
            $html .= "<option value=\"" . $row_bpn['id'] . "\" " . $sel . ">" . $value . "</option>\n";
        }
        $html .= "</select>\n";
        return '<tr><td>' . $lang_block['idplanbanner'] . '</td><td>' . $html . '</td></tr>';
예제 #26
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 Jan 17, 2011 11:34:27 AM
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_copyright_info')) {
    function nv_copyright_info_config()
    {
        global $lang_global, $data_block;
        $html = '<tr>';
        $html .= '<td>' . $lang_global['copyright_by'] . '</td>';
        $html .= '<td><input type="text" name="copyright_by" value="' . nv_htmlspecialchars($data_block['copyright_by']) . '" size="80"></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_global['copyright_url'] . '</td>';
        $html .= '<td><input type="text" name="copyright_url" value="' . nv_htmlspecialchars($data_block['copyright_url']) . '" size="80"></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_global['design_by'] . '</td>';
        $html .= '<td><input type="text" name="design_by" value="' . nv_htmlspecialchars($data_block['design_by']) . '" size="80"></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_global['design_url'] . '</td>';
        $html .= '<td><input type="text" name="design_url" value="' . nv_htmlspecialchars($data_block['design_url']) . '" size="80"></td>';
예제 #27
0
<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 - 2014 VINADES.,JSC.
 * All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Sat, 10 Dec 2011 06:46:54 GMT
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_block_voting_select')) {
    function nv_block_voting_select_config($module, $data_block, $lang_block)
    {
        global $nv_Cache, $language_array, $site_mods;
        $html = '';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['vid'] . '</td>';
        $html .= '<td><select name="vid" class="w300 form-control">';
        $sql = 'SELECT vid, question,acceptcm, groups_view, publ_time, exp_time FROM ' . NV_PREFIXLANG . '_' . $site_mods['voting']['module_data'] . ' WHERE act=1';
        $list = $nv_Cache->db($sql, 'vid', $module);
        foreach ($list as $l) {
            $sel = $data_block['vid'] == $l['vid'] ? ' selected' : '';
            $html .= "<option value=\"" . $l['vid'] . "\" " . $sel . ">" . $l['question'] . "</option>";
        }
        $html .= '</select></td>';
        $html .= '</tr>';
        return $html;
    }
                }
                $_image->cropFromCenter($width, $height);
                $_image->save(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/', $basename, $quality);
                if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename)) {
                    $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename;
                }
            }
        } elseif (nv_is_url($file)) {
            $imgsource = $file;
        } else {
            $imgsource = '';
        }
        return $imgsource;
    }
}
if (!nv_function_exists('nv_block_album_new')) {
    function nv_block_config_album_new($module, $data_block, $lang_block)
    {
        global $site_mods;
        $html = '<tr>';
        $html .= '<td>' . $lang_block['numrow'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_numrow" size="5" value="' . $data_block['numrow'] . '"/></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['title_length'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_title_length" size="5" value="' . $data_block['title_length'] . '"/></td>';
        $html .= '</tr>';
        $html .= '<tr>';
        $html .= '<td>' . $lang_block['des_length'] . '</td>';
        $html .= '<td><input type="text" class="form-control w200" name="config_des_length" size="5" value="' . $data_block['des_length'] . '"/></td>';
        $html .= '</tr>';
예제 #29
0
$xtpl->assign('SYS_MAX_SIZE', nv_convertfromBytes($sys_max_size));
$xtpl->assign('NV_AUTO_RESIZE', $global_config['nv_auto_resize'] ? ' checked="checked"' : '');
$xtpl->assign('UPLOAD_ALT_REQUIRE', $global_config['upload_alt_require'] ? ' checked="checked"' : '');
$xtpl->assign('UPLOAD_AUTO_ALT', $global_config['upload_auto_alt'] ? ' checked="checked"' : '');
for ($index = 100; $index > 0; --$index) {
    $size = floor($index * $p_size);
    $xtpl->assign('SIZE', array('key' => $size, 'title' => nv_convertfromBytes($size), 'selected' => $size == $global_config['nv_max_size'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.size');
}
$_upload_checking_mode = array('strong' => $lang_module['strong_mode'], 'mild' => $lang_module['mild_mode'], 'lite' => $lang_module['lite_mode'], 'none' => $lang_module['none_mode']);
foreach ($_upload_checking_mode as $m => $n) {
    $xtpl->assign('UPLOAD_CHECKING_MODE', array('key' => $m, 'title' => $n, 'selected' => $m == $global_config['upload_checking_mode'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.upload_checking_mode');
}
$strong = false;
if (nv_function_exists('finfo_open') or nv_class_exists('finfo', false) or nv_function_exists('mime_content_type') or substr($sys_info['os'], 0, 3) != 'WIN' and (nv_function_exists('system') or nv_function_exists('exec'))) {
    $strong = true;
}
$xtpl->assign('UPLOAD_CHECKING_NOTE', !$strong ? $lang_module['upload_checking_note'] : '');
foreach ($myini['types'] as $key => $name) {
    $xtpl->assign('TYPES', array('key' => $key, 'title' => $name, 'checked' => in_array($name, $global_config['file_allowed_ext']) ? ' checked="checked"' : ''));
    $xtpl->parse('main.types');
}
foreach ($myini['exts'] as $key => $name) {
    $xtpl->assign('EXTS', array('key' => $key, 'title' => $name, 'checked' => in_array($name, $global_config['forbid_extensions']) ? ' checked="checked"' : ''));
    $xtpl->parse('main.exts');
}
foreach ($myini['mimes'] as $key => $name) {
    $xtpl->assign('MIMES', array('key' => $key, 'title' => $name, 'checked' => in_array($name, $global_config['forbid_mimes']) ? ' checked="checked"' : ''));
    $xtpl->parse('main.mimes');
}
<?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 Jan 17, 2011 11:34:27 AM
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
if (!nv_function_exists('nv_menu_theme_default_footer')) {
    function nv_menu_theme_default_footer_config($module, $data_block, $lang_block)
    {
        global $site_mods;
        $html = "\n";
        foreach ($site_mods as $modname => $modvalues) {
            $checked = in_array($modname, $data_block['module_in_menu']) ? ' checked="checked"' : '';
            $html .= '<div style="float: left" class="w150"><label style="text-align: left"><input type="checkbox" ' . $checked . ' value="' . $modname . '" name="module_in_menu[]">' . $modvalues['custom_title'] . '</label></div>';
        }
        return '<tr><td>' . $lang_block['title_length'] . '</td><td>' . $html . '</td></tr>';
    }
    function nv_menu_theme_default_footer_submit($module, $lang_block)
    {
        global $nv_Request;
        $return = array();
        $return['error'] = array();
        $return['config']['module_in_menu'] = $nv_Request->get_typed_array('module_in_menu', 'post', 'string');
        return $return;
    }