Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Commit

Permalink
统一设置
Browse files Browse the repository at this point in the history
  • Loading branch information
kagurazakayashi committed Sep 2, 2015
1 parent 16d4554 commit 7819846
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 42 deletions.
7 changes: 3 additions & 4 deletions emostore_admin_add_do.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html><head><meta charset="utf-8"><title>云颜文字·源商店:添加数据</title></head><body>
<center>云颜文字·源商店<h1>添加数据</h1></center>
<?php
include 'emostore_admin_sqlsetting.php';
session_start();
if (isset($_SESSION['username'])) {
if ($_SESSION['userflag'] == 1) {
Expand All @@ -15,17 +16,15 @@
echo "没有登录任何用户,请先<a href='emostore_admin_login_ui.php?backurl=".$_SERVER['PHP_SELF']."'>登录</a>。";
die("<hr><p><b>访问受限:</b>必须使用管理员账户登录才可以继续哦。</p>");
}
include 'emostore_admin_sqlsetting.php';
@mysql_connect($db_host,$db_user,$db_password)
or die("<hr><p><b>数据库连接失败</p>");
@mysql_select_db($db_name)
or die("<hr><p><b>选择数据库失败</p>");
$keys = ["name","iconurl","postedon","introduction","creator","creatorurl","server","serverurl","dataformat","installurl","codeurl"];
$isok = true;
echo "<hr><table border=0 align=\"center\" width=800><tbody>";
$sqlkey = "`";
$sqlval = "'";
for ($i = 0; $i < count($keys); $i++) {
for ($i = 1; $i < count($keys); $i++) {
$nowkey = mysql_real_escape_string($keys[$i]);
if (isset($_POST[$nowkey])) {
$nowval = mysql_real_escape_string($_POST[$nowkey]);
Expand All @@ -48,4 +47,4 @@
$query = @mysql_query($sql)
or die("<p><b>SQL语句执行失败。</b></p>");
echo "<p><b>条目添加成功。</b></p>";
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p></body></html>
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p><?php echo $footer; ?></body></html>
9 changes: 4 additions & 5 deletions emostore_admin_alldata.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<html><head><meta charset="utf-8"><title>云颜文字·源商店:数据库内容管理</title></head><body>
<center>云颜文字·源商店<h1>数据库内容管理</h1></center>
<center>当前登录的用户:
<?php
<?php

$pagenumber = 10;//一页内有多少条数据
session_start();
include 'emostore_admin_sqlsetting.php';
if (isset($_SESSION['username'])) {
if ($_SESSION['userflag'] == 1) {
echo "管理员:".$_SESSION['username']."。<a href='emostore_admin_logout.php?backurl=".$_SERVER['PHP_SELF']."'>注销</a>。";
Expand All @@ -17,7 +19,6 @@
echo "没有登录任何用户,请先<a href='emostore_admin_login_ui.php?backurl=".$_SERVER['PHP_SELF']."'>登录</a>。";
die("<hr><p><b>访问受限:</b>必须使用管理员账户登录才可以继续哦。</p>");
}
include 'emostore_admin_sqlsetting.php';
@mysql_connect($db_host,$db_user,$db_password)
or die("<hr><p><b>数据库连接失败</b></p>");
@mysql_select_db($db_name)
Expand Down Expand Up @@ -64,8 +65,6 @@
$arr[] = $row;
}
echo "<hr>";
$keys = ["id","name","iconurl","postedon","introduction","creator","creatorurl","server","serverurl","dataformat","installurl","codeurl"];
$keynames = ["内部ID(只读)","颜文字源名称","图标网址","登记日期","简介","维护者","维护者网站","服务器","服务器提供网址","云颜文字数据格式","软件调用网址","源代码网址"];
for ($i = 0; $i < count($arr); $i++) {
$arri = $arr[$i];
echo "<form name=\"edit".$arri["id"]."\" method=\"post\" action=\"emostore_admin_edit_do.php\">";
Expand Down Expand Up @@ -135,4 +134,4 @@
<form name="addnew" method="get" action="emostore_admin_cache.php">
<input type="submit" name="Submit" value="刷新缓存" />
</form>
</center></body></html>
</center><?php echo $footer; ?></body></html>
2 changes: 1 addition & 1 deletion emostore_admin_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
die("<hr><p><b>访问受限:</b>必须使用管理员账户登录才可以继续哦。</p>");
}
include 'emostore_admin_sqlsetting.php';
$keys = ["id","name","iconurl","postedon","introduction","creator","creatorurl","server","serverurl","dataformat","installurl","codeurl"];
@mysql_connect($db_host,$db_user,$db_password)
or die("<hr><p><b>数据库连接失败</b></p>");
@mysql_select_db($db_name)
Expand Down Expand Up @@ -105,4 +104,5 @@ function toYlt($arr,$keys) {
}
return $ylt;
}
echo $footer;
?></body></html>
2 changes: 1 addition & 1 deletion emostore_admin_delete_do.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
$query = @mysql_query($sql)
or die("<p><b>SQL语句执行失败。</b></p>");
echo "<p><b>条目删除成功。</b></p>";
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p></body></html>
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p><?php echo $footer; ?></body></html>
3 changes: 1 addition & 2 deletions emostore_admin_edit_do.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
or die("<hr><p><b>数据库连接失败</p>");
@mysql_select_db($db_name)
or die("<hr><p><b>选择数据库失败</p>");
$keys = ["id","name","iconurl","postedon","introduction","creator","creatorurl","server","serverurl","dataformat","installurl","codeurl"];
$isok = true;
echo "<hr><table border=0 align=\"center\" width=800><tbody>";
$sql = "update `emostore` set ";
Expand All @@ -47,4 +46,4 @@
echo "<p><b>条目修改成功。</b></p>";
// $query = @mysql_query("select count(*) from `emoticonstore`.`emostore`")
// or die("<hr><p><b>SQL语句执行失败1</p>");
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p></body></html>
?><p><a href="emostore_admin_alldata.php">返回源列表</a></p><?php echo $footer; ?></body></html>
2 changes: 1 addition & 1 deletion emostore_admin_login_do.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
if (isset($_POST['backurl'])) {
echo "<p><a href='".$_POST['backurl']."'>返回登录前页面</a></p>";
}
?></center></body></html>
?></center><?php echo $footer; ?></body></html>
4 changes: 4 additions & 0 deletions emostore_admin_login_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@
</dl>
</div>
</form>
<?php
include 'emostore_admin_sqlsetting.php';
echo $footer;
?>
</body></html>
6 changes: 5 additions & 1 deletion emostore_admin_logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
} else {
echo "<a href='emostore_admin_login_ui.php'>重新登录</a>";
}
?></center></body></html>
?></center>
<?php
include 'emostore_admin_sqlsetting.php';
echo $footer;
?></body></html>
4 changes: 4 additions & 0 deletions emostore_admin_sqlsetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
$user_table="emostoreadmin";
$data_table="emostore";
$query="set names 'utf-8'";
$keys = ["id","name","iconurl","postedon","introduction","creator","creatorurl","server","serverurl","dataformat","installurl","codeurl"];
$keynames = ["内部ID(只读)","颜文字源名称","图标网址","登记日期","简介","维护者","维护者网站","服务器","服务器提供网址","云颜文字数据格式","软件调用网址","源代码网址"];
//<?php echo $footer; ? >
$footer="<hr><center>源商店管理员后台 © 云颜文字团队 2015.<br>源商店 by 神楽坂雅詩,0wew0,神楽坂紫,KT.<br><a href=\"http://www.miitbeian.gov.cn/\" target=\"_blank\" title=\"此处为域名拥有者资料,并非内容提供者信息,请勿使用这些信息干扰他的生活,谢谢理解。如有问题请联系[email protected]\">京ICP备15023313号</a></center>";
?>
27 changes: 0 additions & 27 deletions untitled.xml

This file was deleted.

0 comments on commit 7819846

Please sign in to comment.