function nv_show_tab() { global $db, $db_config, $module_name, $page_title, $lang_global, $lang_module, $nv_Request; $tab = filter_text_input('tab', 'get'); $result = $db->sql_query("SHOW TABLE STATUS WHERE `Name`=" . $db->dbescape($tab)); $item = $db->sql_fetch_assoc($result); $db->sql_freeresult($result); if (empty($item)) { Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name); die; } if (in_array(filter_text_input('show_highlight', 'post'), array('php', 'sql'))) { $content = nv_highlight_string($tab, filter_text_input('show_highlight', 'post')); include NV_ROOTDIR . "/includes/header.php"; echo $content; include NV_ROOTDIR . "/includes/footer.php"; } $tablename = substr($item['Name'], strlen($db_config['prefix']) + 1); $contents = array(); $contents['table']['caption'] = sprintf($lang_module['table_caption'], $tablename); $contents['table']['info']['name'] = array($lang_module['table_name'], $tablename); $contents['table']['info']['engine'] = array($lang_module['table_type'], isset($item['Engine']) ? $item['Engine'] : $item['Type']); $contents['table']['info']['row_format'] = array($lang_module['row_format'], $item['Row_format']); $contents['table']['info']['data_length'] = array($lang_module['table_size'], nv_convertfromBytes(intval($item['Data_length']) + intval($item['Index_length']))); $contents['table']['info']['max_data_length'] = array($lang_module['table_max_size'], !empty($item['Max_data_length']) ? nv_convertfromBytes(floatval($item['Max_data_length'])) : 'n/a'); $contents['table']['info']['data_free'] = array($lang_module['table_datafree'], !empty($item['Data_free']) ? nv_convertfromBytes(intval($item['Data_free'])) : 0); $contents['table']['info']['rows'] = array($lang_module['table_numrow'], $item['Rows']); $contents['table']['info']['auto_increment'] = array($lang_module['table_auto_increment'], isset($item['Auto_increment']) ? intval($item['Auto_increment']) : "n/a"); $contents['table']['info']['create_time'] = array($lang_module['table_create_time'], !empty($item['Create_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Create_time'])) : "n/a"); $contents['table']['info']['update_time'] = array($lang_module['table_update_time'], !empty($item['Update_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Update_time'])) : "n/a"); $contents['table']['info']['check_time'] = array($lang_module['table_check_time'], !empty($item['Check_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Check_time'])) : "n/a"); $contents['table']['info']['collation'] = array($lang_module['table_charset'], !empty($item['Collation']) && preg_match("/^([a-z0-9]+)_/i", $item['Collation'], $m) ? $m[1] : ""); $contents['table']['show'] = nv_highlight_string($tab, "php"); $contents['table']['show_lang'] = array($lang_module['php_code'], $lang_module['sql_code']); $contents['table']['row']['caption'] = sprintf($lang_module['table_row_caption'], $tablename); $contents['table']['row']['columns'] = array($lang_module['field_name'], $lang_module['field_type'], $lang_module['field_null'], $lang_module['field_key'], $lang_module['field_default'], $lang_module['field_extra']); $contents['table']['row']['detail'] = array(); $result = $db->sql_query("SHOW COLUMNS FROM `" . $tab . "`"); while ($row = $db->sql_fetch_assoc($result)) { $row['Null'] = $row['Null'] == "NO" ? "NOT NULL" : "NULL"; $row['Key'] = empty($row['Key']) ? "" : ($row['Key'] == 'PRI' ? "PRIMARY KEY" : ($row['Key'] == 'UNI' ? "UNIQUE KEY" : "KEY")); $contents['table']['row']['detail'][] = $row; } $db->sql_freeresult($result); $contents = call_user_func("nv_show_tab_theme", $contents); $page_title = sprintf($lang_module['nv_show_tab'], $tablename); include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($contents); include NV_ROOTDIR . "/includes/footer.php"; }
$file_ext = array_diff(array_keys($file_ext), $global_config['forbid_extensions']); if (!empty($file_ext)) { $xtpl->assign('MIMI_TYPE', ucfirst($mime_type)); $xtpl->assign('MIME_EXTS', implode(',', $file_ext)); $xtpl->parse('main.mime'); } } } $xtpl->assign('UPLOAD_ALT_REQUIRE', !empty($global_config['upload_alt_require']) ? 'true' : 'false'); $xtpl->assign('UPLOAD_AUTO_ALT', !empty($global_config['upload_auto_alt']) ? 'true' : 'false'); if (!empty($global_config['upload_alt_require'])) { $xtpl->parse('main.alt_remote'); } if (!empty($global_config['upload_auto_alt'])) { $xtpl->parse('main.auto_alt'); } $xtpl->parse('main'); $contents = $xtpl->text('main'); if (!$nv_Request->isset_request('nomudim', 'get') or $nv_Request->get_int('nomudim', 'get', 0) == 1) { $global_config['mudim_active'] = 0; } $head_site = 0; } else { $xtpl->assign('IFRAME_SRC', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&popup=1&nomudim=1'); $xtpl->parse('uploadPage'); $contents = $xtpl->text('uploadPage'); $head_site = 1; } include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents, $head_site); include NV_ROOTDIR . '/includes/footer.php';
while (list($catid_i, $title_i) = each($array_list_action)) { $contents .= "<option value=\"" . $catid_i . "\">" . $title_i . "</option>\n"; } $contents .= "</select>\n"; $contents .= "<input type=\"button\" onclick=\"nv_main_action(this.form,'" . md5($global_config['sitekey'] . session_id()) . "','" . $lang_module['msgnocheck'] . "')\" value=\"" . $lang_module['action'] . "\">\n"; $contents .= "</td>\n"; $contents .= "</tr>\n"; $contents .= "</tfoot>\n"; $contents .= "</table>\n"; $contents .= "</form>\n"; $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page); if ($generate_page != "") { $contents .= "<br><p align=\"center\">" . $generate_page . "</p>\n"; } include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($reval . $contents); include NV_ROOTDIR . "/includes/footer.php"; function cp_authorize($nv_request) { global $lang_module; $cp_permissions = unserialize($nv_request->get_string("cp_permission", 'session')); if (empty($cp_permissions)) { die("Teo"); } $array_list_actions = array(); if ($cp_permissions['can_write']) { $array_list_actions['addtoblock'] = $lang_module['addtoblock']; $array_list_actions['addtotopics'] = $lang_module['addtotopics']; } if ($cp_permissions['can_publish']) { $array_list_actions['delete'] = $lang_module['delete'];
/** * redriect() * * @param string $msg1 * @param string $msg2 * @param mixed $nv_redirect * @return */ function redriect($msg1 = '', $msg2 = '', $nv_redirect, $autoSaveKey = '', $go_back = '') { global $global_config, $module_file, $module_name; $xtpl = new XTemplate('redriect.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file); if (empty($nv_redirect)) { $nv_redirect = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name; } $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL); $xtpl->assign('NV_REDIRECT', $nv_redirect); $xtpl->assign('MSG1', $msg1); $xtpl->assign('MSG2', $msg2); if (!empty($autoSaveKey)) { $xtpl->assign('AUTOSAVEKEY', $autoSaveKey); $xtpl->parse('main.removelocalstorage'); } if ($go_back) { $xtpl->parse('main.go_back'); } else { $xtpl->parse('main.meta_refresh'); } $xtpl->parse('main'); $contents = $xtpl->text('main'); include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; }
/** * nv_admin_edit_result() * * @param mixed $result * @return */ function nv_admin_edit_result($result) { global $lang_module, $lang_global, $page_title, $module_name, $global_config; $xtpl = new XTemplate("edit.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/authors"); $contents = array(); $contents['title'] = sprintf($lang_module['nv_admin_edit_result_title'], $result['login']); $contents['thead'] = array($lang_module['field'], $lang_module['old_value'], $lang_module['new_value']); $contents['change'] = $result['change']; $contents['action'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=edit&admin_id=" . $result['admin_id']; $contents['download'] = $lang_module['nv_admin_add_download']; $contents['sendmail'] = $lang_module['nv_admin_add_sendmail']; $contents['go_home'] = array($lang_module['main'], NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name); $contents['go_edit'] = array($lang_global['edit'], NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=edit&admin_id=" . $result['admin_id']); $page_title = sprintf($lang_module['nv_admin_edit_result'], $result['login']); $xtpl->assign('TITLE', $contents['title']); $xtpl->assign('THEAD0', $contents['thead'][0]); $xtpl->assign('THEAD1', $contents['thead'][1]); $xtpl->assign('THEAD2', $contents['thead'][2]); $a = 0; foreach ($contents['change'] as $key => $value) { $xtpl->assign('CLASS', $a % 2 ? " class=\"second\"" : ""); $xtpl->assign('VALUE0', $value[0]); $xtpl->assign('VALUE1', $value[1]); $xtpl->assign('VALUE2', $value[2]); $xtpl->parse('edit_resuilt.loop'); ++$a; } $xtpl->assign('ACTION', $contents['action']); foreach ($contents['change'] as $key => $values) { $xtpl->assign('KEY', $key); if ($key != "password") { $xtpl->assign('VALUE1', $values[1]); $xtpl->parse('edit_resuilt.loop1.if'); } else { $xtpl->assign('VALUE2', $values[2]); $xtpl->parse('edit_resuilt.loop1.else'); } $xtpl->parse('edit_resuilt.loop1'); } $xtpl->assign('DOWNLOAD', $contents['download']); $xtpl->assign('SENDMAIL', $contents['sendmail']); $xtpl->assign('EDIT_NAME', $contents['go_edit'][0]); $xtpl->assign('EDIT_HREF', $contents['go_edit'][1]); $xtpl->assign('HOME_NAME', $contents['go_home'][0]); $xtpl->assign('HOME_HREF', $contents['go_home'][1]); $xtpl->parse('edit_resuilt'); $contents = $xtpl->text('edit_resuilt'); include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($contents); include NV_ROOTDIR . "/includes/footer.php"; }
$a = 0; $rows = $db->query('SELECT * FROM ' . NV_AUTHORS_GLOBALTABLE . '_module ORDER BY weight ASC')->fetchAll(); $numrows = sizeof($rows); foreach ($rows as $row) { for ($i = 1; $i <= $numrows; $i++) { $xtpl->assign('WEIGHT', array('key' => $i, 'selected' => $i == $row['weight'] ? ' selected="selected"' : '')); $xtpl->parse('main.loop.weight'); } $row['custom_title'] = isset($lang_global[$row['lang_key']]) ? $lang_global[$row['lang_key']] : ''; $chang_act = array(); for ($i = 1; $i <= 3; $i++) { $chang_act[$i] = $row['act_' . $i] ? ' checked="checked"' : ''; if ($i == 3 and ($row['module'] == 'database' or $row['module'] == 'settings' or $row['module'] == 'site')) { $chang_act[$i] .= ' disabled="disabled"'; } elseif ($i == 1 and $row['module'] == 'authors') { $chang_act[$i] .= ' disabled="disabled"'; } } $xtpl->assign('ROW', $row); $xtpl->assign('CHANG_ACT', $chang_act); $xtpl->parse('main.loop'); } $xtpl->parse('main'); $contents = $xtpl->text('main'); if (!defined('NV_IS_AJAX')) { $page_title = $lang_module['module_admin']; $contents = nv_admin_theme($contents); } include NV_ROOTDIR . '/includes/header.php'; echo $contents; include NV_ROOTDIR . '/includes/footer.php';
function nv_show_tab() { global $db, $db_config, $module_name, $page_title, $lang_module, $nv_Request; $tab = $nv_Request->get_title('tab', 'get'); $sth = $db->prepare('SHOW TABLE STATUS WHERE name= :tab'); $sth->bindParam(':tab', $tab, PDO::PARAM_STR); $sth->execute(); $item = $sth->fetch(); if (empty($item)) { Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name); die; } if (in_array($nv_Request->get_title('show_highlight', 'post'), array('php', 'sql'))) { $content = nv_highlight_string($tab, $nv_Request->get_title('show_highlight', 'post')); include NV_ROOTDIR . '/includes/header.php'; echo $content; include NV_ROOTDIR . '/includes/footer.php'; } $tablename = substr($item['name'], strlen($db_config['prefix']) + 1); $contents = array(); $contents['table']['caption'] = sprintf($lang_module['table_caption'], $tablename); $contents['table']['info']['name'] = array($lang_module['table_name'], $tablename); $contents['table']['info']['engine'] = array($lang_module['table_type'], isset($item['engine']) ? $item['engine'] : $item['type']); $contents['table']['info']['row_format'] = array($lang_module['row_format'], $item['row_format']); $contents['table']['info']['data_length'] = array($lang_module['table_size'], nv_convertfromBytes(intval($item['data_length']) + intval($item['index_length']))); $contents['table']['info']['max_data_length'] = array($lang_module['table_max_size'], !empty($item['max_data_length']) ? nv_convertfromBytes(floatval($item['max_data_length'])) : 'n/a'); $contents['table']['info']['data_free'] = array($lang_module['table_datafree'], !empty($item['data_free']) ? nv_convertfromBytes(intval($item['data_free'])) : 0); $contents['table']['info']['rows'] = array($lang_module['table_numrow'], $item['rows']); $contents['table']['info']['auto_increment'] = array($lang_module['table_auto_increment'], isset($item['auto_increment']) ? intval($item['auto_increment']) : 'n/a'); $contents['table']['info']['create_time'] = array($lang_module['table_create_time'], !empty($item['create_time']) ? strftime('%H:%M:%S %d/%m/%Y', strtotime($item['create_time'])) : 'n/a'); $contents['table']['info']['update_time'] = array($lang_module['table_update_time'], !empty($item['update_time']) ? strftime('%H:%M:%S %d/%m/%Y', strtotime($item['update_time'])) : 'n/a'); $contents['table']['info']['check_time'] = array($lang_module['table_check_time'], !empty($item['check_time']) ? strftime('%H:%M:%S %d/%m/%Y', strtotime($item['check_time'])) : 'n/a'); $contents['table']['info']['collation'] = array($lang_module['table_charset'], !empty($item['collation']) && preg_match('/^([a-z0-9]+)_/i', $item['collation'], $m) ? $m[1] : ''); $contents['table']['show'] = nv_highlight_string($tab, 'php'); $contents['table']['show_lang'] = array($lang_module['php_code'], $lang_module['sql_code']); $contents['table']['row']['caption'] = sprintf($lang_module['table_row_caption'], $tablename); $contents['table']['row']['columns'] = array($lang_module['field_name'], $lang_module['field_type'], $lang_module['field_null'], $lang_module['field_key'], $lang_module['field_default'], $lang_module['field_extra']); $contents['table']['row']['detail'] = array(); $columns_array = $db->columns_array($tab); foreach ($columns_array as $row) { $row['null'] = $row['null'] == 'NO' ? 'NOT NULL' : 'NULL'; $row['key'] = empty($row['key']) ? '' : ($row['key'] == 'PRI' ? 'PRIMARY KEY' : ($row['key'] == 'UNI' ? 'UNIQUE KEY' : 'KEY')); $contents['table']['row']['detail'][] = $row; } $contents = nv_show_tab_theme($contents); $page_title = sprintf($lang_module['nv_show_tab'], $tablename); include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; }
type: "POST", url: "index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=activatetheme", data:"theme="+theme, success: function(data){ if(data!="OK_"+theme){ alert(data); } window.location="index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '"; } }); }); $("a.delete").click(function(){ var theme = $(this).attr("id"); if (confirm("' . $lang_module['theme_created_delete_theme'] . '" + theme +" ?")){ $.ajax({ type: "POST", url: "index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=deletetheme", data:"theme="+theme, success: function(data){ alert(data); window.location="index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '"; } }); } }); }); </script> '; include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($errorconfig . $contents); include NV_ROOTDIR . "/includes/footer.php";
/** * redriect() * * @param string $msg1 * @param string $msg2 * @param mixed $nv_redirect * @return */ function redriect($msg1 = "", $msg2 = "", $nv_redirect) { global $global_config, $module_file, $module_name; $xtpl = new XTemplate("redriect.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file); if (empty($nv_redirect)) { $nv_redirect = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name; } $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL); $xtpl->assign('NV_REDIRECT', $nv_redirect); $xtpl->assign('MSG1', $msg1); $xtpl->assign('MSG2', $msg2); $xtpl->parse('main'); $contents = $xtpl->text('main'); include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($contents); include NV_ROOTDIR . "/includes/footer.php"; exit; }
if (empty($tables)) { $tables = array(); } elseif (!is_array($tables)) { $tables = array($tables); } $tab_list = array(); $result = $db->sql_query("SHOW TABLES LIKE '" . $db_config['prefix'] . "_%'"); while ($item = $db->sql_fetchrow($result)) { $tab_list[] = $item[0]; } $db->sql_freeresult($result); $contents = array(); $contents['tables'] = empty($tables) ? $tab_list : array_values(array_intersect($tab_list, $tables)); $contents['type'] = $type != "str" ? "all" : "str"; $contents['savetype'] = $ext != "sql" ? "gz" : "sql"; $file_ext = $contents['savetype'] == "sql" ? "sql" : "sql.gz"; $file_name = md5($client_info['session_id']) . "_backupdata_" . date("Y-m-d-H-i", time()) . "." . $file_ext; $contents['filename'] = NV_ROOTDIR . "/" . NV_LOGS_DIR . "/dump_backup/" . $file_name; include NV_ROOTDIR . "/includes/core/dump.php"; $result = nv_dump_save($contents); if (empty($result)) { $content = sprintf($lang_module['save_error'], NV_LOGS_DIR . "/dump_backup"); } else { $content = $lang_module['save_ok']; $linkgetfile = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=getfile&filename=" . $file_name . "&checkss=" . md5($file_name . $client_info['session_id'] . $global_config['sitekey']); $content .= "<br><br><a href=\"" . $linkgetfile . "\">" . $lang_module['save_download'] . "</a>"; } $page_title = $lang_module['save_data']; include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme("<br><br><br><center><b>" . $content . "</b></center>"); include NV_ROOTDIR . "/includes/footer.php";
/** * redriect() * * @param string $msg * @param mixed $nv_redirect * @return */ function redriect($msg, $nv_redirect) { if (empty($nv_redirect)) { $nv_redirect = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name; } $contents = $msg; $contents .= "<meta http-equiv=\"refresh\" content=\"1;url=" . $nv_redirect . "\" />"; include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($contents); include NV_ROOTDIR . "/includes/footer.php"; exit; }
$xtpl->parse('main.non_popup.download_groups'); foreach ($groups_list as $_group_id => $_title) { $xtpl->assign('DOWNLOAD_GROUPS', array('value' => $_group_id, 'checked' => in_array($_group_id, $download_groups) ? ' checked="checked"' : '', 'title' => $_title)); $xtpl->parse('main.non_popup.download_groups'); } $generate_page = nv_generate_page($base_url, $num_items, $per_page, $page); if (!empty($generate_page)) { $xtpl->assign('NV_GENERATE_PAGE', $generate_page); $xtpl->parse('main.non_popup.generate_page'); } $xtpl->parse('main.non_popup'); } else { $download_groups = explode(',', $data['download_groups']); $xtpl->assign('DOWNLOAD_GROUPS', array('value' => -1, 'checked' => in_array(-1, $download_groups) ? ' checked="checked"' : '', 'title' => $lang_module['download_setting_groups_module'])); $xtpl->parse('main.popup.download_groups'); foreach ($groups_list as $_group_id => $_title) { $xtpl->assign('DOWNLOAD_GROUPS', array('value' => $_group_id, 'checked' => in_array($_group_id, $download_groups) ? ' checked="checked"' : '', 'title' => $_title)); $xtpl->parse('main.popup.download_groups'); } $xtpl->parse('main.popup'); } if (!empty($error)) { $xtpl->assign('ERROR', implode('<br />', $error)); $xtpl->parse('main.error'); } $xtpl->parse('main'); $contents = $xtpl->text('main'); $page_title = $lang_module['download']; include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents, !$popup); include NV_ROOTDIR . '/includes/footer.php';
<?php /** * @Project NUKEVIET 3.0 * @Author VINADES.,JSC (contact@vinades.vn) * @Copyright (C) 2010 VINADES.,JSC. All rights reserved * @Createdate 2-9-2010 14:43 */ if (!defined('NV_IS_FILE_ADMIN')) { die('Stop!!!'); } $id = $nv_Request->get_array('idcheck', 'post'); $msg = ""; for ($i = 0; $i < sizeof($id); $i++) { $query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE id=" . intval($id[$i]) . ""; if ($db->sql_query($query)) { $db->sql_freeresult(); $msg .= $lang_module['weblink_del_success']; } else { $msg .= $lang_module['weblink_del_error']; } } include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($msg); include NV_ROOTDIR . "/includes/footer.php";
$click_url = $row['click_url']; $publ_date = !empty($row['publ_time']) ? date("d.m.Y", $row['publ_time']) : ""; $exp_date = !empty($row['exp_time']) ? date("d.m.Y", $row['exp_time']) : ""; } if ($click_url == "") { $click_url = "http://"; } $contents['info'] = !empty($error) ? $error : $lang_module['edit_banner_info']; $contents['is_error'] = !empty($error) ? 1 : 0; $contents['file_allowed_ext'] = implode(", ", $contents['file_allowed_ext']); $contents['submit'] = $lang_module['edit_banner']; $contents['action'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=edit_banner&id=" . $id; $contents['title'] = array($lang_module['title'], 'title', $title, 255); $contents['plan'] = array($lang_module['in_plan'], 'pid', $plans, $pid); $contents['client'] = array($lang_module['of_client'], 'clid', $clients, $clid); $contents['file_name'] = array($lang_module['file_name'], NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . NV_BANNER_DIR . "/" . $file_name, "rel=\"shadowbox;height=" . $height . ";width=" . $width . "\"", NV_BASE_SITEURL . "images/ico_" . $file_ext . ".gif", $lang_global['show_picture']); $contents['upload'] = array(sprintf($lang_module['re_upload'], $contents['file_allowed_ext']), 'banner'); $contents['file_alt'] = array($lang_module['file_alt'], 'file_alt', $file_alt, 255); $contents['click_url'] = array($lang_module['click_url'], 'click_url', $click_url, 255); $contents['publ_date'] = array($lang_module['publ_date'], 'publ_date', $publ_date, 10, NV_BASE_SITEURL . "images/calendar.jpg", 18, 17, "popCalendar.show(this, 'publ_date', 'dd.mm.yyyy', true);"); $contents['exp_date'] = array($lang_module['exp_date'], 'exp_date', $exp_date, 10, NV_BASE_SITEURL . "images/calendar.jpg", 18, 17, "popCalendar.show(this, 'exp_date', 'dd.mm.yyyy', true);"); $my_head = "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/popcalendar/popcalendar.js\"></script>\n"; $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.js\"></script>\n"; $my_head .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.css\" />\n"; $my_head .= "<script type=\"text/javascript\">\n"; $my_head .= "Shadowbox.init({\n"; $my_head .= "});\n"; $my_head .= "</script>\n"; include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme(nv_edit_banner_theme($contents)); include NV_ROOTDIR . "/includes/footer.php";
/** * nv_admin_edit_result() * * @param mixed $result * @return */ function nv_admin_edit_result($result) { global $lang_module, $lang_global, $page_title, $module_name, $global_config; $xtpl = new XTemplate('edit.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/authors'); $contents = array(); $contents['title'] = sprintf($lang_module['nv_admin_edit_result_title'], $result['login']); $contents['thead'] = array($lang_module['field'], $lang_module['old_value'], $lang_module['new_value']); $contents['change'] = $result['change']; $contents['action'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=edit&admin_id=' . $result['admin_id']; $contents['download'] = $lang_module['nv_admin_add_download']; $contents['sendmail'] = $lang_module['nv_admin_add_sendmail']; $contents['go_home'] = array($lang_module['main'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name); $contents['go_edit'] = array($lang_global['edit'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=edit&admin_id=' . $result['admin_id']); $page_title = sprintf($lang_module['nv_admin_edit_result'], $result['login']); $xtpl->assign('TITLE', $contents['title']); $xtpl->assign('THEAD0', $contents['thead'][0]); $xtpl->assign('THEAD1', $contents['thead'][1]); $xtpl->assign('THEAD2', $contents['thead'][2]); $a = 0; foreach ($contents['change'] as $key => $value) { $xtpl->assign('VALUE0', $value[0]); $xtpl->assign('VALUE1', $value[1]); $xtpl->assign('VALUE2', $value[2]); $xtpl->parse('edit_resuilt.loop'); ++$a; } $xtpl->assign('DOWNLOAD', $contents['download']); $xtpl->assign('SENDMAIL', $contents['sendmail']); $xtpl->assign('EDIT_NAME', $contents['go_edit'][0]); $xtpl->assign('EDIT_HREF', $contents['go_edit'][1]); $xtpl->assign('HOME_NAME', $contents['go_home'][0]); $xtpl->assign('HOME_HREF', $contents['go_home'][1]); $xtpl->parse('edit_resuilt'); $contents = $xtpl->text('edit_resuilt'); include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; }
$xtpl->assign('MODULE_NAME', $module_name); $xtpl->assign('OP', $op); $xtpl->assign('CHECKSESS', md5(session_id())); $xtpl->assign('BLOCK_LIST', nv_show_block_list($bid)); $id_array = array(); $listid = $nv_Request->get_string('listid', 'get', ''); if ($listid == '') { $db->sqlreset()->select('id, ' . NV_LANG_DATA . '_title')->from($db_config['prefix'] . '_' . $module_data . '_rows')->where('inhome=1 AND id NOT IN(SELECT id FROM ' . $db_config['prefix'] . '_' . $module_data . '_block WHERE bid=' . $bid . ')')->order('id DESC')->limit(20); $sql = $db->sql(); } else { $id_array = array_map('intval', explode(',', $listid)); $sql = 'SELECT id, ' . NV_LANG_DATA . '_title FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows WHERE inhome=1 AND id IN (' . implode(',', $id_array) . ') ORDER BY id DESC'; } $result = $db->query($sql); if ($result->rowCount()) { $a = 0; while (list($id, $title) = $result->fetch(3)) { $xtpl->assign('ROW', array('id' => $id, 'checked' => in_array($id, $id_array) ? ' checked="checked"' : '', 'title' => $title)); $xtpl->parse('main.loop'); ++$a; } foreach ($array_block as $xbid => $blockname) { $xtpl->assign('BID', array('key' => $xbid, 'title' => $blockname, 'selected' => $xbid == $bid ? ' selected="selected"' : '')); $xtpl->parse('main.bid'); } } $xtpl->parse('main'); $contents = $xtpl->text('main'); include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
function nv_site_theme($contents) { return nv_admin_theme($contents); }