Browse Source

前端基本上开发完成

root 4 years ago
parent
commit
b0aa98c6a4
9 changed files with 601 additions and 29 deletions
  1. 135 0
      GPL2.0 Explain.md
  2. 339 0
      LICENSE
  3. 1 0
      admin/index.php
  4. 44 0
      api/submit.php
  5. 3 2
      includes/header.php
  6. 8 0
      index.php
  7. 4 10
      pages/about.php
  8. 34 5
      pages/homepage.php
  9. 33 12
      pages/submit.php

+ 135 - 0
GPL2.0 Explain.md

@@ -0,0 +1,135 @@
+以下内容转载自[CSDN博客](https://blog.csdn.net/kaiyuanshe/article/details/106774438)
+
+**GPL 2.0许可证(人话版)**
+
+版本 2, 1991年6月
+
+版权 (C) :1989, 1991 Free Software Foundation, Inc.
+
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+你可以复制、发布本许可证,但不能修改本许可证。一个字都不能动。
+
+**开场白**
+
+我们设计GPL协议,目的很简单,就是给程序员自由,给用户自由!
+
+我们FSF的软件大都用这个协议,但并不是说只有我们能用,任何人都可以用这个协议!
+
+我们认为,人应该有这样的自由:
+
+**每个人都有分发软件的自由,而且可以为此收费。**
+
+(译者注:先讲下“分发”的概念,分发就是有人把软件卖给你、寄给你、发给你、拷给你、让你下载、帮你安装等等,只要你从他那儿搞到软件,就算他分发给你了。有时候会用“发布”一词,请视为等同。)
+
+(译者注:本文所讲的“程序”、“软件”、“作品”、“东西”、“玩意”,在绝大多数情况下,指的都是一个东西:自由软件,尤指使用GPL的软件。)
+
+每个人有获取源码的自由,人们要能得到软件的源码!
+
+为什么要有源码?
+
+**因为源码让程序员更自由,源码让用户更自由!**
+
+如果你懂,你就会懂的。
+
+不懂,我也没有时间说服你。
+
+**每个人有改动源码的自由!**
+
+就好比你娶个美女,只能看,不能动,那叫什么自由?
+
+**每个人都应该知道这些理念**,所以,本许可证带着这个开场白,而使用GPL的软件,都带着本许可证,就是为了让你看见。
+
+GPL协议的目的就是要确保做到上面这些。
+
+每个分发GPL软件的人,都要按照GPL的要求做。
+
+**记住:我们给了你自由,你要把这个自由传递下去。**
+
+**最基本的就是要把源码公开!**
+
+每个人都应该知道,程序可不是其他商品,写程序已经够费精神了,而且作者也没有收你钱,所以GPL的程序是AS IS的,也就是说作者不会负责任的。如果你修改了别人的程序,你要说明你修改了,这样,你带来的bug,不会影响人家原作者的声誉。
+
+我们绝不允许将自由软件专有化,你如果基于本程序做了修改,并对修改申请了专利,你就要把这个专利让所有人免费使用,要么你就不要发布。
+
+**条款和条件**
+
+0.先定义一下:如果一个作品包含本程序的全部或者部分,或者是对本程序做了修改,或者将本程序翻译成其他语言,那么,这个作品就是**基于本程序的**,也称**衍生程****序**或**衍生作品**。
+
+(译者注:注意,本文中的“本程序”,就是使用了GPL的程序,本程序发布时是带着本许可证的。)
+
+本协议管的是对本程序的复制、修改和分发。其他的事我不管。比如执行本程序是不受限制的,程序的输出也不受限制,除非输出内容的本身就是本程序的衍生作品。
+
+(译者注:事实上,只要你不分发,只是自己用用,都不会管的,比如你可以随便复制1000份放在你的硬盘上,你也可以随便改,只要你不拿出来传播就好。但如果你哪怕只是发给了小伙伴张三,那就要注意了,你要按GPL的要求做,否则就会违规。除非这个小伙伴和你一个公司而你们正在受公司之命使用或修改本程序。)
+
+(译者注:关于程序输出,可以考虑一下这些情景:你使用受GPL保护的软件LibreOffice写了一本书(这就是输出),这本书不受GPL限制;你用Emacs编辑器(GPL的)写了个程序(这就是输出),这个程序不受GPL限制;你用mysql(受GPL保护)做数据库并搭了个网站,这也不受GPL限制。但如果你用LibreOffice、Emacs编辑的是本程序的源码,或者用mysql数据库存储了本程序的源码,那就另当别论了,这你懂吧。)
+
+\1. **如果你要分发的是一字未改的本程序**(你从别人那儿搞到手的),记着必须要在明显的地方,带上本程序的版权声明、免责声明(或称无担保声明)、以及本许可证。而且必须是原封不动的本许可证和免责声明。
+
+(你应该知道为什么带这些吧,前面我已经大致说过了,这里再说一遍:第一,你要给原作者留名,人家写自由软件图啥?至少要给人家个名吧!第二,人家也没有收维保费,不能说有点bug还找人家算账,软件不好使,大家自己想办法。第三,要带上我这个GPL协议,要让所有人知道他的权利和义务,更重要的是,让他们看看我的开场白,理解我的初心。)
+
+你可以因为分发软件的具体行为收成本费。(比如你可以收制作光盘的费用,邮寄的费用,拷贝的费用,但你不能收研发费!你更不能收许可费!总之,你收的钱要说得过去!)
+
+你要是能提供维保服务,你可以收维保费。
+
+(译者注:所谓维保,也就是用户软件出故障了,你给人家解决bug,需要版本升级了,你给人家升级,发现安全漏洞了,你给人家补丁,用户不会用了,你给人家培训,这些活,都属于维保。原作者一般是不会干这个的,他更喜欢开发软件。)
+
+\2. **如果你要分发的是修改后的本程序**(或曰衍生程序),除了上面第1条的要求外,你还要满足以下条件。
+
+a) 对于你修改了的文件,你必须在那个文件上带上明显的修改声明,并附上日期信息。
+
+b) 哪怕你的软件有一点点含有或来自我的程序,你分发时,就要按照GPL,授权所有人都可免费使用、复制、修改、再分发你这个软件。
+
+c) 如果你修改后的程序在运行时和用户以命令的方式交互,你必须在程序运行的开始,显示版权声明、无担保声明(如果你有担保你就显示担保声明),你要告诉用户分发你程序时的条件,告诉用户如何读取本许可证。(如果本程序不显示这些,那你不需要专门改成这样)。
+
+(译者注:比如gdb运行时就会出来一堆这些声明。命令式交互并不仅限于“命令行”交互,完全可以是图形界面的命令式交互甚至是音频的交互,比如用户说:“小某小某”,程序说“在呢”,用户说:“你的许可是什么”,程序说:“我使用GPL许可……”)
+
+这些要求是对修改后作品的整体适用的,如果你的作品有一部分可以独立出来并且不是基于本程序的,那你单独发布这部分的时候,不需要遵守本许可证要求。但如果你要放到一块作为整体发布,那就得遵守规定。
+
+本条的意图,并不是掠夺你写的那部分程序,而是对基于本程序的软件整体,实施控制权。(因为这样,才能给人更多自由!)
+
+当然,如果一个程序仅仅是和本作品放在同一张光盘上、同一个U盘上、同一块活动硬盘上,而它本身不基于本程序,我们不会要求该程序遵守GPL的。(我们没有这么变态,也不会有人真以为能这样“传染”吧?!)
+
+\3. **如果你要分发本程序(或衍生程序)的目标代码或可执行文件**,除了满足前面第1条和第2条,还必须满足以下其中一条。
+
+a) 伴随这个目标代码或可执行文件,你必须提供机器可读的源代码。(要是你给我一本印在书上的源代码,可别怪我不客气。)而且你要使用拷贝软件常用的方式。(你别给我弄到纸带上,你是穿越来的吗?)**总之,别耍花样,老老实实交出源码**。
+
+b) 或者你这样做,你附上一个书面的报价单,有效期至少三年,收费不能超过成本费。(比如收费只是你制作光盘、制作U盘的费用。这样,用户在这几年内,想买的时候可以买。)
+
+c) 或者,如果你只是转一下手,把你收到的又转给别人,而且不是商业行为(比如只是发给朋友玩玩),那你带上获取源码的信息就可以了(如果是商业行为,你就得给源码,或者弄书面报价单了)。
+
+所谓源代码形式,就是那种最便于修改的形式。对于一个可执行程序,完整的源代码包括其所有模块的源代码、接口定义文件、编译程序的脚本、安装程序的脚本。但是,不包括内核、编译器这些操作系统主要部件的源码,这不是该你负责的部分,除非你的程序就是干这些事的。
+
+(总之,**提供源码就要提供完整的**,而且是便于编译的,即便是编程菜鸟,能应该能按照指示,简单几步就能把源码弄成可执行文件,如果你只是扔来一堆源码,而故意隐藏一些信息或制造一些编译上的难度,那只能说你道德低劣。)
+
+如果可执行文件(目标代码)的分发是在特定的地点完成的,那么,在同一地点也应该提供对源码的拷贝。当然,来拷贝可执行文件的人,完全可以选择不拷源码,不能强迫人家非要拷源码。
+
+\4. 除了本许可明确允许的方式,你不能复制、修改、分发和再许可本程序。如果你试图干这些事,本许可证授予你的权利将自动终止。但已经从你这里获得了拷贝的人,只要他们遵守规定,他们的授权并不会自动终止。
+
+(译者注:事实上,如果你不分发,只是自己用用,复制、修改的自由还是有的。)
+
+\5. 你可以不接受本许可证,但不接受你就不能修改和分发本程序(及衍生程序)。所以,你只要干了这些事,就表明你接受了本许可证。
+
+\6. 每当你发布本程序(或衍生程序)时,收到本程序的人,自动获得本程序原始授权人依本许可证所赋予的权利,你不能添加任何额外的限制。你也不用负责别人是不是按照本许可做。(译者注:由此可知,**一旦一个GPL的程序诞生,它的子子孙孙都会是GPL的。**)
+
+\7. 不管是哪种情况,比如法院判决、专利指控或其他情况,导致你无法遵从本许可证的条件,那也不代表你就可以搞特殊,如果你无法求得两全,那你就只能放弃发布。比如:如果一个专利许可要求那些从你这儿直接或间接收到程序的人,不能再免费地发布,这就和本许可冲突了。为了避免这种问题,你唯一能做的,就是不发布该程序。(译者注:**此即著名的“自由或死亡”条款**,“Liberty or Death”)
+
+不管在什么场景下,如果本条款的任何一部分不能执行或者被判定无效,其他部分也是有效的,且条款整体在其他场景下仍是有效的。
+
+本条的目的不是诱使你侵犯专利或知识产权,也不是让你去和别人争执更应该执行谁的条件,本条的唯一目的,就是保护GPL的完整性,而不是让它被支离破碎地执行,正是通过GPL的一致执行,很多人在相当广泛的软件领域里,做出了显著的贡献。
+
+原创作者有权利使用其他协议发布他的作品,我们任何人不能强迫原创作者必须使用GPL协议。
+
+本条试图彻底解释清楚其他条款所带来的可能后果。
+
+\8. 如果在某些国家因为专利或版权的问题难以分发,那么版权所有人在分发时,可以对分发的地区加以明确限制,以排除那些国家。在这种情况下,这些限制不认为是对本协议的修改。(译者注:算一种例外吧。)
+
+\9. FSF会不定时发布GPL的新版本,精神上应该不会大变,主要是细节上的变化,以及增加一些对新情况的规定。每一版都会有新的版本号,如果一个软件说使用“GPL 2.0 and later version”,这表示你可以用2.0,或者其后的某个版本,如果只说使用GPL 2 .0,那就只能用2.0,如果说使用GPL但没有指定版本号,那就可以任意选择一个FSF发布过的版本。
+
+\10. 如果你希望将本程序的一部分纳入采用其他许可证的自由软件中(译者注:注意自由软件有很多许可证,比如MIT、Apache),你要征得本程序作者的书面同意。如果他同意,那就可以。如果本程序的版权归FSF,那你得问我们,一般来说,我们的作品以及衍生作品都必须要用GPL的,但是,我们有时候也同意一些例外。(译者注:决策权当然是在作者这里的,作者想用什么许可就用什么许可。)我们的决策主要考虑两个目标,一是保证自由软件的子子孙孙都是自由的,二是促进软件的普遍共享和复用。
+
+**无担保声明**
+
+\11. 由于本程序是免费提供的,所以在法律许可范围内,本程序是没有担保的。除非有书面说明。本程序是“AS IS”的,没有任何明示或暗示的保证,比如默认的适销性、适用性这些保证都没有,关于本程序的功能和性能导致的风险都由用户自己承担,**(你单位用我作品出了事,你可别想拉我当垫背的,大公司都不背这锅,你让我一个不挣你钱的背?)**如果我这作品真有缺陷,你自己想办法搞定,你可以花钱买服务,这种公司又不是没有。
+
+\12. 除非是法律要求或者书面同意,否则在任何情况下,本程序的版权所有者,或者修改和重新发布本程序的其他人,都不会对你的任何损失负责,不管这个损失是一般的还是特殊的,不管是偶然的还是间接的,不管是本程序自己的问题,还是因为你不会用导致的,不管是数据丢失还是数据不准确,不管是你导致的,还是其他人导致的,亦或是本程序和其他程序共同导致的。即便版权所有者或修改人已经被告知有危险,他们也不会对此负责。**总之一句话,出事了你自己兜着**。

