Beispiel #1
0
    }
}
// Load lai phien lam viec
$nv_update_config['updatelog'] = array();
if (file_exists(NV_ROOTDIR . '/' . NV_DATADIR . '/config_update_' . $nv_update_config['packageID'] . '.php')) {
    include NV_ROOTDIR . '/' . NV_DATADIR . '/config_update_' . $nv_update_config['packageID'] . '.php';
}
// Buoc nang cap
$nv_update_config['step'] = $nv_Request->get_int('step', 'get', 1);
if ($nv_update_config['step'] < 1 or !isset($nv_update_config['updatelog']['step']) or $nv_update_config['step'] > 3 or $nv_update_config['updatelog']['step'] < $nv_update_config['step'] - 1) {
    $nv_update_config['step'] = 1;
}
$NvUpdate = new NvUpdate($nv_update_config);
// Goi $site_mod neu cap nhat module
if (!empty($nv_update_config['formodule'])) {
    $site_mods = nv_site_mods();
}
// Trang chinh
$contents = '';
if ($nv_update_config['step'] == 1) {
    // Kiem tra phien ban va tuong thich du lieu
    if ($NvUpdate->check_package() === false) {
        // Kiem tra chuan goi cap nhat
        $contents = $NvUpdate->PackageErrorTheme();
    } else {
        $array = array();
        // Kiem tra ton tai module can nang cap neu kieu nang cap module
        if (!empty($nv_update_config['formodule'])) {
            $array['module_exist'] = false;
            foreach ($site_mods as $mod) {
                if ($mod['module_file'] == $nv_update_config['formodule']) {
Beispiel #2
0
/**
 * nv_xmlSitemapIndex_generate()
 *
 * @return void
 */
function nv_xmlSitemapIndex_generate()
{
    global $db_config, $db, $global_config, $nv_Request, $sys_info;
    if (file_exists(NV_ROOTDIR . 'themes/' . $global_config['site_theme'] . '/css/sitemapindex.xsl')) {
        $path_css_sitemap = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/css/sitemapindex.xsl';
    } else {
        $path_css_sitemap = NV_BASE_SITEURL . 'themes/default/css/sitemapindex.xsl';
    }
    $sitemapHeader = '<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="' . $path_css_sitemap . '"?><sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></sitemapindex>';
    $xml = new SimpleXMLElement($sitemapHeader);
    $lastModified = NV_CURRENTTIME - 86400;
    if ($global_config['lang_multi']) {
        foreach ($global_config['allow_sitelangs'] as $lang) {
            $sql = "SELECT m.title FROM " . $db_config['prefix'] . '_' . $lang . "_modules m LEFT JOIN " . $db_config['prefix'] . '_' . $lang . "_modfuncs f ON m.title=f.in_module WHERE m.act = 1 AND m.groups_view='6' AND f.func_name = 'sitemap' ORDER BY m.weight, f.subweight";
            $result = $db->query($sql);
            while (list($modname) = $result->fetch(3)) {
                $link = NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . $lang . '&amp;' . NV_NAME_VARIABLE . '=' . $modname . '&amp;' . NV_OP_VARIABLE . '=sitemap';
                $row = $xml->addChild('sitemap');
                $row->addChild('loc', $link);
            }
        }
    } else {
        $site_mods = nv_site_mods();
        foreach ($site_mods as $modname => $values) {
            if (isset($values['funcs']) and isset($values['funcs']['sitemap'])) {
                $link = NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $modname . '&amp;' . NV_OP_VARIABLE . '=sitemap';
                $row = $xml->addChild('sitemap');
                $row->addChild('loc', $link);
            }
        }
    }
    $db = null;
    $contents = $xml->asXML();
    if ($global_config['check_rewrite_file']) {
        $contents = preg_replace("/index\\.php\\?" . NV_LANG_VARIABLE . "\\=([a-z]{2})\\&[amp\\;]*" . NV_NAME_VARIABLE . "\\=SitemapIndex/", "sitemap-\\1.xml", $contents);
        $contents = preg_replace("/index\\.php\\?" . NV_LANG_VARIABLE . "\\=([a-z]{2})\\&[amp\\;]*" . NV_NAME_VARIABLE . "\\=([a-zA-Z0-9\\-]+)\\&[amp\\;]*" . NV_OP_VARIABLE . "\\=sitemap/", "sitemap-\\1.\\2.xml", $contents);
    } elseif ($global_config['rewrite_optional']) {
        $contents = preg_replace("/index\\.php\\?" . NV_LANG_VARIABLE . "\\=([a-z]{2})\\&[amp\\;]*" . NV_NAME_VARIABLE . "\\=([a-zA-Z0-9\\-]+)\\&[amp\\;]*" . NV_OP_VARIABLE . "\\=sitemap/", "index.php/\\2/sitemap" . $global_config['rewrite_endurl'], $contents);
    } else {
        $contents = preg_replace("/index\\.php\\?" . NV_LANG_VARIABLE . "\\=([a-z]{2})\\&[amp\\;]*" . NV_NAME_VARIABLE . "\\=([a-zA-Z0-9\\-]+)\\&[amp\\;]*" . NV_OP_VARIABLE . "\\=sitemap/", "index.php/\\1/\\2/sitemap" . $global_config['rewrite_endurl'], $contents);
    }
    nv_xmlOutput($contents, $lastModified);
}
Beispiel #3
0
if ($client_info['is_myreferer'] === 0 and !defined('NV_IS_MY_USER_AGENT')) {
    require NV_ROOTDIR . '/includes/core/referer.php';
}
if ($nv_Request->isset_request(NV_NAME_VARIABLE, 'get') || $nv_Request->isset_request(NV_NAME_VARIABLE, 'post')) {
    $home = 0;
    $module_name = $nv_Request->get_string(NV_NAME_VARIABLE, 'post,get');
    if (empty($module_name)) {
        $module_name = $global_config['rewrite_op_mod'];
    }
} else {
    $home = 1;
    $module_name = $global_config['site_home_module'];
    $meta_property['og:title'] = $global_config['site_name'];
}
if (preg_match($global_config['check_module'], $module_name)) {
    $site_mods = nv_site_mods($module_name);
    // IMG thong ke truy cap + online
    if ($global_config['statistic'] and isset($sys_mods['statistics']) and $nv_Request->get_string('second', 'get') == 'statimg') {
        include_once NV_ROOTDIR . '/includes/core/statimg.php';
    }
    $op = $nv_Request->get_string(NV_OP_VARIABLE, 'post,get', 'main');
    if (empty($op)) {
        $op = 'main';
    }
    if ($global_config['rewrite_op_mod'] != '' and !isset($sys_mods[$module_name])) {
        $op = $op == 'main' ? $module_name : $module_name . '/' . $op;
        $module_name = $global_config['rewrite_op_mod'];
    }
    // Kiểm tra module có trong hệ thống hay không
    if (isset($site_mods[$module_name])) {
        // SSL