您当前的位置:首页 > CMS常见问题 > 帝国cms常见问题 >

帝国cms后台登录界面换成Facebook登录表单样式

0
<?php
define('EmpireCMSAdmin','1');
define('EmpireCMSAPage','login');
define('EmpireCMSNFPage','1');
require('../class/connect.php');
require('../class/functions.php');
//返回后台风格
$loginadminstyleid=EcmsReturnAdminStyle();
//变量处理
$empirecmskey1='';
$empirecmskey2='';
$empirecmskey3='';
$empirecmskey4='';
$empirecmskey5='';
if($_POST['empirecmskey1']&&$_POST['empirecmskey2']&&$_POST['empirecmskey3']&&$_POST['empirecmskey4']&&$_POST['empirecmskey5'])
{
  $empirecmskey1=RepPostVar($_POST['empirecmskey1']);
  $empirecmskey2=RepPostVar($_POST['empirecmskey2']);
  $empirecmskey3=RepPostVar($_POST['empirecmskey3']);
  $empirecmskey4=RepPostVar($_POST['empirecmskey4']);
  $empirecmskey5=RepPostVar($_POST['empirecmskey5']);
  $ecertkeyrndstr=$empirecmskey1.'#!#'.$empirecmskey2.'#!#'.$empirecmskey3.'#!#'.$empirecmskey4.'#!#'.$empirecmskey5;
  esetcookie('ecertkeyrnds',$ecertkeyrndstr,0);
}
elseif(getcvar('ecertkeyrnds'))
{
  $certr=explode('#!#',getcvar('ecertkeyrnds'));
  $empirecmskey1=RepPostVar($certr[0]);
  $empirecmskey2=RepPostVar($certr[1]);
  $empirecmskey3=RepPostVar($certr[2]);
  $empirecmskey4=RepPostVar($certr[3]);
  $empirecmskey5=RepPostVar($certr[4]);
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7" lang="zh"><![endif]--><!--早于IE7的版本-->
<!--[if IE 7]><html class="lt-ie9 lt-ie8" lang="zh"><![endif]--><!--IE7-->
<!--[if IE 8]><html class="lt-ie9" lang="zh"><![endif]--><!--IE8-->
<!--[if gt IE 8]><!--><html lang="zh"><!--<![endif]--><!--大于IE8的版本-->
<head>
<meta name="author" content="www.wangzhanchengxu.com">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<title>网站模板,手机网站模板,响应式网站模板,网站源码下载-网站程序网</title>
<style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;outline:none;list-style:none}
img,a img{border:0px;vertical-align:bottom}
body {font-size:12px;line-height:20px;font-family:"Inconsolata","Microsoft YaHei";color:#404040;background:#282b2d;}
input,textarea,select,label {font-family:inherit;font-size:14px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.login {
  position:absolute;left:50%;top:50%;
  width:200px;padding:20px;
  margin-left:-121px;
  background:#3f65b7;
  border:1px solid #172b4e;
  border-bottom-color:#142647;
  border-radius:5px;
  background-clip:padding-box;
  background-image:-webkit-radial-gradient(ellipse cover, #437dd6, #3960a6);
  background-image:-moz-radial-gradient(ellipse cover, #437dd6, #3960a6);
  background-image:-o-radial-gradient(ellipse cover, #437dd6, #3960a6);
  background-image:radial-gradient(ellipse cover, #437dd6, #3960a6);
  -webkit-box-shadow:
    inset 0 1px rgba(255,255,255,0.3),
    inset 0 0 1px 1px rgba(255,255,255,0.1),
    0 2px 10px rgba(0,0,0,0.5);
  box-shadow:
    inset 0 1px rgba(255,255,255,0.3),
    inset 0 0 1px 1px rgba(255,255,255,0.1),
    0 2px 10px rgba(0,0,0,0.5);
}
.login > h1 {margin-bottom:20px;font-size:16px;font-weight:normal;color:white;text-align:center;text-shadow:0 -1px rgba(0,0,0,0.4)}
.login-input {
  display:block;width:100%;height:32px;margin-bottom:10px;padding:0 9px;color:white;
  text-shadow:0 1px black;
  background:#2b3e5d;
  border:1px solid #15243b;
  border-top-color:#0d1827;
  border-radius:4px;
  background-image:-webkit-linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.2) 20%, rgba(0,0,0,0));
  background-image:-moz-linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.2) 20%, rgba(0,0,0,0));
  background-image:-o-linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.2) 20%, rgba(0,0,0,0));
  background-image:linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.2) 20%, rgba(0,0,0,0));
  -webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,1),0 1px rgba(255,255,255,0.2);
  box-shadow:inset 0 1px 2px rgba(0,0,0,1),0 1px rgba(255,255,255,0.2);
}
.login-input:focus {
  outline:0;
  background-color:#32486d;
  -webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3),0 0 4px 1px rgba(255,255,255,0.6);
  box-shadow:inset 0 1px 2px rgba(0,0,0,0.3),0 0 4px 1px rgba(255,255,255,0.6);
}
.lt-ie9 .login-input {line-height:35px;}
.login-submit {
  display:block;width:100%;height:37px;margin-bottom:15px;font-size:14px;text-align:center;font-weight:bold;
  color:#294779;background:#adcbfa;border:1px solid #284473;border-bottom-color:#223b66;
  cursor:pointer;border-radius:4px;background-clip:padding-box;
  text-shadow:0 1px rgba(255,255,255,0.3);
  background-image:-webkit-linear-gradient(to bottom, #d0e1fe, #96b8ed);
  background-image:-moz-linear-gradient(to bottom, #d0e1fe, #96b8ed);
  background-image:-o-linear-gradient(to bottom, #d0e1fe, #96b8ed);
  background-image:linear-gradient(to bottom, #d0e1fe, #96b8ed);
  -webkit-box-shadow:
    inset 0 1px rgba(255,255,255,0.5),
    inset 0 0 7px rgba(255,255,255,0.4),
    0 1px 1px rgba(0,0,0,0.15);
  box-shadow:
    inset 0 1px rgba(255,255,255,0.5),
    inset 0 0 7px rgba(255,255,255,0.4),
    0 1px 1px rgba(0,0,0,0.15);
}
.login-submit:active {
  background:#a4c2f3;
  -webkit-box-shadow:inset 0 1px 5px rgba(0,0,0,0.4),0 1px rgba(255,255,255,0.1);
  box-shadow:inset 0 1px 5px rgba(0,0,0,0.4),0 1px rgba(255,255,255,0.1);
}
.login-help {text-align:center;}
.login-help > a {font-size:12px;text-decoration:none;text-shadow:0 -1px rgba(0,0,0,0.4);color:#d4deef;}
.login-help > a:hover {text-decoration:underline;}

::-moz-focus-inner {padding:0;border:0;}
::-moz-placeholder {color:#bcc0c8 !important;font-size:12px}
::-webkit-input-placeholder {color:#bcc0c8;font-size:12px}
:-ms-input-placeholder {color:#bcc0c8 !important;font-size:12px}

/*
.yzmOuter {position:absolute;top:100px;right:20px;width:100px;border:1px solid #ddd;background-color:rgb(102,102,102);text-align:center;display:none}
.yzmOuter i {position:absolute;left:50%;bottom:-20px;display:block;width:0;height:0;border:solid 10px;border-color:#ddd transparent transparent;margin-left:-10px}
.yzmOuter a:link,
.yzmOuter a:visited {display:block;height:20px;line-height:20px;font-size:12px;color:#036;text-decoration:none;background-color:#ddd}
.yzmOuter a:hover {color:#C30}
*/
.yzmOuter {float:right;position:relative;display:none;width:60px;height:32px;margin-top:-42px}
.yzmOuter img {border-radius:4px;cursor:pointer}
.yzmOuter i {display:none}
.yzmOuter a:link,
.yzmOuter a:visited {display:none}
</style>
</head>
<body>
<form name="login" id="login" method="post" action="ecmsadmin.php" autocomplete="off" class="login">
<input type="hidden" name="enews" value="login">
<input type="hidden" name="adminwindow" value="0">
<input type="hidden" name="empirecmskey1" id="empirecmskey1" value="<?php echo $empirecmskey1;?>">
<input type="hidden" name="empirecmskey2" id="empirecmskey2" value="<?php echo $empirecmskey2;?>">
<input type="hidden" name="empirecmskey3" id="empirecmskey3" value="<?php echo $empirecmskey3;?>">
<input type="hidden" name="empirecmskey4" id="empirecmskey4" value="<?php echo $empirecmskey4;?>">
<input type="hidden" name="empirecmskey5" id="empirecmskey5" value="<?php echo $empirecmskey5;?>">
<h1>拼酷官网-后台登录</h1>
<input type="text" name="username" class="login-input" placeholder="用户名 Username" autofocus>
<input type="password" name="password" class="login-input" placeholder="密码 Password">
<?php
//登录认证码,如果设置登录需要输入此认证码才能通过
if($ecms_config['esafe']['loginauth']){
?>
<input type="password" name="loginauth" id="loginauth" class="login-input" placeholder="认证码 Authentication code">
<?php
}
?>
<!--
<select name="equestion">
<option value="0">无安全提问</option>
<option value="1">母亲的名字</option>
<option value="2">爷爷的名字</option>
<option value="3">父亲出生的城市</option>
<option value="4">您其中一位老师的名字</option>
<option value="5">您个人计算机的型号</option>
<option value="6">您最喜欢的餐馆名称</option>
<option value="7">驾驶执照的最后四位数字</option>
</select>
<input type="text" name="eanswer" id="eanswer" class="login-input" placeholder="答案 Answer">
-->
<?php
if(empty($public_r['adminloginkey'])){
?>
<input type="text" name="key" class="login-input" placeholder="验证码 Code">
<div id="yzmOuter" class="yzmOuter"><i></i><img src="ShowKey.php"><a href="javascript:void(0)">单击更换验证码</a></div>
<?php
}
?>
<input type="submit" name="imageField" value="登录" class="login-submit">
<p class="login-help"><a href="../../" target="_blank">返回网站首页</a></p>
</form>
<script type="text/javascript">
if(self!=top){
  parent.location.href='index.php';
}

(function(){
if(!window["ADS"]){window["ADS"] = {};}
function isCompatible(other) {
  if(other === false || !Array.prototype.push || !Object.hasOwnProperty || !document.createElement || !document.getElementsByTagName) {
    return false;
  }
  return true;
}
window["ADS"]["isCompatible"] = isCompatible;

function $() {
  var elements = new Array();
  for(var i=0; i<arguments.length; i++) {
    var element = arguments[i];
    if(typeof element == "string") {
      element = document.getElementById(element);
    }
    if(arguments.length == 1) {
      return element;
    }
    elements.push(element);
  }
  return elements;
};
window["ADS"]["$"] = $;

function addEvent(node, type, listener){
  if(!isCompatible()){return false;}
  if(!(node=$(node))){return false;}
  if(node.addEventListener){
    node.addEventListener(type, listener, false);
    return true;
  }else if(node.attachEvent){
    node["e"+type+listener] = listener;
    node[type+listener] = function(){
      node["e"+type+listener](window.event);
    }
    node.attachEvent("on"+type, node[type+listener]);
    return true;
  }
  return false;
};
window["ADS"]["addEvent"] = addEvent;

function getEventObject(W3CEvent){
  return W3CEvent || window.event;
}
window["ADS"]["getEventObject"] = getEventObject;

function preventDefault(eventObject){
  eventObject = eventObject || getEventObject(eventObject);
  if(eventObject.preventDefault){
    eventObject.preventDefault();
  }else{
    eventObject.returnValue = false;
  }
}
window["ADS"]["preventDefault"] = preventDefault;

function getLeft(element){
  if(!(element=$(element))) return false;
  var iLeft=0;
  while(element!=document.body){
    iLeft+=element.offsetLeft;
    element=element.offsetParent;
  }
  return iLeft;
}
window["ADS"]["getLeft"] = getLeft;

function getTop(element){
  if(!(element=$(element))) return false;
  var iTop=0;
  while(element!=document.body) {
    iTop+=element.offsetTop;
    element=element.offsetParent;
  }
  return iTop;
}
window["ADS"]["getTop"] = getTop;
})();

document.forms["login"].style.marginTop = -(document.forms["login"].offsetHeight/2) + "px";

ADS.addEvent(window,"load",function(){
  document.forms["login"].elements["username"].focus();
});
if(document.forms["login"].elements["equestion"]){
  if(document.forms["login"].elements["equestion"].value==0){
    document.forms["login"].elements["eanswer"].style.display="none";
  }
  ADS.addEvent(document.forms["login"].elements["equestion"],"change",function(){
    if(this.options[this.selectedIndex].value==0){
      document.forms["login"].elements["eanswer"].style.display="none";
    }else{
      document.forms["login"].elements["eanswer"].style.display="";
    }
  });
}
ADS.addEvent(document.forms["login"],"submit",function(eventObject){
  if(this.elements["username"].value==""){
    alert("请输入用户名");
    this.elements["username"].focus();
    ADS.preventDefault(eventObject);
    return;
  }
  if(this.elements["password"].value==""){
    alert("请输入登录密码");
    this.elements["password"].focus();
    ADS.preventDefault(eventObject);
    return;
  }
  if(this.elements["loginauth"]!=null){
    if(this.elements["loginauth"].value==""){
      alert("请输入认证码");
      this.elements["loginauth"].focus();
      ADS.preventDefault(eventObject);
      return;
    }
  }
  if(this.elements["key"]!=null){
    if(this.elements["key"].value==""){
      alert("请输入验证码");
      this.elements["key"].focus();
      ADS.preventDefault(eventObject);
      return;
    }
  }
});
<?php if(empty($public_r['adminloginkey'])){ ?>
ADS.addEvent(document.forms["login"].elements["key"],"focus",function(){
  ADS.$("yzmOuter").style.display="block";
});
ADS.addEvent(document.getElementById("yzmOuter").getElementsByTagName("a")[0],"click",function(){
  document.getElementById("yzmOuter").getElementsByTagName("img")[0].src=document.getElementById("yzmOuter").getElementsByTagName("img")[0].src+'?'+Math.random();
});
ADS.addEvent(document.getElementById("yzmOuter").getElementsByTagName("img")[0],"click",function(){
  this.src=this.src+'?'+Math.random();
});
<?php }?>
</script>
</body></html>
顶部中部底部