+ 339 - 0
LICENSE

@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.

+ 1 - 0
admin/index.php

@@ -0,0 +1 @@
+<?php?>

+ 44 - 0
api/submit.php

@@ -0,0 +1,44 @@
+<?php
+header('content-type:application/json');
+include('../config.php');
+include('../includes/function.php');
+$confessor = htmlspecialchars($_POST['name']);
+$contact = intval(htmlspecialchars($_POST['contact']));
+$ta = htmlspecialchars($_POST['taName']);
+$image = htmlspecialchars($_POST['image']);
+$introduction = htmlspecialchars($_POST['introduceTA']);
+$content = htmlspecialchars($_POST['toTA']);
+$timestamp = intval(htmlspecialchars($_POST['timestamp']));
+
+if (empty($confessor) || empty($contact) || empty($ta) || empty($introduction) || empty($content)) {
+    exit('{"code":-3,"msg":"表单未填写完整或存在错误!"}');
+}
+
+if ($timestamp - time() > 5 || time() - $timestamp > 5) {
+    exit('{"code":-5,"msg":"提交失败!请检查您的系统时间!"}');
+}
+
+$all = 'Kagamine Yes!'.strval($contact) . $confessor . $ta . $image . $introduction . $content . strval($timestamp);
+if (md5($all) != $_POST['key']) {
+    exit('{"code":-5,"msg":"出现了一个未知错误!请联系管理员!"}');
+}
+
+try {
+    $pdo = pdoConnect();
+    $stmt = $pdo->prepare("insert into loveway_data(id,confessor,contact,time,to_who,introduction,content,image)values(?,?,?,?,?,?,?,?)");
+    $stmt->bindValue(1, rand(100000000, 999999999));
+    $stmt->bindValue(2, $confessor);
+    $stmt->bindValue(3, $contact);
+    $stmt->bindValue(4, date("Y-m-d H:i:s", time()));
+    $stmt->bindValue(5, $ta);
+    $stmt->bindValue(6, $introduction);
+    $stmt->bindValue(7, $content);
+    $stmt->bindValue(8, $image);
+    if ($stmt->execute()) {
+        exit('{"code":1,"msg":"success"}');
+    } else {
+        exit('{"code":-2,"msg":"抱歉,出现了一个未知错误!请与管理员联系!"}');
+    }
+} catch (PDOException $e) {
+    exit('{"code":-1,"msg":"抱歉,出现了一个致命错误!请与管理员联系!"}');
+}

