From b970e38c6cbde1e573c1d7a1d1b1685c1ca5bde1 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 18 Mar 2022 23:38:15 +0800 Subject: *admin login --- admin.php | 48 ++++++++++++++--------------------- admin_add_music.php | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ admin_header.php | 34 +++++++++++++++++++++++++ authentication.php | 17 +++++++++++++ checkadmin.php | 13 ++++++++++ config.php | 7 +++++- login.php | 41 ++++++++++++++++++++++++++++++ logout.php | 11 ++++++++ paginate.php | 20 +++++++-------- res/admin.css | 13 ++++++++++ res/styles.css | 11 +++++--- 11 files changed, 243 insertions(+), 44 deletions(-) create mode 100644 admin_add_music.php create mode 100644 admin_header.php create mode 100644 authentication.php create mode 100644 checkadmin.php create mode 100644 login.php create mode 100644 logout.php create mode 100644 res/admin.css diff --git a/admin.php b/admin.php index d75bc08..32e5604 100644 --- a/admin.php +++ b/admin.php @@ -20,6 +20,20 @@ form .section{ form .text { width: 100%; } + +#container a { + display:block; + text-decoration:none; + color:black; + padding:10px; + margin-bottom: 20px; +} +#container a:hover { + display:block; + text-decoration:none; + color:white; + background:black; +} @@ -29,38 +43,14 @@ form .text { - + + + Add Music -

Add Music

+ Add Album -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- -
-
-
- -
-
- -
+ Delete Tag
diff --git a/admin_add_music.php b/admin_add_music.php new file mode 100644 index 0000000..9599a8c --- /dev/null +++ b/admin_add_music.php @@ -0,0 +1,72 @@ + + + + + + + + + +
+ + + + + + + +

Add Music

+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+ +
+ + + + \ No newline at end of file diff --git a/admin_header.php b/admin_header.php new file mode 100644 index 0000000..3ea71e4 --- /dev/null +++ b/admin_header.php @@ -0,0 +1,34 @@ + + + + + +
+ Logout + Main + Music + Albums + Tags +
+ +
+ +
diff --git a/authentication.php b/authentication.php new file mode 100644 index 0000000..882650f --- /dev/null +++ b/authentication.php @@ -0,0 +1,17 @@ + + diff --git a/checkadmin.php b/checkadmin.php new file mode 100644 index 0000000..305b211 --- /dev/null +++ b/checkadmin.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/config.php b/config.php index b7e0e27..700fe83 100644 --- a/config.php +++ b/config.php @@ -20,8 +20,13 @@ class Config public static $cover_upload_dir = "./cover"; public static $project_upload_dir = "./project"; - // + // public static $music_per_page = 42; + + + public static $admin_token = "123"; + public static $cookie_lifetime = 24*3600; //秒 + } ?> \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..5bd43c6 --- /dev/null +++ b/login.php @@ -0,0 +1,41 @@ + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ + + diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..9cb285c --- /dev/null +++ b/logout.php @@ -0,0 +1,11 @@ + + diff --git a/paginate.php b/paginate.php index c6ce295..e276f53 100644 --- a/paginate.php +++ b/paginate.php @@ -6,16 +6,16 @@ // echo $total_page ; // echo $url; - - for ($p=0; $p<$total_page; $p++) { - if($p == $current_page_index){ - html_paginate_link_current($url, $p); - } - else { - html_paginate_link($url, $p); - } - } - + if($total_page > 1){ + for ($p=0; $p<$total_page; $p++) { + if($p == $current_page_index){ + html_paginate_link_current($url, $p); + } + else { + html_paginate_link($url, $p); + } + } + } ?>
diff --git a/res/admin.css b/res/admin.css new file mode 100644 index 0000000..64b6fc8 --- /dev/null +++ b/res/admin.css @@ -0,0 +1,13 @@ + +body{ + background:#3a3a3a; +} + +#container{ + background:white; + margin-top:0; + min-height:100%; + padding:10px; + box-sizing: border-box; +} + diff --git a/res/styles.css b/res/styles.css index eaf5ad3..cb0e0a3 100644 --- a/res/styles.css +++ b/res/styles.css @@ -5,6 +5,7 @@ body{ */ background-color: #3a3a3a; margin-top: 0; + margin-bottom: 0; } #header{ @@ -21,9 +22,11 @@ body{ #container { margin:0 auto; - max-width: 720px; + max-width: 730px; background-color: #fff; min-height: 100%; + box-sizing: border-box; + padding: 5px; } #container-uppper { @@ -106,7 +109,7 @@ body{ .tag_link { font-size: 80%; - color: #fff; + color: rgb(82, 82, 82); background: #ccc; text-decoration: none; padding: 3px 5px; @@ -124,8 +127,8 @@ body{ #titlebar { padding:6px; - border-top:1px solid #000; - border-bottom:1px solid #000; + border-top:1px solid rgb(223, 223, 223); + border-bottom:1px solid rgb(223, 223, 223); } #titlebar .title_link{ -- cgit v1.1-26-g67d0