function Getheaderb($type = 'index') { $mysql_model = System::load_sys_class('model'); $navigation = $mysql_model->GetList("select * from `@#_navigation` where `status`='Y' and `type` = '{$type}' order by `order` DESC"); $url = ""; if ($type == 'foot') { foreach ($navigation as $v) { $url .= '<a href="' . WEB_PATH . $v['url'] . '">' . $v['name'] . '</a><b></b>'; } return $url; } $urld = get_web_url(); if ($urld == WEB_PATH) { $url .= '<li class="selected"><a style="padding:15px;padding-right:15px;" href=' . WEB_PATH . '>首页</a></li>'; } else { $url .= '<li class=""><a style="padding:15px;padding-right:15px;" href=' . WEB_PATH . '>首页</a></li>'; } foreach ($navigation as $v) { $urlr = WEB_PATH . $v['url']; if ($urlr == $urld) { $url .= '<li class="sort-all selected"><span>|</span><a href="' . WEB_PATH . $v['url'] . '">' . $v['name'] . '</a></li>'; } else { $url .= '<li class="sort-all"><span>|</span><a href="' . WEB_PATH . $v['url'] . '">' . $v['name'] . '</a></li>'; } } return $url; }
public function login() { $user = $this->userinfo; if ($user) { header("Location:" . G_WEB_PATH); exit; } else { if (!$this->segment(4)) { global $_cfg; $url = WEB_PATH . '/' . $_cfg['param_arr']['url']; $url = rtrim($url, '/'); $url .= '/' . base64_encode(trim(G_HTTP_REFERER)); if ($url != get_web_url()) { header("Location:" . $url); exit; } } } if (isset($_POST['submit'])) { $username = $_POST['username']; $password = md5($_POST['password']); $logintype = ''; if (strpos($username, '@') == false) { //手机 $logintype = 'mobile'; if (!_checkmobile($username)) { _message("手机格式不正确!"); } } else { //邮箱 $logintype = 'email'; if (!_checkemail($username)) { _message("邮箱格式不正确!"); } } $member = $this->db->GetOne("select * from `@#_member` where `{$logintype}`='{$username}' and `password`='{$password}'"); if (!$member) { _message("帐号不存在错误!"); } $check = $logintype . 'code'; if ($member[$check] != 1) { $strcode = _encrypt($member['email']); _message("帐号未认证", WEB_PATH . "/member/user/" . $logintype . "check/" . _encrypt($member[$logintype])); } if (!is_array($member)) { _message("帐号或密码错误", NULL, 3); } else { $user_ip = _get_ip_dizhi(); $this->db->GetOne("UPDATE `@#_member` SET `user_ip` = '{$user_ip}' where `uid` = '{$member['uid']}'"); _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7); _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7); } _message("登录成功", base64_decode($this->segment(4)), 2); } include templates("user", "login"); }
protected final function headerment($ments = null) { $html = ''; $html_l = ''; $URL = trim(get_web_url(), '/'); if (is_array($ments)) { $ment = $ments; } else { if (!isset($this->ment)) { return false; } $ment = $this->ment; } foreach ($ment as $k => $v) { if (WEB_PATH . '/' . $v[2] == $URL) { $html_l = '<h3 class="nav_icon">' . $v[1] . '</h3><span class="span_fenge lr10"></span>'; } if (!isset($v[3])) { $html .= '<a href="' . WEB_PATH . '/' . $v[2] . '">' . $v[1] . '</a>'; $html .= '<span class="span_fenge lr5">|</span>'; } } return $html_l . $html; }
document.execCommand("BackgroundImageCache", false, true); } var nav = document.getElementById("nav"); var pnav = window.parent.document.getElementById("nav"); pnav.innerHTML = nav.innerHTML; </script><div class="wrap"><div class="container"><div id="main"><div class="con box-green"><form id="frmConfig" method="post" action="<?php echo $Action; ?> " enctype="multipart/form-data" ><div class="box-header" id="c1"><h4>基本设置</h4></div><div class="box-content"><table class="table-font"><tr><th>网站名称</th><td><input type="text" class="textinput w450" name="WEB_NAME" value="<?php echo $WebName; ?> " /></td></tr><tr><th>网站域名</th><td><input type="text" class="textinput w450" name="WEB_URL" value="<?php echo $WebUrl; ?> " /><span class='Caution'>域名以http://开头。系统检测到你的域名是:<b style="color:#F30"><?php echo get_web_url(); ?> </b></span></td></tr><tr><th>网站Logo</th><td><input type="text" id="WEB_LOGO" class="textinput w450" name="WEB_LOGO" value="<?php echo $WebLogo; ?> " /><span class='Caution'>鼠标移动到文本框可以预览Logo</span><br/><input id='weblogofile' name ='weblogofile' type ='file' size='70' class='textinput' /> <input id='btnUpload' name ='btnUpload' type ='submit' value='上传图片' /> <input id='btnServer' onclick='BrowserServer()' name ='btnServer' type ='button' value='选择图片' /></td></tr><tr><th>网站地址栏图标</th><td><input type="text" id="WEB_ICON" class="textinput w450" name="WEB_ICON" value="<?php echo $WebIcon; ?> " /><span class='Caution'> 推荐上传32x32的ico图标,如无法看到新上传的图标,请清空浏览器缓存,并重启浏览器!<br/><input id='webiconfile' name ='webiconfile' type ='file' size='70' class='textinput' /> <input id='btnIconUpload' name ='btnIconUpload' type ='submit' value='上传图片' /> <input id='btnIconServer' onclick='BrowserIconServer()' name ='btnIconServer' type ='button' value='选择图片' /><br/><span class='Caution' style="color:#F30"> 在线制作ico网址推荐:<a href="http://www.bitbug.net" target="_blank">http://www.bitbug.net</a> <a href="http://www.ico.la" target="_blank">http://www.ico.la</a></span></td></tr><tr><th>网站ICP备案信息</th><td><input type="text" class="textinput w450" name="WEB_ICP" value="<?php echo $WebICP; ?> " /></td></tr><tr><th>网站状态</th><td><label><input type="radio" name="WEB_STATUS" value="1" <?php if ($WebStatus == "1") {
private function geturl() { $url = array(0 => '', 1 => ''); $urls = get_web_url(); global $_cfg; $urls = WEB_PATH . '/' . $_cfg['param_arr']['url']; //$urls = str_ireplace("/index.php/","/",$urls); $urls = trim($urls, '/'); $parse = parse_url($urls); if (isset($parse['query'])) { parse_str($parse['query'], $parses); unset($parses['p']); if (empty($parses)) { $urls = $parse['path'] . "?"; } else { $urls = $parse['path'] . "?" . http_build_query($parses) . '&'; $urls = str_ireplace("%2f", '/', $urls); $urls = str_ireplace("=&", '/&', $urls); } } else { $urls = $parse['path'] . "?"; } $urls = preg_replace("#\\/\\/#", "/", $urls); $url[0] = $urls . 'p='; return $url; }
public function login() { $user = $this->userinfo; if ($user) { header("Location:" . G_WEB_PATH); exit; } else { if (!$this->segment(4)) { global $_cfg; $url = WEB_PATH . '/' . $_cfg['param_arr']['url']; $url = rtrim($url, '/'); $url .= '/' . base64_encode(trim(G_HTTP_REFERER)); if ($url != get_web_url()) { header("Location:" . $url); exit; } } } if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") { // ajax 请求的处理方式 $username = $_POST['username']; $password = md5($_POST['password']); $logintype = ''; //登录类型, 邮箱或者 手机号码 if (strpos($username, '@') == false) { //手机 $logintype = 'mobile'; if (!_checkmobile($username)) { echo json_encode(array('error1' => '手机格式不正确!')); exit; } } else { $logintype = 'email'; if (!_checkemail($username)) { echo json_encode(array('error2' => '邮箱格式不正确!')); exit; } } $exist = $this->db->GetOne("select * from `@#_member` where `{$logintype}`='{$username}'"); $member = $this->db->GetOne("select * from `@#_member` where `{$logintype}`='{$username}' and `password`='{$password}'"); if (!$exist) { echo json_encode(array('notexist' => '帐号不存在!')); exit; } if (!is_array($member)) { echo json_encode(array('error3' => '帐号或密码错误')); exit; } else { $time = time(); $user_ip = _get_ip_dizhi(); $this->db->GetOne("UPDATE `@#_member` SET `user_ip` = '{$user_ip}',`login_time` = '{$time}' where `uid` = '{$member['uid']}'"); _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7); _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7); } echo json_encode(array('suc' => 'success')); exit; // _message("登录成功", base64_decode($this->segment(4)), 2); } else { // 正常请求的处理方式 include templates("user", "login"); } // if (isset($_POST['submit'])) { // $username = $_POST['username']; // $password = md5($_POST['password']); // $code = md5(strtoupper($_POST['verify'])); // $logintype = ''; // if ($code != _getcookie('checkcode')) { // _message("验证码输入错误!"); // } // if (strpos($username, '@') == false) { // //手机 // $logintype = 'mobile'; // if (!_checkmobile($username)) { // _message("手机格式不正确!"); // } // } else { // //邮箱 // $logintype = 'email'; // if (!_checkemail($username)) { // _message("邮箱格式不正确!"); // } // } // // $member = $this->db->GetOne("select * from `@#_member` where `$logintype`='$username' and `password`='$password'"); // if (!$member) { // _message("帐号不存在错误!"); // } // $check = $logintype . 'code'; // if ($member[$check] != 1) { // $strcode = _encrypt($member['email']); // _message("帐号未认证", WEB_PATH . "/member/user/" . $logintype . "check/" . _encrypt($member[$logintype])); // } // // if (!is_array($member)) { // _message("帐号或密码错误", NULL, 3); // } else { // $time = time(); // $user_ip = _get_ip_dizhi(); // $this->db->GetOne("UPDATE `@#_member` SET `user_ip` = '$user_ip',`login_time` = '$time' where `uid` = '$member[uid]'"); // _setcookie("uid", _encrypt($member['uid']), 60 * 60 * 24 * 7); // _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])), 60 * 60 * 24 * 7); // } // _message("登录成功", base64_decode($this->segment(4)), 2); // } }