+ 3 - 2
includes/header.php

@@ -8,7 +8,7 @@
             echo getInfo('title') ?></title>
     <meta name="keywords" content="<?php echo getInfo('keywords') ?>">
     <meta name="description" content="<?php echo getInfo('description') ?>">
-    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/mdui.min.css"/>
+    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/mdui.min.css" />
     <style>
         .copyright {
             box-sizing: border-box;
@@ -36,7 +36,8 @@
             <span class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white " onclick="inst.open();"><i class="mdui-icon material-icons">menu</i></span>
             <a href="../" class="mdui-typo-headline mdui-hidden-xs"><?php echo $title; ?></a>
             <div class="mdui-toolbar-spacer"></div>
-            <button id="logout" onclick='clearAllCookie()' mdui-tooltip="{content: '退出登录'}" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white"><i class="mdui-icon material-icons">code</i></button>
+            <!-- 保护版权,请勿删除,如果不明白GPL2.0协议是什么,请查阅GPL2.0 Explain.MD,其中有人话版解释,欢迎查阅!-->
+            <button id="logout" onclick='window.open("https://www.wunote.cn")' mdui-tooltip="{content: '退出登录'}" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white"><i class="mdui-icon material-icons">code</i></button>
         </div>
     </header>
     <div class="mdui-drawer" id="main-drawer">

+ 8 - 0
index.php

@@ -1,4 +1,12 @@
 <?php
+// [未知表白墙]
+// Copyright (C) 2021, 吴先森
+// 本程序是一个自由软件,你可以重新分发它,可以修改它,但要遵守GPL 2.0版本或者后续其他版本。
+// 我们希望本程序是有用的,但是我们不保证它能用,不保证它好用,我们不提供任何保证。
+// 更多请见GPL全文,如果理解不了,找人话版看看。
+// 按道理你在得到本软件时,应该已经得到一份GPL,如果你没找到,写信给自由软件基金会(FSF):
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110‐1301, USA
+// [email protected]
 include('./config.php');
 include('./includes/function.php');
 $templateMode = empty($_GET['_pjax']);

+ 4 - 10
pages/about.php

@@ -16,17 +16,11 @@
     <!-- 卡片的内容 -->
     <div class="mdui-card-content">
         <div class="mdui-typo">
-        <?php echo getInfo('about')?>
+        <?php echo getInfo('about_content')?>
+        <br><br><div class="mdui-divider"></div><br>
+        程序版本:V1.2.4<br />
+        作者博客:<a href="https://www.wunote.cn" class="text-decoration: none;">吴先森的笔记</a><br />作者邮箱:[email protected]<br>
         </div>
     </div>
-    <!--
-        <div class="mdui-card-actions">
-          <button class="mdui-btn mdui-btn-icon mdui-float-right">
-            <i class="mdui-icon material-icons">share</i>
-          </button>
-          <button class="mdui-btn mdui-btn-icon mdui-float-right">
-            <i class="mdui-icon material-icons">more</i>
-          </button>
-        </div>-->
 </div>
 <br /><br />

+ 34 - 5
pages/homepage.php

@@ -1,9 +1,35 @@
+<script>
+    function RandomNumBoth(Min, Max) {
+        var Range = Max - Min;
+        var Rand = Math.random();
+        var num = Min + Math.round(Rand * Range);
+        return num;
+    }
+
+    function randomImage() {
+        var img = event.srcElement;
+        img.onerror = null;
+        var xhr = new XMLHttpRequest();
+        xhr.onreadystatechange = function() {
+            switch (xhr.readyState) {
+                case 4:
+                    if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
+                        imgURL = 'https://img.llilii.cn/kagamine/'+JSON.parse(xhr.responseText)['file_name'][RandomNumBoth(0, JSON.parse(xhr.responseText)['file_num'])];
+                        img.src = imgURL;
+                    }
+                    break;
+            }
+        }
+        xhr.open('get', 'https://static.llilii.cn/json/img_list.json');
+        xhr.send(null);
+    }
+</script>
 <?php
 
 $a = 0;
 try {
     $pdo = pdoConnect();
-    $stmt = $pdo->prepare("select * from loveway_data");
+    $stmt = $pdo->prepare("select * from loveway_data ORDER BY time ASC");
     if ($stmt->execute()) {
         while ($row = $stmt->fetch()) {
 ?>
@@ -22,7 +48,7 @@ try {
                     if (!empty($row['image'])) {
                     ?>
                         <div v-if="data.image != ''">
-                            <img style="max-height: 1000px" onerror="randomImage(data.image)" src="<?php echo $row['image']; ?>" />
+                            <img style="max-height: 2000px" onerror="randomImage()" src="<?php echo $row['image']; ?>" />
                         </div>
                     <?php
                     } else {
@@ -46,10 +72,13 @@ try {
                     <?php echo $row['content']; ?>
                 </div>
                 <div class="mdui-card-actions">
-                    <a target="_blank" href="<?php if ($REWRITE) echo "/card/".$row['id']; else echo '/?page=card&id='.$row['id'];?>" class="mdui-btn mdui-btn-icon mdui-float-right">
+                    <a target="_blank" href="<?php if ($REWRITE) echo "/card/" . $row['id'];
+                                                else echo '/?page=card&id=' . $row['id']; ?>" class="mdui-btn mdui-btn-icon mdui-float-right">
                         <i class="mdui-icon material-icons">more</i>
                     </a>
-                    <a class="copy mdui-btn mdui-btn-icon mdui-float-right" href="javascript:void(0);" data-clipboard-text="<?php echo get_http_type().$_SERVER['SERVER_NAME']; if ($REWRITE) echo "/card/" . $row['id']; else echo '/?page=card&id=' . $row['id']; ?>"><i class="mdui-icon material-icons">share</i></a>
+                    <a class="copy mdui-btn mdui-btn-icon mdui-float-right" href="javascript:void(0);" data-clipboard-text="<?php echo get_http_type() . $_SERVER['SERVER_NAME'];
+                                                                                                                            if ($REWRITE) echo "/card/" . $row['id'];
+                                                                                                                            else echo '/?page=card&id=' . $row['id']; ?>"><i class="mdui-icon material-icons">share</i></a>
                     </a>
                 </div>
             </div>
@@ -63,4 +92,4 @@ try {
     return 'database connection failed';
     //echo $e->getMessage();
 }
-?>
+?>

+ 33 - 12
pages/submit.php

@@ -33,22 +33,35 @@
     </div>
 
     <div class="mdui-card-actions">
-        <button :disabled="isdisabledFn" class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-float-right" onclick="submit()">
+        <button id="submitbtn" class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-float-right" onclick="submit()">
             发射!
         </button>
     </div>
     <script>
         function submit() {
+            $("#submitbtn").attr("disabled", true);
             var contact = $("#qq").val();
             var name = $("#name").val();
             var taName = $("#taName").val();
             var image = $("#image").val();
             var introduceTA = $("#introduceTA").val();
             var toTA = $("#toTA").val();
+            var timestamp = this.timestamp = Date.parse(new Date()) / 1000;
+            var key = $.md5(
+                'Kagamine Yes!' +
+                contact +
+                name +
+                taName +
+                image +
+                introduceTA +
+                toTA +
+                timestamp)
             $.ajax({
                 type: 'post',
-                url: 'create',
+                url: '/api/submit.php',
                 data: {
+                    key: key,
+                    timestamp: timestamp,
                     contact: contact,
                     name: name,
                     taName: taName,
@@ -58,16 +71,24 @@
                 },
                 dataType: 'text',
                 success: function(data) {
-                    if (data == 1) {
-                        Swal.fire({
-                            type: 'success',
-                            title: '成功',
-                            text: '工单提交完毕!请在工单列表查看,并耐心等待客服回复',
-                        }).then((result) => {
-                            if (result.value) {
-                                window.location.reload();
-                            }
-                        })
+                    console.log(data)
+                    data = JSON.parse(data);
+                    if (data.code == 1) {
+                        mdui.snackbar({
+                            message: '提交成功!',
+                            position: 'right-top'
+                        });
+                        $("#qq").val("");
+                        $("#name").val("");
+                        $("#taName").val("");
+                        $("#image").val("");
+                        $("#introduceTA").val("");
+                        $("#toTA").val("");
+                    } else {
+                        mdui.snackbar({
+                            message: data.msg,
+                            position: 'right-top'
+                        });
                     }
                     $("#submitbtn").attr("disabled", false);
                 },