function show_form(&$form_items, $error_msg) { global $step, $uchidden; /*vot*/ global $language; if (empty($form_items) || !is_array($form_items)) { return; } show_header(); show_setting('start'); show_setting('hidden', 'step', $step); /*vot*/ show_setting('hidden', 'language', $language); show_setting('hidden', 'install_ucenter', getgpc('install_ucenter')); if ($step == 2) { show_tips('install_dzfull'); show_tips('install_dzonly'); } $is_first = 1; if (!empty($uchidden)) { $uc_info_transfer = unserialize(urldecode($uchidden)); } echo '<div id="form_items_' . $step . '" ' . ($step == 2 && !getgpc('install_ucenter') ? 'style="display:none"' : '') . '><br />'; foreach ($form_items as $key => $items) { global ${'error_' . $key}; if ($is_first == 0) { echo '</table>'; } if (!${'error_' . $key}) { show_tips('tips_' . $key); } else { show_error('tips_admin_config', ${'error_' . $key}); } echo '<table class="tb2">'; foreach ($items as $k => $v) { $value = ''; if (!empty($error_msg)) { $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; } if (empty($value)) { if (isset($v['value']) && is_array($v['value'])) { if ($v['value']['type'] == 'constant') { $value = defined($v['value']['var']) ? constant($v['value']['var']) : $v['value']['var']; } else { $value = $GLOBALS[$v['value']['var']]; } } else { $value = ''; } } if ($k == 'ucurl' && isset($uc_info_transfer['ucapi'])) { $value = $uc_info_transfer['ucapi']; } elseif ($k == 'ucpw' && isset($uc_info_transfer['ucfounderpw'])) { $value = $uc_info_transfer['ucfounderpw']; } elseif ($k == 'ucip') { $value = ''; } show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : ''); } if ($is_first) { $is_first = 0; } } echo '</table>'; echo '</div>'; echo '<table class="tb2">'; show_setting('', 'submitname', 'new_step', $step == 2 ? 'submit|oldbtn' : 'submit'); show_setting('end'); show_footer(); }
public function officeView() { if (!file_exists($this->path)) { show_tips($this->L['not_exists']); } if (file_exists(LIB_DIR . 'plugins/officeView')) { include LIB_DIR . 'plugins/officeView/index.php'; exit; } $file_url = $this->_make_file_proxy($this->path); $host = $_SERVER['HTTP_HOST']; //微软接口调用的预览 if (strstr($host, '10.10.') || strstr($host, '192.168.') || strstr($host, '127.0.') || !strstr($host, '.')) { $local_tips = $this->L['unknow_file_office'] . ', <a href="http://kalcaddle.com/help.html#office" target="_blank">' . $this->L['more'] . '>></a>'; show_tips($local_tips); } else { $office_url = OFFICE_SERVER . rawurlencode($file_url); header("location:" . $office_url); } }
function show_form(&$form_items, $error_msg) { global $step; if (empty($form_items) || !is_array($form_items)) { return; } show_header(); show_setting('start'); show_setting('hidden', 'step', $step); $is_first = 1; foreach ($form_items as $key => $items) { global ${'error_' . $key}; if ($is_first == 0) { echo '</table>'; } if (!${'error_' . $key}) { show_tips('tips_' . $key); } else { show_error('tips_admin_config', ${'error_' . $key}); } echo '<table class="tb2">'; foreach ($items as $k => $v) { global ${$k}; if (!empty($error_msg)) { $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; } else { if (isset($v['value']) && is_array($v['value'])) { if ($v['value']['type'] == 'constant') { $value = defined($v['value']['var']) ? constant($v['value']['var']) : ''; } else { $value = $GLOBALS[$v['value']['var']]; } } else { $value = ''; } } if ($v['type'] == 'checkbox') { $value = '1'; } show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : ''); } //当为环境配置的步骤时,单独输出是否增加演示数据 if ($step == 2 && $key == 'dbinfo') { if ($_POST['demo_date'] == '1') { $demo_check = "checked='checked'"; } echo " </td>\n<td> "; if ($error) { $comment = '<span class="red">' . (is_string($error) ? lang($error) : lang($setname . '_error')) . '</span>'; } else { $comment = lang($setname . '_comment', false); } echo "{$comment}</td>\n</tr>\n"; } if ($is_first) { $is_first = 0; } } show_setting('', 'submitname', 'new_step', 'submit'); show_setting('end'); show_footer(); }
function show_form(&$form_items, $error_msg) { global $step; if (empty($form_items) || !is_array($form_items)) { return; } show_header(); show_setting('start'); show_setting('hidden', 'step', $step); $is_first = 1; foreach ($form_items as $key => $items) { global ${'error_' . $key}; if ($is_first == 0) { echo '</table>'; } if (!${'error_' . $key}) { show_tips('tips_' . $key); } else { show_error('tips_admin_config', ${'error_' . $key}); } if ($is_first == 0) { echo '<table class="tb2">'; } foreach ($items as $k => $v) { global ${$k}; if (!empty($error_msg)) { $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; } else { if (isset($v['value']) && is_array($v['value'])) { if ($v['value']['type'] == 'constant') { $value = defined($v['value']['var']) ? constant($v['value']['var']) : ''; } elseif ($v['value']['type'] == 'var') { $value = $GLOBALS[$v['value']['var']]; } elseif ($v['value']['type'] == 'string') { $value = $v['value']['var']; } } else { $value = ''; } } if ($v['type'] == 'checkbox') { $value = '1'; } show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : ''); } if ($is_first) { $is_first = 0; } } show_setting('', 'submitname', 'new_step', 'submit'); show_setting('end'); show_footer(); }
public function public_link() { load_class('mcrypt'); $pass = $this->config['setting_system']['system_password']; $path = Mcrypt::decode($this->in['fid'], $pass); //一天内解密有效 if (strlen($path) == 0) { show_json($this->L['error'], false); } if (!file_exists($path)) { show_tips($this->L['not_exists']); } file_put_out($path); }
function show_form(&$form_items, $error_msg) { global $step; if (empty($form_items) || !is_array($form_items)) { return; } show_header(); show_setting('start'); show_setting('hidden', 'step', $step); show_select_db(); $is_first = 1; echo '<div id="form_items_' . $step . '" ' . ($step == 5 ? 'style="display:none"' : '') . '><br />'; foreach ($form_items as $key => $items) { global ${'error_' . $key}; if ($is_first == 0) { echo '</table>'; echo '</div>'; } echo '<div id="' . $key . '_feilds">'; if (!${'error_' . $key}) { show_tips('tips_' . $key); } else { show_error('tips_admin_config', ${'error_' . $key}); } echo '<table class="tb2">'; foreach ($items as $k => $v) { $value = ''; if (!empty($error_msg)) { $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; } if (empty($value)) { if (isset($v['value']) && is_array($v['value'])) { if ($v['value']['type'] == 'constant') { $value = defined($v['value']['var']) ? constant($v['value']['var']) : $v['value']['var']; } else { $value = isset($GLOBALS[$v['value']['var']]) ? $GLOBALS[$v['value']['var']] : ''; } } else { $value = ''; } } show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : ''); } if ($is_first) { $is_first = 0; } } echo '</table>'; echo '</div>'; echo '<table class="tb2">'; show_setting('', 'submitname', 'new_step', 'submit'); show_setting('end'); show_footer(); }
function show_importfile_list($exportlog = array(), $exportziplog = array(), $exportsize = array()) { show_header(); show_tips('db_import_tips'); $title = array('filename', 'director', 'version', 'time', 'type', 'size', 'db_method', 'db_volume', ''); echo "\n<table width='100%'>\n<tr>"; foreach ($title as $col) { echo "<th>" . lang($col) . "</th>"; } echo "</tr>\n"; foreach ($exportlog as $key => $val) { $info = $val[1]; $info['dateline'] = is_int($info['dateline']) ? gmdate('Y-m-d H:i:s', $info['dateline'] + 3600 * 8) : lang('unknown'); $info['size'] = sizecount($exportsize[$key]); $info['volume'] = count($val); $info['method'] = $info['type'] != 'zip' ? $info['method'] == 'multivol' ? lang('db_multivol') : lang('db_shell') : ''; echo "<tr>"; echo "<td><a href=\"javascript:;\" onclick=\"display('exportlog_{$key}')\">" . basename($info['filename']) . "</a></td>", '<td width="150">' . dirname($info['filename']) . '</td>', '<td width="60">' . $info['version'] . '</td>', '<td width="140">' . $info['dateline'] . '</td>', '<td width="170">' . lang('db_export_' . $info['type']) . '</td>', '<td width="80">' . $info['size'] . '</td>', '<td width="30">' . $info['method'] . '</td>', '<td width="30">' . $info['volume'] . '</td>', '<td width="40">' . ($info['type'] == 'zip' ? "<a href=\"{$siteurl}restore.php?operation=importzip&datafile_server={$info['filename']}&importsubmit=yes\" onclick=\"return confirm('" . lang('database_import_confirm_zip') . "');\">" . lang('db_import_unzip') . "</a>" : "<a href=\"{$siteurl}restore.php?operation=import&datafile_server={$info['filename']}&importsubmit=yes\" " . ($info['version'] != DISCUZ_VERSION ? "onclick=\"return confirm('" . lang('database_import_confirm') . "');\"" : "onclick=\"return confirm('" . lang('database_import_confirm_sql') . "');\"") . ">" . lang('import') . "</a>") . "</td>"; echo "</tr>\n"; echo '<tbody id="exportlog_' . $key . '" style="display:none">'; foreach ($val as $info) { $info['dateline'] = is_int($info['dateline']) ? gmdate('Y-m-d H:i:s', $info['dateline'] + 3600 * 8) : lang('unknown'); $info['size'] = sizecount($info['size']); echo "<tr>"; echo "<td colspan='2' class='subtb'><a href=\"{$info['filename']}\">" . $info['filename'] . "</a></td>", "<td>" . $info['version'] . "</td>", "<td>" . $info['dateline'] . "</td>", '<td></td>', "<td>" . $info['size'] . "</td>", '<td></td>', "<td>" . $info['volume'] . "</td>", '<td></td>'; echo "</tr>\n"; } echo '</tbody>'; } foreach ($exportziplog as $key => $val) { $info = $val[0]; $info['dateline'] = is_int($info['dateline']) ? gmdate('Y-m-d H:i:s', $info['dateline'] + 3600 * 8) : lang('unknown'); $info['size'] = sizecount($info['size']); $info['method'] = $info['method'] == 'multivol' ? lang('db_multivol') : lang('db_zip'); echo "<tr>"; echo "<td><a href=\"javascript:;\" onclick=\"display('exportlog_{$key}')\">" . basename($info['filename']) . "</a></td>", "<td colspan='2'>" . dirname($info['filename']) . "</td>", "<td width='140'>" . $info['dateline'] . "</td>", "<td width='170'>" . lang('db_export_' . $info['type']) . "</td>", "<td width='80'>" . $info['size'] . "</td>", "<td colspan='2'>" . $info['method'] . "</td>", "<td width='40'><a href=\"{$siteurl}restore.php?operation=importzip&datafile_server={$info['filename']}&importsubmit=yes\" onclick=\"return confirm('" . lang('database_import_confirm_zip') . "');\">" . lang('db_import_unzip') . "</a></td>"; echo "</tr>\n"; echo '<tbody id="exportlog_' . $key . '" style="display:none">'; foreach ($val as $info) { $info['dateline'] = is_int($info['dateline']) ? gmdate('Y-m-d H:i:s', $info['dateline'] + 3600 * 8) : lang('unknown'); $info['size'] = sizecount($info['size']); $info['method'] = $info['method'] == 'multivol' ? lang('db_multivol') : lang('db_zip'); echo "<tr>"; echo "<td colspan='3' class='subtb'><a href=\"{$info['filename']}\">" . $info['filename'] . "</a></td>", "<td>" . $info['dateline'] . "</td>", "<td>" . lang('db_export_' . $info['type']) . "</td>", "<td>" . $info['size'] . "</td>", "<td colspan='3'>" . $info['method'] . "</td>"; echo "</tr>\n"; } echo '</tbody>'; } echo "</table>\n"; show_footer(); }
function no_member_tips() { $tips_arr = dunserialize(pick_common_get(0, 'pick_tips')); if ($tips_arr['no_user']) { return; } $check = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_member')), 0); if ($check) { return; } return show_tips('<div class="tipsblock"><li>' . milu_lang('no_member_tips', array('url' => '?' . PICK_GO . 'member&myac=member_import_online&tpl=no')) . '</li></ul></div>', array('key' => 'no_user', 'w' => 380, 'h' => 250)); }
function show_form(&$form_items, $error_msg) { global $_G, $step, $uchidden; if (empty($form_items) || !is_array($form_items)) { return; } show_header(); show_setting('start'); show_setting('hidden', 'step', $step); $is_first = 1; if (!empty($uchidden)) { $uc_info_transfer = unserialize(urldecode($uchidden)); } foreach ($form_items as $key => $items) { global $_G, ${'error_' . $key}; if ($is_first == 0) { echo '</table>'; } if (!${'error_' . $key}) { show_tips('tips_' . $key); } else { show_error('tips_admin_config', ${'error_' . $key}); } echo '<table class="tb2">'; foreach ($items as $k => $v) { $value = ''; if (!empty($error_msg)) { $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : ''; } if (empty($value)) { if (isset($v['value']) && is_array($v['value'])) { if ($v['value']['type'] == 'constant') { $value = defined($v['value']['var']) ? constant($v['value']['var']) : $v['value']['var']; } else { $value = $GLOBALS[$v['value']['var']]; } } else { $value = ''; } } if ($k == 'ucurl' && isset($uc_info_transfer['ucapi'])) { $value = $uc_info_transfer['ucapi']; } elseif ($k == 'ucpw' && isset($uc_info_transfer['ucfounderpw'])) { $value = $uc_info_transfer['ucfounderpw']; } show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : ''); } if ($is_first) { $is_first = 0; } } show_setting('', 'submitname', 'new_step', 'submit'); show_setting('end'); show_footer(); }
function version_check() { global $_G; $check = $_G['cache']['plugin']['milu_pick']['check_version']; if (!VIP || $check != 1) { return FALSE; } $get_site = GET_URL; $client_info = get_client_info(); if (!$client_info || !$client_info['domain']) { return; } $tips_arr = dunserialize(pick_common_get(0, 'pick_tips')); if ($tips_arr['check_version']) { return; } if (load_cache('check_version')) { return; } $url = GET_URL . 'plugin.php?id=pick_user:upgrade&myac=check_version&tpl=no&php_version=' . phpversion() . '&dxc_version=' . $client_info['dxc_version'] . '&dxc_release=' . $client_info['dxc_release']; $result = get_contents($url, array('cache' => -1)); cache_data('check_version', 'ok', 5 * 3600); if ($result == 'ok') { return show_tips('<div class="tipsblock"><li>' . milu_lang('have_new_version', array('url' => '?' . PICK_GO . 'pick_info&ac=pick_check&checking=1')) . '</li></ul></div>', array('key' => 'check_version', 'w' => 380, 'h' => 250)); } }
} foreach ($optionlist as $optionid => $option) { $db->query("INSERT INTO {$tablepre}typeoptions VALUES ('{$optionid}', '{$option['classid']}', '{$option['displayorder']}', '{$option['title']}', '', '{$option['identifier']}', '{$option['type']}', '" . addslashes(serialize($option['rules'])) . "');"); } $db->query("ALTER TABLE {$tablepre}typeoptions AUTO_INCREMENT=3001"); $yearmonth = date('Ym_', time()); loginit($yearmonth . 'ratelog'); loginit($yearmonth . 'illegallog'); loginit($yearmonth . 'modslog'); loginit($yearmonth . 'cplog'); loginit($yearmonth . 'errorlog'); loginit($yearmonth . 'banlog'); dir_clear(DISCUZ_ROOT . './forumdata/templates'); dir_clear(DISCUZ_ROOT . './forumdata/cache'); dir_clear(DISCUZ_ROOT . './forumdata/threadcaches'); dir_clear(DISCUZ_ROOT . './uc_client/data/cache'); dir_clear(DISCUZ_ROOT . './uc_server/data/cache'); dir_clear(DISCUZ_ROOT . './uc_server/data/view'); $step++; redirect("{$self}?step={$step}"); } elseif ($step == 4) { @touch($lockfile); show_tips('install_finished'); echo '<div class="btnbox margintop marginbot"><input type="button" value="' . lang('install_succeed') . '" onclick="window.location=\'../index.php\'; return false"></div> <img width="0" height="0" src="../index.php" style="display:none;" /> <img width="0" height="0" src="../uc_server/index.php" style="display:none;" /> '; show_footer(); } else { redirect('index.php'); }