diff --git a/src/admin/ad_add.php b/src/admin/ad_add.php
index 0240df2e..5ab66d7e 100644
--- a/src/admin/ad_add.php
+++ b/src/admin/ad_add.php
@@ -39,7 +39,7 @@ if ($dopost == "save") {
} else {
$height = "height=\"{$normbody['height']}\"";
}
- $normbody = "";
+ $normbody = "
";
} else {
if (empty($normbody['width'])) {
$width = "";
diff --git a/src/admin/archives_do.php b/src/admin/archives_do.php
index e50771c1..639218ba 100644
--- a/src/admin/archives_do.php
+++ b/src/admin/archives_do.php
@@ -149,7 +149,7 @@ else if ($dopost == "uploadLitpic") {
if (parent.document.getElementById('divpicview'))
{
parent.document.getElementById('divpicview').style.width = '150px';
- parent.document.getElementById('divpicview').innerHTML = \"
\";
+ parent.document.getElementById('divpicview').innerHTML = \"
\";
}
";
} else {
diff --git a/src/admin/dialog/select_images.php b/src/admin/dialog/select_images.php
index 0f764a0e..5c280a8f 100644
--- a/src/admin/dialog/select_images.php
+++ b/src/admin/dialog/select_images.php
@@ -117,7 +117,7 @@ if (!empty($iseditor)) {
if ($activepath == "") continue;
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath);
$line = "
该会员关连网站管理员,修改不当会导致无法登录 | ';?>
|
- ".$row['userid']." ";?> +".$row['userid']." ";?>diff --git a/src/install/index.php b/src/install/index.php index 6b968c28..0557fd44 100644 --- a/src/install/index.php +++ b/src/install/index.php @@ -103,15 +103,15 @@ else if ($step==2) { $db = new SQLite3(DEDEDATA.'/'.$dbname.'.db'); } else { $dbtype = 'mysql'; - $conn = mysql_connect($dbhost,$dbuser,$dbpwd) or die(""); - mysql_query("CREATE DATABASE IF NOT EXISTS `".$dbname."`;",$conn); + $conn = mysql_connect($dbhost, $dbuser, $dbpwd) or die(""); + mysql_query("CREATE DATABASE IF NOT EXISTS `".$dbname."`;", $conn); mysql_select_db($dbname, $conn) or die(""); //获得数据库版本信息 - $rs = mysql_query("SELECT VERSION();",$conn); + $rs = mysql_query("SELECT VERSION();", $conn); $row = mysql_fetch_array($rs); $mysqlVersions = explode('.',trim($row[0])); $mysqlVersion = $mysqlVersions[0].".".$mysqlVersions[1]; - mysql_query("SET NAMES '$dblang',character_set_client=binary,sql_mode='';",$conn); + mysql_query("SET NAMES '$dblang',character_set_client=binary,sql_mode='';", $conn); } $fp = fopen(dirname(__FILE__)."/common.inc.php","r"); $configStr1 = fread($fp,filesize(dirname(__FILE__)."/common.inc.php")); @@ -120,33 +120,33 @@ else if ($step==2) { $configStr2 = fread($fp,filesize(dirname(__FILE__)."/config.cache.inc.php")); fclose($fp); //common.inc.php - $configStr1 = str_replace("~dbtype~",$dbtype,$configStr1); - $configStr1 = str_replace("~dbhost~",$dbhost,$configStr1); - $configStr1 = str_replace("~dbname~",$dbname,$configStr1); - $configStr1 = str_replace("~dbuser~",$dbuser,$configStr1); - $configStr1 = str_replace("~dbpwd~",$dbpwd,$configStr1); - $configStr1 = str_replace("~dbprefix~",$dbprefix,$configStr1); - $configStr1 = str_replace("~dblang~",$dblang,$configStr1); + $configStr1 = str_replace("~dbtype~", $dbtype, $configStr1); + $configStr1 = str_replace("~dbhost~", $dbhost, $configStr1); + $configStr1 = str_replace("~dbname~", $dbname, $configStr1); + $configStr1 = str_replace("~dbuser~", $dbuser, $configStr1); + $configStr1 = str_replace("~dbpwd~", $dbpwd, $configStr1); + $configStr1 = str_replace("~dbprefix~", $dbprefix, $configStr1); + $configStr1 = str_replace("~dblang~", $dblang, $configStr1); @chmod(DEDEDATA,0777); $fp = fopen(DEDEDATA."/common.inc.php","w") or die(""); - fwrite($fp,$configStr1); + fwrite($fp, $configStr1); fclose($fp); //config.cache.inc.php $cmspath = trim(preg_replace("#\/{1,}#", '/', $cmspath)); if ($cmspath!='' && !preg_match("#^\/#", $cmspath)) $cmspath = '/'.$cmspath; if ($cmspath=='') $indexUrl = '/'; else $indexUrl = $cmspath; - $configStr2 = str_replace("~baseurl~",$baseurl,$configStr2); - $configStr2 = str_replace("~basepath~",$cmspath,$configStr2); - $configStr2 = str_replace("~indexurl~",$indexUrl,$configStr2); - $configStr2 = str_replace("~cookieEncode~",$cookieencode,$configStr2); - $configStr2 = str_replace("~webname~",$webname,$configStr2); - $configStr2 = str_replace("~adminmail~",$adminmail,$configStr2); + $configStr2 = str_replace("~baseurl~", $baseurl, $configStr2); + $configStr2 = str_replace("~basepath~", $cmspath, $configStr2); + $configStr2 = str_replace("~indexurl~", $indexUrl, $configStr2); + $configStr2 = str_replace("~cookieEncode~", $cookieencode, $configStr2); + $configStr2 = str_replace("~webname~", $webname, $configStr2); + $configStr2 = str_replace("~adminmail~", $adminmail, $configStr2); $fp = fopen(DEDEDATA.'/config.cache.inc.php','w'); - fwrite($fp,$configStr2); + fwrite($fp, $configStr2); fclose($fp); $fp = fopen(DEDEDATA.'/config.cache.bak.php','w'); - fwrite($fp,$configStr2); + fwrite($fp, $configStr2); fclose($fp); if ($mysqlVersion >= 4.1) { $sql4tmp = "ENGINE=MyISAM DEFAULT CHARSET=".$dblang; @@ -159,30 +159,30 @@ else if ($step==2) { $line = rtrim(fgets($fp,1024)); if (preg_match("#;$#", $line)) { $query .= $line."\n"; - $query = str_replace('#@__',$dbprefix,$query); + $query = str_replace('#@__', $dbprefix, $query); if ($dbtype == 'sqlite') { - $query = preg_replace('/character set (.*?) /i','',$query); - $query = preg_replace('/unsigned/i','',$query); - $query = str_replace('TYPE=MyISAM','',$query); - $query = preg_replace ('/TINYINT\(([\d]+)\)/i','INTEGER',$query); - $query = preg_replace ('/mediumint\(([\d]+)\)/i','INTEGER',$query); - $query = preg_replace ('/smallint\(([\d]+)\)/i','INTEGER',$query); - $query = preg_replace('/int\(([\d]+)\)/i','INTEGER',$query); - $query = preg_replace('/auto_increment/i','PRIMARY KEY AUTOINCREMENT',$query); - $query = preg_replace('/,([\t\s ]+)KEY(.*?)MyISAM;/','',$query); - $query = preg_replace('/,([\t\s ]+)KEY(.*?);/',');',$query); - $query = preg_replace('/,([\t\s ]+)UNIQUE KEY(.*?);/',');',$query); - $query = preg_replace('/set\(([^\)]*?)\)/','varchar',$query); - $query = preg_replace('/enum\(([^\)]*?)\)/','varchar',$query); - if (preg_match("/PRIMARY KEY AUTOINCREMENT/",$query)) { - $query = preg_replace('/,([\t\s ]+)PRIMARY KEY([\t\s ]+)\(`([0-9a-zA-Z]+)`\)/i','',$query); + $query = preg_replace('/character set (.*?) /i','', $query); + $query = preg_replace('/unsigned/i','', $query); + $query = str_replace('TYPE=MyISAM','', $query); + $query = preg_replace ('/TINYINT\(([\d]+)\)/i','INTEGER', $query); + $query = preg_replace ('/mediumint\(([\d]+)\)/i','INTEGER', $query); + $query = preg_replace ('/smallint\(([\d]+)\)/i','INTEGER', $query); + $query = preg_replace('/int\(([\d]+)\)/i','INTEGER', $query); + $query = preg_replace('/auto_increment/i','PRIMARY KEY AUTOINCREMENT', $query); + $query = preg_replace('/,([\t\s ]+)KEY(.*?)MyISAM;/','', $query); + $query = preg_replace('/,([\t\s ]+)KEY(.*?);/',');', $query); + $query = preg_replace('/,([\t\s ]+)UNIQUE KEY(.*?);/',');', $query); + $query = preg_replace('/set\(([^\)]*?)\)/','varchar', $query); + $query = preg_replace('/enum\(([^\)]*?)\)/','varchar', $query); + if (preg_match("/PRIMARY KEY AUTOINCREMENT/", $query)) { + $query = preg_replace('/,([\t\s ]+)PRIMARY KEY([\t\s ]+)\(`([0-9a-zA-Z]+)`\)/i','', $query); } $db->exec($query); } else { if (preg_match('#CREATE#i', $query)) { - $rs = mysql_query(preg_replace("#TYPE=MyISAM#i",$sql4tmp,$query),$conn); + $rs = mysql_query(preg_replace("#TYPE=MyISAM#i", $sql4tmp, $query), $conn); } else { - $rs = mysql_query($query,$conn); + $rs = mysql_query($query, $conn); } } $query=''; @@ -200,14 +200,14 @@ else if ($step==2) { if (preg_match("#;$#", $line)) { if ($dbtype == 'sqlite') { $query .= $line; - $query = str_replace('#@__',$dbprefix,$query); - $query = str_replace("\'","\"",$query); + $query = str_replace('#@__', $dbprefix, $query); + $query = str_replace("\'","\"", $query); $db->exec($query); } else { $query .= $line; - $query = str_replace('#@__',$dbprefix,$query); - if ($mysqlVersion < 4.1) $rs = mysql_query($query,$conn); - else $rs = mysql_query(str_replace('#~lang~#',$dblang,$query),$conn); + $query = str_replace('#@__', $dbprefix, $query); + if ($mysqlVersion < 4.1) $rs = mysql_query($query, $conn); + else $rs = mysql_query(str_replace('#~lang~#', $dblang, $query), $conn); } $query=''; } else if (!preg_match("#^(\/\/|--)#", $line)) { @@ -217,15 +217,15 @@ else if ($step==2) { fclose($fp); //更新配置 $cquery = "UPDATE `{$dbprefix}sysconfig` SET value='{$baseurl}' WHERE varname='cfg_basehost';"; - $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); + $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery, $conn); $cquery = "UPDATE `{$dbprefix}sysconfig` SET value='{$indexUrl}' WHERE varname='cfg_indexurl';"; - $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); + $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery, $conn); $cquery = "UPDATE `{$dbprefix}sysconfig` SET value='{$cookieencode}' WHERE varname='cfg_cookie_encode';"; - $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); + $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery, $conn); $cquery = "UPDATE `{$dbprefix}sysconfig` SET value='{$webname}' WHERE varname='cfg_webname';"; - $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); + $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery, $conn); $cquery = "UPDATE `{$dbprefix}sysconfig` SET value='{$adminmail}' WHERE varname='cfg_adminemail';"; - $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); + $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery, $conn); $pfd = "pwd"; $apwd = substr(md5($adminpwd),5,20); $upwd = md5($adminpwd); @@ -236,16 +236,16 @@ else if ($step==2) { } //添加管理员帐号 $adminquery = "INSERT INTO `{$dbprefix}admin` (`id`,`usertype`,`userid`,`$pfd`,`uname`,`tname`,`email`,`typeid`,`logintime`,`loginip`) VALUES (1,10,'$adminuser','".$apwd."','admin','','',0,'".time()."','127.0.0.1');"; - $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); + $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery, $conn); //关连前台会员帐号 $adminquery = "INSERT INTO `{$dbprefix}member` (`mid`,`mtype`,`userid`,`{$pfd}`,`uname`,`sex`,`rank`,`money`,`email`,`scores`,`matt`,`face`,`safequestion`,`safeanswer`,`jointime`,`joinip`,`logintime`,`loginip`) VALUES ('1','个人','$adminuser','".$upwd."','$adminuser','男','100','0','','10000','10','','0','','".time()."','','0',''); "; - $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); + $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery, $conn); $adminquery = "INSERT INTO `{$dbprefix}member_person` (`mid`,`onlynet`,`sex`,`uname`,`qq`,`msn`,`tel`,`mobile`,`place`,`oldplace`,`birthday`,`star`,`income`,`education`,`height`,`bodytype`,`blood`,`vocation`,`smoke`,`marital`,`house`,`drink`,`datingtype`,`language`,`nature`,`lovemsg`,`address`,`uptime`) VALUES ('1','1','男','{$adminuser}','','','','','0','0','1980-01-01','1','0','0','160','0','0','0','0','0','0','0','0','','','','','0'); "; - $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); + $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery, $conn); $adminquery = "INSERT INTO `{$dbprefix}member_tj` (`mid`,`article`,`album`,`archives`,`homecount`,`pagecount`,`feedback`,`friend`,`stow`) VALUES ('1','0','0','0','0','0','0','0','0'); "; - $dbtype == 'sqlite'? $db->exec($adminquery): mysql_query($adminquery,$conn); + $dbtype == 'sqlite'? $db->exec($adminquery): mysql_query($adminquery, $conn); $adminquery = "INSERT INTO `{$dbprefix}member_space` (`mid`,`pagesize`,`matt`,`spacename`,`spacelogo`,`spacestyle`,`sign`,`spacenews`) VALUES ('1','10','0','{$adminuser}的个人主页','','person','',''); "; - $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); + $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery, $conn); //锁定程序安装 $fp = fopen(INSLOCKFILE,'w'); fwrite($fp,'ok'); @@ -258,13 +258,13 @@ else if ($step==10) { header("Pragma:no-cache\r\n"); header("Cache-Control:no-cache\r\n"); header("Expires:0\r\n"); - $conn = @mysql_connect($dbhost,$dbuser,$dbpwd); + $conn = @mysql_connect($dbhost, $dbuser, $dbpwd); $info = ""; if ($conn) { if (empty($dbname)) { - $info = "信息正确"; + $info = "数据库连接正确"; } else { - $info = mysql_select_db($dbname,$conn)? "数据库已经存在,系统覆盖数据库": "数据库不存在,系统自动创建"; + $info = mysql_select_db($dbname, $conn)? "数据库已存在,系统将覆盖数据库": "数据库不存在,系统将创建数据库"; } $result = array( "code" => 200, @@ -272,10 +272,9 @@ else if ($step==10) { ); echo json_encode($result); } else { - $err = mysql_error(); $result = array( "code" => -1, - "data" => "数据库连接失败,错误信息:{$err}", + "data" => "数据库连接失败", ); echo json_encode($result); } diff --git a/src/static/web/css/admin.css b/src/static/web/css/admin.css index a3b2710e..f55a48de 100644 --- a/src/static/web/css/admin.css +++ b/src/static/web/css/admin.css @@ -5,7 +5,7 @@ body{margin:0;line-height:1.6;letter-spacing:0.5px;font-size:14px;font-family:Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;color:#6c757d;background:#fff} a{color:#6c757d;text-decoration:none} a:hover{color:#007bff;text-decoration:none} -img{margin-right:10px;max-width:100%;border-radius:0.5rem} +img{max-width:100%;border-radius:0.5rem} ul,ol,li{margin:0;padding:0} li{list-style:none} form,label{margin-bottom:0} @@ -35,21 +35,20 @@ input:focus,select:focus,textarea:focus{color:#6c757d;background:#fff;border-col .login-from{margin:5rem auto;width:500px} .login-box{padding:1.25rem;background:#fff} .login-box h2{margin:0;line-height:1.2;font-size:24px;font-weight:600;color:#343a40} -.head{width:100%;height:60px;background:linear-gradient(45deg,#1eb867,#009688 80%)} -.head .logo{float:left;padding-left:30px;width:220px} -.head .logo .name a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff} -.head .logo .version a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff} -.head .logo .version{float:left;margin-top:18px;margin-left:5px;font-size:12px;color:#fff} -.head .item ul,.head .admin ul{margin:0} -.head .item ul li{float:left;position:relative;padding-left:30px;height:60px;line-height:60px} -.head .item ul li:first-child{padding-left:1rem} -.head .item ul li a,.head .admin ul li a{color:#fff} -.head .item ul li a:hover,.head .admin ul li a:hover{color:#dee2e6} -.head .item .search{position:absolute;top:20px;right:5px;height:20px;line-height:20px;color:#6c757d;background:0;border:0} -.head .admin{float:right;margin-right:30px;height:60px;line-height:60px} -.head .admin img{width:30px;height:30px;border-radius:50%} -.head .admin ul li{float:left;padding-left:30px;height:60px;line-height:60px} -.head .admin ul li:first-child{padding-left:0} +.admin-head{width:100%;height:60px;background:linear-gradient(45deg,#1eb867,#009688 80%)} +.admin-head .logo{float:left;padding-left:30px;width:220px} +.admin-head .logo .name a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff} +.admin-head .logo .version a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff} +.admin-head .logo .version{float:left;margin-top:18px;margin-left:5px;font-size:12px;color:#fff} +.admin-head .item ul li{float:left;position:relative;padding-left:30px;height:60px;line-height:60px} +.admin-head .item ul li:first-child{padding-left:1rem} +.admin-head .item ul li a,.admin-head .user ul li a{color:#fff} +.admin-head .item ul li a:hover,.admin-head .user ul li a:hover{color:#dee2e6} +.admin-head .item .search{position:absolute;top:20px;right:5px;height:20px;line-height:20px;color:#6c757d;background:0;border:0} +.admin-head .user{float:right;margin-right:30px;height:60px;line-height:60px} +.admin-head .user img{margin-right:0.5rem;width:30px;height:30px;border-radius:50%} +.admin-head .user ul li{float:left;padding-left:30px;height:60px;line-height:60px} +.admin-head .user ul li:first-child{padding-left:0} body.menu-hide .menu-left{display:none} body.menu-hide .body-right{left:0;transition:all 0.5s} body.menu-show .menu-left{display:block} |