$values['userVersion'] = $global_config['version']; $new_version = $i == 'sysUpd' ? nv_geVersion(28800) : nv_geVersion(120); $values['onlineVersion'] = sprintf($lang_module['newVersion_detail'], (string) $new_version->version, (string) $new_version->name, nv_date("d-m-Y H:i", strtotime($new_version->date))); $xtpl->assign('VALUE', $values); if (nv_version_compare($global_config['version'], $new_version->version) < 0) { $xtpl->assign('VERSION_INFO', (string) $new_version->message); $xtpl->assign('VERSION_LINK', sprintf($lang_module['newVersion_info'], (string) $new_version->link)); $xtpl->parse('sysUpd.inf'); } clearstatcache(); $sysUpdDate = filemtime(NV_ROOTDIR . '/' . NV_CACHEDIR . '/nukeviet.version.' . NV_LANG_INTERFACE . '.xml'); $xtpl->assign('SYSUPDDATE', nv_date("d-m-Y H:i", $sysUpdDate)); $xtpl->parse('sysUpd'); echo $xtpl->text('sysUpd'); } elseif ($i == "modUpd" or $i == "modUpdRef" or $i == "modNewUpd" or $i == "modNewUpdRef") { $_modules = ($i == 'modUpd' or $i == "modNewUpd") ? nv_getModVersion(28800) : nv_getModVersion(120); $_modules = nv_object2array($_modules); $_modules = $_modules['module']; $onlineModules = array(); foreach ($_modules as $m) { $name = array_shift($m); $onlineModules[$name] = $m; unset($onlineModules[$name]['date']); $onlineModules[$name]['pubtime'] = strtotime($m['date']); } $userModules = array(); $sql = "SELECT `module_file`, `mod_version`, `author` FROM `" . $db_config['prefix'] . "_setup_modules` GROUP BY `module_file` ORDER BY `module_file` ASC"; $result = $db->sql_query($sql); while (list($module_file, $mod_version, $author) = $db->sql_fetchrow($result)) { $userModules[$module_file] = array(); $v = "";
while ($row = $db->sql_fetchrow($result)) { if (isset($userModules[$row['module_file']])) { continue; } $v = ""; $p = 0; if (preg_match("/^([^\\s]+)\\s+([\\d]+)\$/", $row['mod_version'], $matches)) { $v = (string) $matches[1]; $p = (int) $matches[2]; } $userModules[$row['module_file']] = array('module_file' => $row['module_file'], 'mod_version' => $v, 'mode' => isset($onlineModules[$row['module_file']]['mode']) ? $onlineModules[$row['module_file']]['mode'] : false, 'time' => $p, 'author' => $row['author']); } } $NvUpdate->module_info($onlineModules, $userModules); } elseif ($type == 'module') { $_modules = nv_getModVersion(0); $_modules = nv_object2array($_modules); $_modules = $_modules['module']; $onlineModules = array(); foreach ($_modules as $m) { $name = array_shift($m); $onlineModules[$name] = $m; unset($onlineModules[$name]['date']); $onlineModules[$name]['pubtime'] = strtotime($m['date']); } $NvUpdate->module_com_info($onlineModules); } else { die(' '); } } $contents = $NvUpdate->step3($array);