初次创建
|
@ -0,0 +1,22 @@
|
|||
+======================================+
|
||||
Discuz! X3.3 Release 20170101
|
||||
+======================================+
|
||||
兼容 PHP7
|
||||
优化SQL查询
|
||||
修复安全问题
|
||||
|
||||
+--------------------------------------+
|
||||
往日版本( Old Version )
|
||||
+--------------------------------------+
|
||||
Discuz! X1 Beta Release 20100501
|
||||
Discuz! X1 Release 20100518
|
||||
Discuz! X1 Release 20100601
|
||||
Discuz! X1 Release 20100613
|
||||
Discuz! X1 Release 20100723
|
||||
Discuz! X1.5RC Release 20100901
|
||||
Discuz! X1.5
|
||||
Discuz! X2
|
||||
Discuz! X2.5
|
||||
Discuz! X3
|
||||
Discuz! X3.1
|
||||
Discuz! X3.2
|
|
@ -0,0 +1,95 @@
|
|||
||==================================||
|
||||
Discuz! X 转换文档
|
||||
||==================================||
|
||||
|
||||
本文档用于帮助您将原有社区产品转换或者转换到 Discuz! X 系列产品。
|
||||
在您开始转换之前,请务必逐条仔细阅读以下的注意事项:
|
||||
|
||||
1. 转换之前,为了确保无误,强烈建议您备份原有数据,我们无法对转换前没有备份的用
|
||||
户提供任何技术支持
|
||||
2. 通常情况下,我们的转换程序放置在发行版本的 ./utilities/convert 目录中,此程序
|
||||
可以独立于产品运行
|
||||
3. 我们不能保障转换或者转换到 Discuz! X 产品当中所有的数据都是有效的,某些插件或
|
||||
者自行开发的功能数据需要您自行转换
|
||||
4. 大多数情况下,您转换到 Discuz! X 产品以后,需要进入后台进行一系列重新设置,否
|
||||
则某些功能可能无法正常使用。
|
||||
5. 除非有特殊的声明,我们的转换程序不会改变您原有的数据格式和设置,他会将原有数
|
||||
据重新复制一份,并做格式转换。所以,在转换开始之前,您应当检查您的数据库存储
|
||||
空间是否够用。假设您原有数据是 100M,您至少需要 110M 以上的数据剩余空间,否则
|
||||
可能无法转换成功
|
||||
6. 转换成功后,请您删除 convert 程序,以避免可能的安全问题
|
||||
|
||||
+--------------------------------------+
|
||||
转换方法和步骤
|
||||
+--------------------------------------+
|
||||
1. 进入您原来的系统,关闭您的站点。
|
||||
2. 进行数据备份,附件备份
|
||||
3. 备份您的系统的配置文件 例如 config.inc.php,记录下当中的各种服务器信息,例如
|
||||
mysql 数据库
|
||||
4. 将原有程序 全部转移到一个备份目录,例如 old
|
||||
5. 上传 Discuz! X 程序到您的站点目录
|
||||
6. 正确安装 Discuz! X (如果您的 UCenter Server 是独立安装的,您需要提供他的访问
|
||||
路径和创始人密码)
|
||||
7. 上传 utilities 目录中的 convert 文件夹到您的站点根目录
|
||||
设置为可写(777)
|
||||
8. 访问 http://您的域名/convert 开始转换/转换
|
||||
9. convert 程序当中集成了多种程序可以转换到 Discuz! X,请您根据系统进行选择
|
||||
10. 转换程序通常会提供一个转换或者安装说明,您在开始之前请仔细阅读他
|
||||
11. 按照程序提示,直至所有转换执行完毕
|
||||
|
||||
+--------------------------------------+
|
||||
转换疑难解决
|
||||
+--------------------------------------+
|
||||
您在转换过程中遇到任何问题,可通过以下途径解决
|
||||
|
||||
1. 到我们的讨论区寻求帮助和支持
|
||||
http://www.discuz.net
|
||||
|
||||
2. 查看详细转换指导文件
|
||||
http://faq.comsenz.com/category-202
|
||||
|
||||
3. 商业用户可以根据您购买的服务,使用电话、MSN、QQ、论坛等多种方式寻求技术支持
|
||||
|
||||
|
||||
+--------------------------------------+
|
||||
常见问题和解答
|
||||
+--------------------------------------+
|
||||
|
||||
1. 我必须要先安装 Discuz! X 么?
|
||||
通常是这样的,尤其是在进行转换的时候,这是最关键的一步,否则无法转换成功
|
||||
|
||||
2. 我已经安装了 Discuz! 论坛和 UChome 两个产品,可以转换到 Discuz! X 产品么?
|
||||
可以的。Discuz! X 融合了论坛和 SNS 的功能,转换以后,您的两个产品将会完美整合
|
||||
|
||||
3. 转换 Discuz! 和 UChome 有什么特殊要求么?
|
||||
在进行转换之前,您必须在站点上安装 DiscuzX 程序,并保证它可以正常运行。
|
||||
如果您仅仅安装了某一个产品,那么转换到 DiscuzX 是容易的,按照提示即可。
|
||||
如果您安装了两个或者多个产品,那么转换的时候要注意转换顺序,您首先应当转换论
|
||||
坛产品到 Discuz! X,然后再执行其他转换程序,转换 UChome 或者 Supesite
|
||||
|
||||
4. 为何我转换完毕以后,站点的用户都没有了
|
||||
转换程序只有检测到 UCenter 数据表的时候,才会转换用户数据。如果您以前使用的是
|
||||
我们提供的 Discuz! 完整版,转换程序可以自动检测到 UCenter 的。但是如果您使用的
|
||||
是自己独立安装的 UCenter,那么转换程序会检测不到。
|
||||
解决的办法:
|
||||
请重新安装您的 Discuz! X,安装的时候选择 仅安装 Discuz! X (手工指定已经安
|
||||
装的 UCenter Server),然后填入您的 UCenter 的信息,并开始安装。安装完毕以后重新
|
||||
开始转换。
|
||||
|
||||
5. 我原来的论坛规模很大,转换程序对数据的大小有限制么?是否可能确保转换成功?
|
||||
我们的转换程序经过多次的测试,并在 >6G 的数据环境中反复转换成功,因此对于原始
|
||||
数据的大小是没有限制的,只不过随着数据量越大,转换时间越长。您应当保障
|
||||
数据转换期间,服务器一直是可用的。
|
||||
|
||||
6. 如果转换中途出错或者意外中断,该如何处理?
|
||||
如果出现意外中断,通常情况下您应当根据错误提示,排除错误,然后再重新开始。
|
||||
转换程序提供了高级转换模式,您可以选择跳过某些转换步骤,而不必重新来过,但您
|
||||
应当了解哪些步骤已经执行过,否则可能导致数据转换不完整。
|
||||
如果您是在转换 UChome 或者 Supesite 过程中出错,并且此时论坛已经转换完毕,
|
||||
那么您可能需要重新转换论坛,然后再执行 UChome 的转换,否则转换可能无法成功。
|
||||
因此,如果您需要转换论坛 + UChome + ... 多个程序,我们建议您在每个转换程序结束,
|
||||
对已经转换好的数据进行备份,这样可以在中断的时候,恢复备份,然后继续执行。
|
||||
|
||||
7. 转换过程中需要人工干预么?
|
||||
除了转换前面需要填写一些信息和选择转换程序,转换一旦开始,程序将会自动运行和
|
||||
跳转,所以您无需进行干预。不恰当的干预反而可能在成转换中断或者失败。
|
|
@ -0,0 +1,102 @@
|
|||
中文版授权协议 适用于中文用户
|
||||
|
||||
版权所有 (c) 2001-2017,北京康盛新创科技有限责任公司
|
||||
保留所有权利。
|
||||
|
||||
感谢您选择康盛产品。希望我们的努力能为您提供一个高效快速、强大的站点解决方案,和强大的社区论坛解决方案。康盛公司网址为 http://www.comsenz.com,产品官方讨论区网址为 http://www.discuz.net。
|
||||
|
||||
用户须知:本协议是您与康盛公司之间关于您使用康盛公司提供的各种软件产品及服务的法律协议。无论您是个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,包括免除或者限制康盛责任的免责条款及对您的权利限制。请您审阅并接受或不接受本服务条款。如您不同意本服务条款及/或康盛随时对其的修改,您应不使用或主动取消康盛公司提供的康盛产品。否则,您的任何对康盛产品中的相关服务的注册、登陆、下载、查看等使用行为将被视为您对本服务条款全部的完全接受,包括接受康盛对服务条款随时所做的任何修改。
|
||||
本服务条款一旦发生变更, 康盛将在网页上公布修改内容。修改后的服务条款一旦在网站管理后台上公布即有效代替原来的服务条款。您可随时登陆康盛官方论坛查阅最新版服务条款。如果您选择接受本条款,即表示您同意接受协议各项条件的约束。如果您不同意本服务条款,则不能获得使用本服务的权利。您若有违反本条款规定,康盛公司有权随时中止或终止您对康盛产品的使用资格并保留追究相关法律责任的权利。
|
||||
在理解、同意、并遵守本协议的全部条款后,方可开始使用康盛产品。您可能与康盛公司直接签订另一书面协议,以补充或者取代本协议的全部或者任何部分。
|
||||
|
||||
康盛拥有本软件的全部知识产权。本软件只供许可协议,并非出售。康盛只允许您在遵守本协议各项条款的情况下复制、下载、安装、使用或者以其他方式受益于本软件的功能或者知识产权。
|
||||
|
||||
I. 协议许可的权利
|
||||
|
||||
1. 您可以在完全遵守本许可协议的基础上,将本软件应用于非商业用途,而不必支付软件版权许可费用。
|
||||
2. 您可以在协议规定的约束和限制范围内修改康盛产品源代码(如果被提供的话)或界面风格以适应您的网站要求。
|
||||
3. 您拥有使用本软件构建的网站中全部会员资料、文章及相关信息的所有权,并独立承担与使用本软件构建的网站内容的审核、注意义务,确保其不侵犯任何人的合法权益,独立承担因使用康盛软件和服务带来的全部责任,若造成康盛公司或用户损失的,您应予以全部赔偿。
|
||||
4. 若您需将康盛软件或服务用户商业用途,必须另行获得康盛的书面许可,您在获得商业授权之后,您可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持期限、技术支持方式和技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。
|
||||
5. 您可以从康盛提供的应用中心服务中下载适合您网站的应用程序,但应向应用程序开发者/所有者支付相应的费用。
|
||||
|
||||
II. 协议规定的约束和限制
|
||||
|
||||
1. 未获康盛公司书面商业授权之前,不得将本软件用于商业用途(包括但不限于企业网站、经营性网站、以营利为目或实现盈利的网站)。购买商业授权请登陆http://www.discuz.com参考相关说明,也可以致电8610-51282255了解详情。
|
||||
2. 不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。
|
||||
3. 无论如何,即无论用途如何、是否经过修改或美化、修改程度如何,只要使用康盛产品的整体或任何部分,未经书面许可,页面页脚处的康盛产品名称和康盛公司下属网站(http://www.comsenz.com、或 http://www.discuz.net) 的链接都必须保留,而不能清除或修改。
|
||||
4. 禁止在康盛产品的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。
|
||||
5. 您从应用中心下载的应用程序,未经应用程序开发者/所有者的书面许可,不得对其进行反向工程、反向汇编、反向编译等,不得擅自复制、修改、链接、转载、汇编、发表、出版、发展与之有关的衍生产品、作品等。
|
||||
6. 如果您未能遵守本协议的条款,您的授权将被终止,所许可的权利将被收回,同时您应承担相应法律责任。
|
||||
|
||||
III. 有限担保和免责声明
|
||||
|
||||
1. 本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。
|
||||
2. 用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。
|
||||
3. 康盛公司不对使用本软件构建的网站中或者论坛中的文章或信息承担责任,全部责任由您自行承担。
|
||||
4. 康盛公司无法全面监控由第三方上传至应用中心的应用程序,因此不保证应用程序的合法性、安全性、完整性、真实性或品质等;您从应用中心下载应用程序时,同意自行判断并承担所有风险,而不依赖于康盛公司。但在任何情况下,康盛公司有权依法停止应用中心服务并采取相应行动,包括但不限于对于相关应用程序进行卸载,暂停服务的全部或部分,保存有关记录,并向有关机关报告。由此对您及第三人可能造成的损失,康盛公司不承担任何直接、间接或者连带的责任。
|
||||
5. 康盛公司对康盛提供的软件和服务之及时性、安全性、准确性不作担保,由于不可抗力因素、康盛公司无法控制的因素(包括黑客攻击、停断电等)等造成软件使用和服务中止或终止,而给您造成损失的,您同意放弃追究康盛公司责任的全部权利。 6.康盛公司特别提请您注意,康盛公司为了保障公司业务发展和调整的自主权,康盛公司拥有随时经或未经事先通知而修改服务内容、中止或终止部分或全部软件使用和服务的权利,修改会公布于康盛公司网站相关页面上,一经公布视为通知。 康盛公司行使修改或中止、终止部分或全部软件使用和服务的权利而造成损失的,康盛公司不需对您或任何第三方负责。
|
||||
|
||||
有关康盛产品最终用户授权协议、商业授权与技术服务的详细内容,均由康盛公司独家提供。康盛公司拥有在不事先通知的情况下,修改授权协议和服务价目表的权利,修改后的协议或价目表对自改变之日起的新授权用户生效。
|
||||
|
||||
一旦您开始安装康盛产品,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权利的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。
|
||||
|
||||
本许可协议条款的解释,效力及纠纷的解决,适用于中华人民共和国大陆法律。
|
||||
|
||||
若您和康盛之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,您在此完全同意将纠纷或争议提交康盛所在地北京市海淀区人民法院管辖。康盛公司拥有对以上各项条款内容的解释权及修改权。(正文完)
|
||||
|
||||
康盛公司
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
English Version of EULA, for non-Chinese-Speaking Users Only
|
||||
|
||||
Copyright (c) 2001-2017, Comsenz Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software license agreement (hereinafter the “Agreement”) is a legal agreement between the user (hereinafter “You” or the “User”) and Beijing Comsenz Technology Limited (“Comsenz”) for the software products (hereinafter the “Software”) and related services (hereinafter the “Service”) that accompanies this Agreement, as may be updated or replaced by feature enhancements, software updates or maintenance releases and any services that may be provided by Comsenz under this Agreement. You are not allowed to download, install or use the Software or to use Services unless you accept all the terms and conditions of this Agreement. Your download, installation and use of the Software shall be regarded as your acceptance of the Agreement and your agreement to be bound by all the terms and conditions of this Agreement.
|
||||
This Agreement, between the User and Comsenz, is an agreement regarding the User's downloading, installation, use and copying of the Software, and the use of Services provided by Comsenz. This Agreement stipulates the rights and duties of You and Comsenz regarding the licensed use and related services. "The User" or "You" refers to a person (who is 18 years of age or older, any parent or guardian of a person under the age of 18 may accept this Agreement on behalf of a user) or entity who obtains the Software authorization license and/or the Software products by means of the Software license and the account registration as provided by Comsenz.
|
||||
|
||||
This Agreement may be updated by Comsenz at any time and without prior notice to the User. After the updated Agreement is issued, it shall replace the original Agreement effectively. Users can read the updated Agreement by logging in the Software or checking on the Website at any time. After Comsenz has updated the clauses of Agreement, the User should stop using software and services provided by Comsenz if he/she does not agree with the clauses amended, otherwise it will be deemed that the user has accepted the Agreement as amended.
|
||||
|
||||
Except those explicitly stated in the Agreement, the Agreement does not stipulate the terms of service for other services offered by Comsenz which the User visits when using the “Software”. Those services are usually regulated by other separate terms of service and the User should be familiar with and confirm his/her acceptance of those terms of service when using the relevant services. If there are conflicts between separate terms of service and this Agreement, the separate terms of service will govern. By using those services, the User shall be regarded as having accepted the relevant terms of service.
|
||||
|
||||
1. Grant of License
|
||||
Subject to the terms and conditions of this Agreement, Comsenz grants to you a limited, non-exclusive, worldwide license to install, download and use a single instance of the Software on a single website server through a single installation for non-commercial purposes for free.
|
||||
|
||||
You can modify the source code (if being provided) or interface of the Software if your modification is strictly under the Agreement and to beautify your website.
|
||||
|
||||
When using the Software, the User shall comply with the relevant national laws and policies, protect the national interests, safeguard the national security and comply with this Agreement. The User, but not Comsenz, shall be fully responsible for all liabilities resulting from the illegal use of the Software or breach of the Agreement. If the User's misbehavior causes loss to Comsenz, Comsenz is entitled to demand the User to provide compensation, cease provision of the service immediately and keep relevant records. Moreover, if the User violates laws or the Agreement and correlative clauses of services stipulated in other services of Comsenz by using the Software, Comsenz has the right to take these measures including, but not limited to, interruption of use license, stopping of services, restriction of use, legal investigation, etc. considering the nature of the User’s behaviors and without a prior notice to the User.
|
||||
|
||||
You have the entire property of all the members’ data, information and articles in your website which is powered by the Software; that is to say, you must assume solely all the relevant liabilities concerns to the contents in your website.
|
||||
|
||||
You may use the Software for commercial means after purchase of the commercial license. Moreover, according to the license you purchase you will get technical support from Comsenz in specified term and manner. Commercial users are prior to submitting ideas and opinions to Comsenz, but without any guarantee of acceptance.
|
||||
|
||||
You can download application(s) for your website from Comsenz’s Application Center after you have paid appropriate fee to the developer/owner of the application(s).
|
||||
2. License Restrictions
|
||||
You cannot use the Software for commercial or profit purposes (include but are not limited to company websites, operating websites or other for-profit websites) unless you have been licensed to. To purchase the license, please visit http://www.comsenz.com or dial 8610-5165 7885 for more information.
|
||||
|
||||
You may not rent, sublicense, assign, lease, loan, resell, distribute, publish or network the Software or related materials or create derivative works based upon the Software or any part thereof.
|
||||
|
||||
You may not use the Software to engage in or allow others to engage in any illegal activity. You may not use the Software to engage in any activity that will violate the rights of third parties, including, without limitation, copyrights, trademarks, publicity rights, privacy rights, other proprietary rights, or rights against defamation of third parties.
|
||||
|
||||
You cannot remove or modify the copyright information and relevant links under any circumstances, such as http://www.comsenz.com, and http://www.discuz.net, in the foot of web pages without the prior written consent of Comsenz.
|
||||
|
||||
You cannot reverse engineer, decompile or disassemble, copy, modify, link, reproduce, publish or develop derivative products of the applications that you download from Comsenz’s Application Center without the prior written permission from the application developer/owner.
|
||||
|
||||
3. Disclaimer of Warranties and Limitations of Liabilities
|
||||
The software and the accompanying files are provided “as-is”, and to the maximum extent permitted by applicable law, Comsenz disclaims all other warranties, express or implied, by statute or otherwise, regarding the software and any related materials, including their fitness for a particular purpose, their quality, their merchantability, or any related services or content is secure, or is free from bugs, viruses, errors, or other program limitations nor does it warrant access to the internet or to any other services through the software.
|
||||
|
||||
To the maximum extent permitted by applicable law, Comsenz will not be liable for any indirect, special, incidental, or consequential damages(including damages for loss of business, loss of profits, or the like), whatever based on breach of contract, tort(including negligence), product liability or otherwise, even Comsenz has been advised of the possibility of such damages. Comsenz’ total liability to you for actual damages for any cause whatsoever will be limited to the purchase price amount paid by you for the software.
|
||||
|
||||
Comsenz is not liable for the content of any message in the websites powered by the Software.
|
||||
|
||||
Comsenz does not guarantee the legality, safety, integrity, authenticity and quality of the applications which uploaded into Comsenz’s Application Center by any third party. You agree to judge on yourself and take fully responsibilities to the action of download from Comsenz’s Application Center. But in any case, Comsenz may stop the Store’s service and take appropriate actions, including but not limited to uninstall the associated applications, suspend the Store’s service in whole or in part, keep the relevant records to the relevant authorities, and Comsenz will not undertake any direct, indirect or consequential liability to the actions thereof.
|
||||
4. Termination
|
||||
The License is effective until terminated. You may terminate the License at any time by uninstalling the Software and destroying all copies of the Software in any media. This Agreement may be terminated by Comsenz immediately and without notice if you fail to comply with any term or condition of the License or this Agreement. Upon such termination, you must immediately cease using the Software, and assume relevant liabilities.
|
||||
|
||||
Comsenz reserves the right to change or add to the terms of this Agreement at any time (including but are not limited to Internet-based Solutions, pricing, technical support options, and other product-related policies), and to change, discontinue or impose conditions on any feature or aspect of the Software, or any Internet-based Solutions provided to you or made available to you in the official websites. Such changes will be effective upon notification by any means reasonable to give you actual or constructive notice including by posting such terms on the discuz.net website, or another website designated by Comsenz. Your continued use of the Software will indicate your agreement to any such change.
|
||||
|
||||
5. Controlling Law
|
||||
The Agreement is governed by and construed in accordance with the laws of P.R China. You hereby consent to the exclusive jurisdiction and venue in the Haidian District court of the City of Beijing.
|
||||
|
||||
Beijing Comsenz Technology Limited
|
|
@ -0,0 +1,25 @@
|
|||
+----------------------------------+
|
||||
Discuz! X 社区软件系统简介
|
||||
+----------------------------------+
|
||||
Crossday Discuz! Board(以下简称 Discuz!,中国国家版权局著作权登记号 2008SR11708
|
||||
)是康盛创想(北京)科技有限公司(英文简称Comsenz)推出的一套通用的社区论坛软件系
|
||||
统。作为国内最大的社区软件及服务提供商,Comsenz旗下的 Discuz! 产品,无论在功能、
|
||||
稳定性、负载能力、安全保障等方面都居于国内外同类产品领先地位,是全球成熟度最高、
|
||||
覆盖率最大的论坛软件系统之一。
|
||||
|
||||
+----------------------------------+
|
||||
Discuz! X 社区软件的下载
|
||||
+----------------------------------+
|
||||
您可以随时从我们的官方下载站下载到最新版本,以及各种补丁
|
||||
http://www.discuz.net/
|
||||
|
||||
+----------------------------------+
|
||||
Discuz! X 软件的技术支持
|
||||
+----------------------------------+
|
||||
当您在安装、升级、日常使用当中遇到疑难,请您到以下站点获取技术支持。
|
||||
|
||||
Discuz! 讨论区: http://www.discuz.net
|
||||
Discuz! 使用手册: http://faq.comsenz.com/usersguide/discuz
|
||||
Discuz! 应用中心: http://addon.discuz.com
|
||||
|
||||
Discuz! 商业授权购买: http://www.discuz.net/redirect.php?service
|
|
@ -0,0 +1,43 @@
|
|||
||==================================||
|
||||
Discuz! X 升级文档
|
||||
||==================================||
|
||||
|
||||
本文档用于帮助您将 Discuz! X 版本程序升级至现今版本,如果您的论坛不是 Discuz! X
|
||||
系列,请首先使用我们的转换程序。
|
||||
|
||||
在您开始升级之前,请务必逐条仔细阅读以下的注意事项:
|
||||
|
||||
1. 升级之前,为了确保无误,强烈建议您备份原有数据,我们无法对升级前没有备份的用
|
||||
户提供任何技术支持
|
||||
2. 通常情况下,我们的升级程序是 update.php, 他放置在发行版本的 ./utilities/ 目录中
|
||||
3. 大多数情况下,您升级到 Discuz! X 产品以后,需要进入后台进行一系列重新设置,否
|
||||
则某些功能可能无法正常使用。
|
||||
4. 升级成功后,请您删除 update 程序,以避免可能的安全问题
|
||||
|
||||
+--------------------------------------+
|
||||
升级方法和步骤(以下方法仅适用于Discuz!X系列产品)
|
||||
+--------------------------------------+
|
||||
1. 进入您原来的系统,关闭您的站点。进行数据备份。
|
||||
2. 站点建立 old 文件夹,除 data, config, uc_server, uc_client 之外的文件移动到 old 目录中
|
||||
3. 下载并解压缩最新版的程序包(请注意需要与您原来的语言版本一样,不可混用)
|
||||
4. 程序包解压缩后,可以看到 readme, upload, utilities 三个目录,
|
||||
5. 上传upload目录中的程序到服务器论坛目录,如果提示需要覆盖,则选择“是”
|
||||
6. 将压缩包中 /utilities/ 目录中的 update.php 程序上传到您的论坛 install 目录。并删除 install 目录
|
||||
中的 index.php
|
||||
7. 访问 http://您的域名/论坛目录/install/update.php
|
||||
8. 按照程序提示,直至所有升级完毕。删除 update.php 程序,以免被恶意利用。
|
||||
9. 进入论坛后台,更新缓存,并对新功能进行设置和测试。
|
||||
10.old目录中如果存放有非discuzX程序文件,则将他备份或者恢复到原来的位置,否则当中的程序可以在升级成功后删除。
|
||||
|
||||
+--------------------------------------+
|
||||
升级疑难解决
|
||||
+--------------------------------------+
|
||||
您在升级过程中遇到任何问题,可通过以下途径解决
|
||||
|
||||
1. 到我们的讨论区寻求帮助和支持
|
||||
http://www.discuz.net
|
||||
|
||||
2. 查看详细升级指导文件
|
||||
http://faq.comsenz.com/category-202
|
||||
|
||||
3. 商业用户可以根据您购买的服务,使用电话、MSN、QQ、论坛等多种方式寻求技术支持
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: admin.php 34285 2013-12-13 03:39:35Z hypowang $
|
||||
*/
|
||||
|
||||
define('IN_ADMINCP', TRUE);
|
||||
define('NOROBOT', TRUE);
|
||||
define('ADMINSCRIPT', basename(__FILE__));
|
||||
define('CURSCRIPT', 'admin');
|
||||
define('HOOKTYPE', 'hookscript');
|
||||
define('APPTYPEID', 0);
|
||||
|
||||
|
||||
require './source/class/class_core.php';
|
||||
require './source/function/function_misc.php';
|
||||
require './source/function/function_forum.php';
|
||||
require './source/function/function_admincp.php';
|
||||
require './source/function/function_cache.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init();
|
||||
|
||||
$admincp = new discuz_admincp();
|
||||
$admincp->core = & $discuz;
|
||||
$admincp->init();
|
||||
|
||||
|
||||
$admincp_actions_founder = array('templates', 'db', 'founder', 'postsplit', 'threadsplit', 'cloudaddons', 'upgrade', 'patch', 'optimizer');
|
||||
$admincp_actions_normal = array('index', 'setting', 'members', 'admingroup', 'usergroups', 'usertag',
|
||||
'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'recyclebinpost', 'prune', 'grid',
|
||||
'styles', 'addons', 'plugins', 'tasks', 'magics', 'medals', 'google', 'announce', 'faq', 'ec',
|
||||
'tradelog', 'jswizard', 'project', 'counter', 'misc', 'adv', 'logs', 'tools', 'portalperm', 'blogrecyclebin',
|
||||
'checktools', 'search', 'article', 'block', 'blockstyle', 'blockxml', 'portalcategory', 'blogcategory', 'albumcategory', 'topic', 'credits',
|
||||
'doing', 'group', 'blog', 'feed', 'album', 'pic', 'comment', 'share', 'click', 'specialuser', 'postsplit', 'threadsplit', 'report',
|
||||
'district', 'diytemplate', 'verify', 'nav', 'domain', 'postcomment', 'tag', 'connect', 'card', 'portalpermission', 'collection', 'membersplit', 'makehtml');
|
||||
|
||||
$action = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('action'));
|
||||
$operation = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('operation'));
|
||||
$do = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('do'));
|
||||
$frames = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('frames'));
|
||||
lang('admincp');
|
||||
$lang = & $_G['lang']['admincp'];
|
||||
$page = max(1, intval(getgpc('page')));
|
||||
$isfounder = $admincp->isfounder;
|
||||
|
||||
if(empty($action) || $frames != null) {
|
||||
$admincp->show_admincp_main();
|
||||
} elseif($action == 'logout') {
|
||||
$admincp->do_admin_logout();
|
||||
dheader("Location: ./index.php");
|
||||
} elseif(in_array($action, $admincp_actions_normal) || ($admincp->isfounder && in_array($action, $admincp_actions_founder))) {
|
||||
if($admincp->allow($action, $operation, $do) || $action == 'index') {
|
||||
require $admincp->admincpfile($action);
|
||||
} else {
|
||||
cpheader();
|
||||
cpmsg('action_noaccess', '', 'error');
|
||||
}
|
||||
} else {
|
||||
cpheader();
|
||||
cpmsg('action_noaccess', '', 'error');
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: api.php 33591 2013-07-12 06:39:49Z andyzheng $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
|
||||
$modarray = array('js' => 'javascript/javascript', 'ad' => 'javascript/advertisement');
|
||||
|
||||
$mod = !empty($_GET['mod']) ? $_GET['mod'] : '';
|
||||
if(empty($mod) || !in_array($mod, array('js', 'ad'))) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
require_once './api/'.$modarray[$mod].'.php';
|
||||
|
||||
function loadcore() {
|
||||
global $_G;
|
||||
require_once './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_session = false;
|
||||
$discuz->init();
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=gbk" />
|
||||
<script type="text/javascript">
|
||||
var querystring = location.search.substr(1);
|
||||
if(querystring.indexOf('/') != -1) {
|
||||
var e = querystring.split('/');
|
||||
var url = '../../admin.php?frames=yes&action=cloudaddons&operation=download&addonids=' + e[0] + '&md5hash=' + e[1] + '×tamp=' + e[2];
|
||||
try {
|
||||
top.location.href = url;
|
||||
} catch(e) {}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
if(phpversion() >= '5.3') {
|
||||
include 'zendcheck53.php';
|
||||
} else {
|
||||
include 'zendcheck52.php';
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,3 @@
|
|||
<?php @Zend;
|
||||
4123;
|
||||
/*
|
|
@ -0,0 +1,3 @@
|
|||
<?php @Zend;
|
||||
3074;
|
||||
/*
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: like.php 25510 2011-11-14 02:22:26Z yexinhao $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
|
||||
require_once '../../source/class/class_core.php';
|
||||
|
||||
$cachelist = array();
|
||||
$discuz = C::app();
|
||||
$discuz->init_setting = true;
|
||||
$discuz->init();
|
||||
|
||||
$body = '';
|
||||
$style = 'body { background: transparent; color: '.$_G['style']['tabletext'].'; font: '.$_G['style']['fontsize'].' '.$_G['style']['font'].'; margin:0; }'.
|
||||
'a { color: '.$_G['style']['link'].'; text-decoration: none; } a:hover { text-decoration: underline; }';
|
||||
|
||||
if($_G['setting']['connect']['like_allow'] && $_G['setting']['connect']['like_url']) {
|
||||
$style .= '#txQZ { border: medium none; float: left; height:21px; margin-top: 4px; overflow: hidden; width: 110px; }'.
|
||||
'.vm { vertical-align: middle; }';
|
||||
$body .= '<iframe id="txQZ" src="'.$_G['setting']['connect']['like_url'].'" class="vm" allowtransparency="true" scrolling="no" border="0" frameborder="0"></iframe>';
|
||||
}
|
||||
|
||||
if($_G['setting']['connect']['turl_allow'] && $_G['setting']['connect']['turl_code']) {
|
||||
$style .= '#txWB_W1 { background: url("../../static/image/common/weibo.png") no-repeat scroll 0 50% transparent; float: left; line-height: 28px; padding: 0 5px 0 20px; }'.
|
||||
'#txWB_W1 img { display: none; }'.
|
||||
'#txWB_W1 b { font-weight: 400; }'.
|
||||
'#txWB_W1 a { color: '.$_G['style']['highlightlink'].'; }';
|
||||
$body .= $_G['setting']['connect']['turl_code'];
|
||||
}
|
||||
|
||||
if($style && $body) {
|
||||
echo '<style>'.$style.'</style><body>'.$body.'</body>';
|
||||
}
|
|
@ -0,0 +1,910 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: dbbak.php 35016 2014-10-13 08:16:14Z nemohou $
|
||||
*/
|
||||
|
||||
@define('IN_API', true);
|
||||
@define('CURSCRIPT', 'api');
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
$code = @$_GET['code'];
|
||||
$apptype = @$_GET['apptype'];
|
||||
|
||||
$apptype = strtolower($apptype);
|
||||
|
||||
define('IN_COMSENZ', TRUE);
|
||||
if($apptype == 'discuzx') {
|
||||
define('ROOT_PATH', dirname(__FILE__).'/../../');
|
||||
} else {
|
||||
define('ROOT_PATH', dirname(__FILE__).'/../');
|
||||
}
|
||||
define('EXPLOR_SUCCESS', 0);
|
||||
define('IMPORT_SUCCESS', 0);
|
||||
define('DELETE_SQLPATH_SUCCESS', 4);
|
||||
define('MKDIR_ERROR', 1);
|
||||
define('DATABASE_EXPORT_FILE_INVALID', 2);
|
||||
define('RUN_SQL_ERROR', 3);
|
||||
define('SQLPATH_NULL_NOEXISTS', 4);
|
||||
define('SQLPATH_NOMATCH_BAKFILE', 5);
|
||||
define('BAK_FILE_LOSE', 6);
|
||||
define('DIR_NO_EXISTS', 7);
|
||||
define('DELETE_DUMPFILE_ERROR', 8);
|
||||
define('DB_API_NO_MATCH', 9);
|
||||
|
||||
$sizelimit = 2000;
|
||||
$usehex = true;
|
||||
|
||||
if($apptype == 'discuz') {
|
||||
require ROOT_PATH.'./config.inc.php';
|
||||
} elseif($apptype == 'uchome' || $apptype == 'supesite' || $apptype == 'supev') {
|
||||
require ROOT_PATH.'./config.php';
|
||||
} elseif($apptype == 'ucenter') {
|
||||
require ROOT_PATH.'./data/config.inc.php';
|
||||
} elseif($apptype == 'ecmall') {
|
||||
require ROOT_PATH.'./data/inc.config.php';
|
||||
} elseif($apptype == 'ecshop') {
|
||||
require ROOT_PATH.'./data/config.php';
|
||||
} elseif($apptype == 'discuzx') {
|
||||
require ROOT_PATH.'./config/config_global.php';
|
||||
require ROOT_PATH.'./config/config_ucenter.php';
|
||||
} else {
|
||||
api_msg('db_api_no_match', $apptype);
|
||||
}
|
||||
|
||||
parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
|
||||
if(get_magic_quotes_gpc()) {
|
||||
$get = _stripslashes($get);
|
||||
}
|
||||
|
||||
if(empty($get)) {
|
||||
exit('Invalid Request');
|
||||
}
|
||||
|
||||
$timestamp = time();
|
||||
if($timestamp - $get['time'] > 3600) {
|
||||
exit('Authracation has expiried');
|
||||
}
|
||||
$get['time'] = $timestamp;
|
||||
|
||||
class dbstuff {
|
||||
var $querynum = 0;
|
||||
var $link;
|
||||
var $histories;
|
||||
var $time;
|
||||
var $tablepre;
|
||||
|
||||
function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect = 0, $tablepre='', $time = 0) {
|
||||
$this->time = $time;
|
||||
$this->tablepre = $tablepre;
|
||||
if($pconnect) {
|
||||
if(!$this->link = mysql_pconnect($dbhost, $dbuser, $dbpw)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
} else {
|
||||
if(!$this->link = mysql_connect($dbhost, $dbuser, $dbpw, 1)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
}
|
||||
|
||||
if($this->version() > '4.1') {
|
||||
if($dbcharset) {
|
||||
mysql_query("SET character_set_connection=".$dbcharset.", character_set_results=".$dbcharset.", character_set_client=binary", $this->link);
|
||||
}
|
||||
|
||||
if($this->version() > '5.0.1') {
|
||||
mysql_query("SET sql_mode=''", $this->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($dbname) {
|
||||
mysql_select_db($dbname, $this->link);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fetch_array($query, $result_type = MYSQL_ASSOC) {
|
||||
return mysql_fetch_array($query, $result_type);
|
||||
}
|
||||
|
||||
function result_first($sql) {
|
||||
$query = $this->query($sql);
|
||||
return $this->result($query, 0);
|
||||
}
|
||||
|
||||
function fetch_first($sql) {
|
||||
$query = $this->query($sql);
|
||||
return $this->fetch_array($query);
|
||||
}
|
||||
|
||||
function fetch_all($sql) {
|
||||
$arr = array();
|
||||
$query = $this->query($sql);
|
||||
while($data = $this->fetch_array($query)) {
|
||||
$arr[] = $data;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function cache_gc() {
|
||||
$this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time");
|
||||
}
|
||||
|
||||
function query($sql, $type = '', $cachetime = FALSE) {
|
||||
$func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query';
|
||||
if(!($query = $func($sql, $this->link)) && $type != 'SILENT') {
|
||||
$this->halt('MySQL Query Error', $sql);
|
||||
}
|
||||
$this->querynum++;
|
||||
$this->histories[] = $sql;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function affected_rows() {
|
||||
return mysql_affected_rows($this->link);
|
||||
}
|
||||
|
||||
function error() {
|
||||
return (($this->link) ? mysql_error($this->link) : mysql_error());
|
||||
}
|
||||
|
||||
function errno() {
|
||||
return intval(($this->link) ? mysql_errno($this->link) : mysql_errno());
|
||||
}
|
||||
|
||||
function result($query, $row) {
|
||||
$query = @mysql_result($query, $row);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_rows($query) {
|
||||
$query = mysql_num_rows($query);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_fields($query) {
|
||||
return mysql_num_fields($query);
|
||||
}
|
||||
|
||||
function free_result($query) {
|
||||
return mysql_free_result($query);
|
||||
}
|
||||
|
||||
function insert_id() {
|
||||
return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);
|
||||
}
|
||||
|
||||
function fetch_row($query) {
|
||||
$query = mysql_fetch_row($query);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function fetch_fields($query) {
|
||||
return mysql_fetch_field($query);
|
||||
}
|
||||
|
||||
function version() {
|
||||
return mysql_get_server_info($this->link);
|
||||
}
|
||||
|
||||
function escape_string($str) {
|
||||
return mysql_escape_string($str);
|
||||
}
|
||||
|
||||
function close() {
|
||||
return mysql_close($this->link);
|
||||
}
|
||||
|
||||
function halt($message = '', $sql = '') {
|
||||
api_msg('run_sql_error', $message.'<br /><br />'.$sql.'<br /> '.mysql_error());
|
||||
}
|
||||
}
|
||||
class dbstuffi {
|
||||
var $querynum = 0;
|
||||
var $link;
|
||||
var $histories;
|
||||
var $time;
|
||||
var $tablepre;
|
||||
|
||||
function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect = 0, $tablepre='', $time = 0) {
|
||||
$this->time = $time;
|
||||
$this->tablepre = $tablepre;
|
||||
$this->link = new mysqli();
|
||||
if(!$this->link->real_connect($dbhost, $dbuser, $dbpw, $dbname, null, null, MYSQLI_CLIENT_COMPRESS)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
|
||||
if($this->version() > '4.1') {
|
||||
if($dbcharset) {
|
||||
$this->link->set_charset($dbcharset);
|
||||
}
|
||||
|
||||
if($this->version() > '5.0.1') {
|
||||
$this->query("SET sql_mode=''");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function fetch_array($query, $result_type = MYSQLI_ASSOC) {
|
||||
return $query ? $query->fetch_array($result_type) : null;
|
||||
}
|
||||
|
||||
function result_first($sql) {
|
||||
$query = $this->query($sql);
|
||||
return $this->result($query, 0);
|
||||
}
|
||||
|
||||
function fetch_first($sql) {
|
||||
$query = $this->query($sql);
|
||||
return $this->fetch_array($query);
|
||||
}
|
||||
|
||||
function fetch_all($sql) {
|
||||
$arr = array();
|
||||
$query = $this->query($sql);
|
||||
while($data = $this->fetch_array($query)) {
|
||||
$arr[] = $data;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function cache_gc() {
|
||||
$this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time");
|
||||
}
|
||||
|
||||
function query($sql, $type = '', $cachetime = FALSE) {
|
||||
$resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT;
|
||||
if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') {
|
||||
$this->halt('MySQL Query Error', $sql);
|
||||
}
|
||||
$this->querynum++;
|
||||
$this->histories[] = $sql;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function affected_rows() {
|
||||
return $this->link->affected_rows;
|
||||
}
|
||||
|
||||
function error() {
|
||||
return (($this->link) ? $this->link->error : mysqli_error());
|
||||
}
|
||||
|
||||
function errno() {
|
||||
return intval(($this->link) ? $this->link->errno : mysqli_errno());
|
||||
}
|
||||
|
||||
function result($query, $row) {
|
||||
if(!$query || $query->num_rows == 0) {
|
||||
return null;
|
||||
}
|
||||
$query->data_seek($row);
|
||||
$assocs = $query->fetch_row();
|
||||
return $assocs[0];
|
||||
}
|
||||
|
||||
function num_rows($query) {
|
||||
$query = $query ? $query->num_rows : 0;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_fields($query) {
|
||||
return $query ? $query->field_count : 0;
|
||||
}
|
||||
|
||||
function free_result($query) {
|
||||
return $query ? $query->free() : false;
|
||||
}
|
||||
|
||||
function insert_id() {
|
||||
return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);
|
||||
}
|
||||
|
||||
function fetch_row($query) {
|
||||
$query = $query ? $query->fetch_row() : null;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function fetch_fields($query) {
|
||||
return $query ? $query->fetch_field() : null;
|
||||
}
|
||||
|
||||
function version() {
|
||||
return $this->link->server_info;
|
||||
}
|
||||
|
||||
function escape_string($str) {
|
||||
return $this->link->escape_string($str);
|
||||
}
|
||||
|
||||
function close() {
|
||||
return $this->link->close();
|
||||
}
|
||||
|
||||
function halt($message = '', $sql = '') {
|
||||
api_msg('run_sql_error', $message.'<br /><br />'.$sql.'<br /> '.$this->link->error());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$db = function_exists("mysql_connect") ? new dbstuff() : new dbstuffi();
|
||||
$version = '';
|
||||
if($apptype == 'discuz') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'forumdata/');
|
||||
$tablepre = $tablepre;
|
||||
if(empty($dbcharset)) {
|
||||
$dbcharset = in_array(strtolower($charset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $charset) : '';
|
||||
}
|
||||
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre);
|
||||
define('IN_DISCUZ', true);
|
||||
include ROOT_PATH.'discuz_version.php';
|
||||
$version = DISCUZ_VERSION;
|
||||
|
||||
} elseif($apptype == 'uchome' || $apptype == 'supesite') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'./data/');
|
||||
$tablepre = $_SC['tablepre'];
|
||||
$dbcharset = $_SC['dbcharset'];
|
||||
$db->connect($_SC['dbhost'], $_SC['dbuser'], $_SC['dbpw'], $_SC['dbname'], $dbcharset, $_SC['pconnect'], $tablepre);
|
||||
|
||||
} elseif($apptype == 'ucenter') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'./data/backup/');
|
||||
$tablepre = UC_DBTABLEPRE;
|
||||
$dbcharset = UC_DBCHARSET;
|
||||
$db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, $dbcharset, UC_DBCONNECT, $tablepre);
|
||||
|
||||
} elseif($apptype == 'ecmall') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'./data/backup/');
|
||||
$tablepre = DB_PREFIX;
|
||||
$dbcharset = strtolower(str_replace('-', '', strstr(LANG, '-')));
|
||||
$cfg = parse_url(DB_CONFIG);
|
||||
if(empty($cfg['pass'])) {
|
||||
$cfg['pass'] = '';
|
||||
} else {
|
||||
$cfg['pass'] = urldecode($cfg['pass']);
|
||||
}
|
||||
$cfg['user'] = urldecode($cfg['user']);
|
||||
$cfg['path'] = str_replace('/', '', $cfg['path']);
|
||||
|
||||
$db->connect($cfg['host'].':'.$cfg['port'], $cfg['user'], $cfg['pass'], $cfg['path'], $dbcharset, 0, $tablepre);
|
||||
|
||||
} elseif($apptype == 'supev') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'data/backup/');
|
||||
$tablepre = $tablepre;
|
||||
if(empty($dbcharset)) {
|
||||
$dbcharset = in_array(strtolower($_config['output']['charset']), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', CHARSET) : '';
|
||||
}
|
||||
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre);
|
||||
|
||||
} elseif($apptype == 'ecshop') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'data/backup/');
|
||||
$tablepre = $prefix;
|
||||
$dbcharset = 'utf8';
|
||||
$db->connect($db_host, $db_user, $db_pass, $db_name, $dbcharset, 0, $tablepre);
|
||||
|
||||
} elseif($apptype == 'discuzx') {
|
||||
|
||||
define('BACKUP_DIR', ROOT_PATH.'data/');
|
||||
extract($_config['db']['1']);
|
||||
if(empty($dbcharset)) {
|
||||
$dbcharset = in_array(strtolower(CHARSET), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $_config['output']['charset']) : '';
|
||||
}
|
||||
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbcharset, $pconnect, $tablepre);
|
||||
define('IN_DISCUZ', true);
|
||||
include ROOT_PATH.'source/discuz_version.php';
|
||||
$version = DISCUZ_VERSION;
|
||||
|
||||
}
|
||||
|
||||
if($get['method'] == 'export') {
|
||||
|
||||
$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
|
||||
|
||||
$time = date("Y-m-d H:i:s", $timestamp);
|
||||
|
||||
$tables = array();
|
||||
$tables = arraykeys2(fetchtablelist($tablepre), 'Name');
|
||||
|
||||
if($apptype == 'discuz') {
|
||||
$query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''");
|
||||
while($plugin = $db->fetch_array($query)) {
|
||||
foreach(explode(',', $plugin['datatables']) as $table) {
|
||||
if($table = trim($table)) {
|
||||
$tables[] = $table;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($apptype == 'discuzx') {
|
||||
$query = $db->query("SELECT datatables FROM {$tablepre}common_plugin WHERE datatables<>''");
|
||||
while($plugin = $db->fetch_array($query)) {
|
||||
foreach(explode(',', $plugin['datatables']) as $table) {
|
||||
if($table = trim($table)) {
|
||||
$tables[] = $table;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$memberexist = array_search("{$tablepre}common_member", $tables);
|
||||
if($memberexist !== FALSE) {
|
||||
unset($tables[$memberexist]);
|
||||
array_unshift($tables, "{$tablepre}common_member");
|
||||
}
|
||||
|
||||
$get['volume'] = isset($get['volume']) ? intval($get['volume']) : 0;
|
||||
$get['volume'] = $get['volume'] + 1;
|
||||
$version = $version ? $version : $apptype;
|
||||
$idstring = '# Identify: '.base64_encode("$timestamp,$version,$apptype,multivol,$get[volume]")."\n";
|
||||
|
||||
if(!isset($get['sqlpath']) || empty($get['sqlpath'])) {
|
||||
$get['sqlpath'] = 'backup_'.date('ymd', $timestamp).'_'.random(6);
|
||||
if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) {
|
||||
api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']);
|
||||
}
|
||||
} else {
|
||||
$get['sqlpath'] = str_replace(array('/', '\\', '.', "'"), '', $get['sqlpath']);
|
||||
if(!is_dir(BACKUP_DIR.'./'.$get['sqlpath'])) {
|
||||
if(!mkdir(BACKUP_DIR.'./'.$get['sqlpath'], 0777)) {
|
||||
api_msg('mkdir_error', 'make dir error:'.BACKUP_DIR.'./'.$get['sqlpath']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($get['backupfilename']) || empty($get['backupfilename'])) {
|
||||
$get['backupfilename'] = date('ymd', $timestamp).'_'.random(6);
|
||||
}
|
||||
|
||||
$sqldump = '';
|
||||
$get['tableid'] = isset($get['tableid']) ? intval($get['tableid']) : 0;
|
||||
$get['startfrom'] = isset($get['startfrom']) ? intval($get['startfrom']) : 0;
|
||||
|
||||
if(!$get['tableid'] && $get['volume'] == 1) {
|
||||
foreach($tables as $table) {
|
||||
$sqldump .= sqldumptablestruct($table);
|
||||
}
|
||||
}
|
||||
$complete = TRUE;
|
||||
for(; $complete && $get['tableid'] < count($tables) && strlen($sqldump) + 500 < $sizelimit * 1000; $get['tableid']++) {
|
||||
$sqldump .= sqldumptable($tables[$get['tableid']], strlen($sqldump));
|
||||
if($complete) {
|
||||
$get['startfrom'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
!$complete && $get['tableid']--;
|
||||
$dumpfile = BACKUP_DIR.$get['sqlpath'].'/'.$get['backupfilename'].'-'.$get['volume'].'.sql';
|
||||
if(trim($sqldump)) {
|
||||
$sqldump = "$idstring".
|
||||
"# <?exit();?>\n".
|
||||
"# $apptype Multi-Volume Data Dump Vol.$get[volume]\n".
|
||||
"# Time: $time\n".
|
||||
"# Type: $apptype\n".
|
||||
"# Table Prefix: $tablepre\n".
|
||||
"# $dbcharset\n".
|
||||
"# $apptype Home: http://www.comsenz.com\n".
|
||||
"# Please visit our website for newest infomation about $apptype\n".
|
||||
"# --------------------------------------------------------\n\n\n".
|
||||
$sqldump;
|
||||
@$fp = fopen($dumpfile, 'wb');
|
||||
@flock($fp, 2);
|
||||
if(@!fwrite($fp, $sqldump)) {
|
||||
@fclose($fp);
|
||||
api_msg('database_export_file_invalid', $dumpfile);
|
||||
} else {
|
||||
fclose($fp);
|
||||
auto_next($get, $dumpfile);
|
||||
}
|
||||
} else {
|
||||
@touch(ROOT_PATH.$get['sqlpath'].'/index.htm');
|
||||
api_msg('explor_success', 'explor_success');
|
||||
}
|
||||
|
||||
} elseif($get['method'] == 'import') {
|
||||
|
||||
if(!isset($get['dumpfile']) || empty($get['dumpfile'])) {
|
||||
$get['dumpfile'] = get_dumpfile_by_path($get['sqlpath']);
|
||||
$get['volume'] = 0;
|
||||
}
|
||||
|
||||
$get['volume']++;
|
||||
$next_dumpfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-'.$get['volume'].'.sql', $get['dumpfile']);
|
||||
if(!is_file(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile'])) {
|
||||
if(is_file(BACKUP_DIR.$get['sqlpath'].'/'.$next_dumpfile)) {
|
||||
api_msg('bak_file_lose', $get['dumpfile']);
|
||||
} else {
|
||||
api_msg('import_success', 'import_success');
|
||||
}
|
||||
}
|
||||
|
||||
$sqldump = file_get_contents(BACKUP_DIR.$get['sqlpath'].'/'.$get['dumpfile']);
|
||||
$sqlquery = splitsql($sqldump);
|
||||
unset($sqldump);
|
||||
|
||||
foreach($sqlquery as $sql) {
|
||||
$sql = syntablestruct(trim($sql), $db->version() > '4.1', $dbcharset);
|
||||
|
||||
if($sql != '') {
|
||||
$db->query($sql, 'SILENT');
|
||||
if(($sqlerror = $db->error()) && $db->errno() != 1062) {
|
||||
$db->halt('MySQL Query Error', $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cur_file = $get['dumpfile'];
|
||||
$get['dumpfile'] = $next_dumpfile;
|
||||
auto_next($get, BACKUP_DIR.$get['sqlpath'].'/'.$cur_file);
|
||||
|
||||
} elseif($get['method'] == 'ping') {
|
||||
|
||||
if($get['dir'] && is_dir(BACKUP_DIR.$get['dir'])) {
|
||||
echo "1";exit;
|
||||
} else {
|
||||
echo "-1";exit;
|
||||
}
|
||||
|
||||
} elseif($get['method'] == 'list') {
|
||||
|
||||
$str = "<root>\n";
|
||||
$directory = dir(BACKUP_DIR);
|
||||
while($entry = $directory->read()) {
|
||||
$filename = BACKUP_DIR.$entry;
|
||||
if(is_dir($filename) && preg_match('/backup_(\d+)_\w+$/', $filename, $match)) {
|
||||
$str .= "\t<dir>\n";
|
||||
$str .= "\t\t<dirname>$filename</dirname>\n";
|
||||
$str .= "\t\t<dirdate>$match[1]</dirdate>\n";
|
||||
$str .= "\t</dir>\n";
|
||||
}
|
||||
}
|
||||
$directory->close();
|
||||
$str .= "</root>";
|
||||
echo $str;
|
||||
exit;
|
||||
|
||||
} elseif($get['method'] == 'view') {
|
||||
|
||||
$sqlpath = trim($get['sqlpath']);
|
||||
if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath)) {
|
||||
api_msg('dir_no_exists', $sqlpath);
|
||||
}
|
||||
|
||||
$str = "<root>\n";
|
||||
$directory = dir(BACKUP_DIR.$sqlpath);
|
||||
while($entry = $directory->read()) {
|
||||
$filename = BACKUP_DIR.$sqlpath.'/'.$entry;
|
||||
if(is_file($filename) && preg_match('/\d+_\w+\-(\d+).sql$/', $filename, $match)) {
|
||||
$str .= "\t<file>\n";
|
||||
$str .= "\t\t<file_name>$match[0]</file_name>\n";
|
||||
$str .= "\t\t<file_size>".filesize($filename)."</file_size>\n";
|
||||
$str .= "\t\t<file_num>$match[1]</file_num>\n";
|
||||
$str .= "\t\t<file_url>".str_replace(ROOT_PATH, 'http://'.$_SERVER['HTTP_HOST'].'/', $filename)."</file_url>\n";
|
||||
$str .= "\t\t<last_modify>".filemtime($filename)."</last_modify>\n";
|
||||
$str .= "\t</file>\n";
|
||||
}
|
||||
}
|
||||
$directory->close();
|
||||
$str .= "</root>";
|
||||
echo $str;
|
||||
exit;
|
||||
|
||||
} elseif($get['method'] == 'delete') {
|
||||
|
||||
$sqlpath = trim($get['sqlpath']);
|
||||
if(empty($sqlpath) || !is_dir(BACKUP_DIR.$sqlpath)) {
|
||||
api_msg('dir_no_exists', $sqlpath);
|
||||
}
|
||||
$directory = dir(BACKUP_DIR.$sqlpath);
|
||||
while($entry = $directory->read()) {
|
||||
$filename = BACKUP_DIR.$sqlpath.'/'.$entry;
|
||||
if(is_file($filename) && preg_match('/\d+_\w+\-(\d+).sql$/', $filename) && !@unlink($filename)) {
|
||||
api_msg('delete_dumpfile_error', $filename);
|
||||
}
|
||||
}
|
||||
$directory->close();
|
||||
@rmdir(BACKUP_DIR.$sqlpath);
|
||||
api_msg('delete_sqlpath_success', 'delete_sqlpath_success');
|
||||
|
||||
}
|
||||
|
||||
function syntablestruct($sql, $version, $dbcharset) {
|
||||
|
||||
if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
$sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE;
|
||||
|
||||
if($sqlversion === $version) {
|
||||
|
||||
return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql;
|
||||
}
|
||||
|
||||
if($version) {
|
||||
return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql);
|
||||
|
||||
} else {
|
||||
return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql);
|
||||
}
|
||||
}
|
||||
|
||||
function splitsql($sql) {
|
||||
$sql = str_replace("\r", "\n", $sql);
|
||||
$ret = array();
|
||||
$num = 0;
|
||||
$queriesarray = explode(";\n", trim($sql));
|
||||
unset($sql);
|
||||
foreach($queriesarray as $query) {
|
||||
$ret[$num] = isset($ret[$num]) ? $ret[$num] : '';
|
||||
$queries = explode("\n", trim($query));
|
||||
foreach($queries as $query) {
|
||||
$ret[$num] .= isset($query[0]) && $query[0] == "#" ? NULL : $query;
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
return($ret);
|
||||
}
|
||||
|
||||
function get_dumpfile_by_path($path) {
|
||||
if(empty($path) || !is_dir(BACKUP_DIR.$path)) {
|
||||
api_msg('sqlpath_null_noexists', $path);
|
||||
}
|
||||
$directory = dir(BACKUP_DIR.$path);
|
||||
while($entry = $directory->read()) {
|
||||
$filename = BACKUP_DIR.$path.'/'.$entry;
|
||||
if(is_file($filename)) {
|
||||
if(preg_match('/^\d+\_\w+\-\d+\.sql$/', $entry)) {
|
||||
$file_bakfile = preg_replace('/^(\d+)\_(\w+)\-(\d+)\.sql$/', '\\1_\\2-1.sql', $entry);
|
||||
if(is_file(BACKUP_DIR.$path.'/'.$file_bakfile)) {
|
||||
return $file_bakfile;
|
||||
} else {
|
||||
api_msg('sqlpath_nomatch_bakfile', $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$directory->close();
|
||||
api_msg('sqlpath_nomatch_bakfile', $path);
|
||||
}
|
||||
|
||||
function api_msg($code, $msg) {
|
||||
$msg = htmlspecialchars($msg);
|
||||
$out = "<root>\n";
|
||||
$out .= "\t<error errorCode=\"".constant(strtoupper($code))."\" errorMessage=\"$msg\" />\n";
|
||||
$out .= "\t<fileinfo>\n";
|
||||
$out .= "\t\t<file_num></file_num>\n";
|
||||
$out .= "\t\t<file_size></file_size>\n";
|
||||
$out .= "\t\t<file_name></file_name>\n";
|
||||
$out .= "\t\t<file_url></file_url>\n";
|
||||
$out .= "\t\t<last_modify></last_modify>\n";
|
||||
$out .= "\t</fileinfo>\n";
|
||||
$out .= "\t<nexturl></nexturl>\n";
|
||||
$out .= "</root>";
|
||||
echo $out;
|
||||
exit;
|
||||
}
|
||||
|
||||
function arraykeys2($array, $key2) {
|
||||
$return = array();
|
||||
foreach($array as $val) {
|
||||
$return[] = $val[$key2];
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function auto_next($get, $sqlfile) {
|
||||
$next_url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?apptype='.$GLOBALS['apptype'].'&code='.urlencode(encode_arr($get));
|
||||
$out = "<root>\n";
|
||||
$out .= "\t<error errorCode=\"0\" errorMessage=\"ok\" />\n";
|
||||
$out .= "\t<fileinfo>\n";
|
||||
$out .= "\t\t<file_num>$get[volume]</file_num>\n";
|
||||
$out .= "\t\t<file_size>".filesize($sqlfile)."</file_size>\n";
|
||||
$out .= "\t\t<file_name>".basename($sqlfile)."</file_name>\n";
|
||||
$out .= "\t\t<file_url>".str_replace(ROOT_PATH, 'http://'.$_SERVER['HTTP_HOST'].'/', $sqlfile)."</file_url>\n";
|
||||
$out .= "\t\t<last_modify>".filemtime($sqlfile)."</last_modify>\n";
|
||||
$out .= "\t</fileinfo>\n";
|
||||
$out .= "\t<nexturl><![CDATA[$next_url]]></nexturl>\n";
|
||||
$out .= "</root>";
|
||||
echo $out;
|
||||
exit;
|
||||
}
|
||||
|
||||
function encode_arr($get) {
|
||||
$tmp = '';
|
||||
foreach($get as $key => $val) {
|
||||
$tmp .= '&'.$key.'='.$val;
|
||||
}
|
||||
return _authcode($tmp, 'ENCODE', UC_KEY);
|
||||
}
|
||||
|
||||
function sqldumptablestruct($table) {
|
||||
global $db;
|
||||
|
||||
$createtable = $db->query("SHOW CREATE TABLE $table", 'SILENT');
|
||||
|
||||
if(!$db->error()) {
|
||||
$tabledump = "DROP TABLE IF EXISTS $table;\n";
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
$create = $db->fetch_row($createtable);
|
||||
|
||||
if(strpos($table, '.') !== FALSE) {
|
||||
$tablename = substr($table, strpos($table, '.') + 1);
|
||||
$create[1] = str_replace("CREATE TABLE $tablename", 'CREATE TABLE '.$table, $create[1]);
|
||||
}
|
||||
$tabledump .= $create[1];
|
||||
|
||||
$tablestatus = $db->fetch_first("SHOW TABLE STATUS LIKE '$table'");
|
||||
$tabledump .= ($tablestatus['Auto_increment'] ? " AUTO_INCREMENT=$tablestatus[Auto_increment]" : '').";\n\n";
|
||||
return $tabledump;
|
||||
}
|
||||
|
||||
function sqldumptable($table, $currsize = 0) {
|
||||
global $get, $db, $sizelimit, $startrow, $extendins, $sqlcompat, $sqlcharset, $dumpcharset, $usehex, $complete, $excepttables;
|
||||
|
||||
$offset = 300;
|
||||
$tabledump = '';
|
||||
$tablefields = array();
|
||||
|
||||
$query = $db->query("SHOW FULL COLUMNS FROM $table", 'SILENT');
|
||||
if(strexists($table, 'adminsessions')) {
|
||||
return ;
|
||||
} elseif(!$query && $db->errno() == 1146) {
|
||||
return;
|
||||
} elseif(!$query) {
|
||||
$usehex = FALSE;
|
||||
} else {
|
||||
while($fieldrow = $db->fetch_array($query)) {
|
||||
$tablefields[] = $fieldrow;
|
||||
}
|
||||
}
|
||||
|
||||
$tabledumped = 0;
|
||||
$numrows = $offset;
|
||||
$firstfield = $tablefields[0];
|
||||
|
||||
while($currsize + strlen($tabledump) + 500 < $sizelimit * 1000 && $numrows == $offset) {
|
||||
if($firstfield['Extra'] == 'auto_increment') {
|
||||
$selectsql = "SELECT * FROM $table WHERE $firstfield[Field] > $get[startfrom] LIMIT $offset";
|
||||
} else {
|
||||
$selectsql = "SELECT * FROM $table LIMIT $get[startfrom], $offset";
|
||||
}
|
||||
$tabledumped = 1;
|
||||
$rows = $db->query($selectsql);
|
||||
$numfields = $db->num_fields($rows);
|
||||
|
||||
$numrows = $db->num_rows($rows);
|
||||
while($row = $db->fetch_row($rows)) {
|
||||
$comma = $t = '';
|
||||
for($i = 0; $i < $numfields; $i++) {
|
||||
$t .= $comma.($usehex && !empty($row[$i]) && (strexists($tablefields[$i]['Type'], 'char') || strexists($tablefields[$i]['Type'], 'text')) ? '0x'.bin2hex($row[$i]) : '\''.$db->escape_string($row[$i]).'\'');
|
||||
$comma = ',';
|
||||
}
|
||||
if(strlen($t) + $currsize + strlen($tabledump) + 500 < $sizelimit * 1000) {
|
||||
if($firstfield['Extra'] == 'auto_increment') {
|
||||
$get['startfrom'] = $row[0];
|
||||
} else {
|
||||
$get['startfrom']++;
|
||||
}
|
||||
$tabledump .= "INSERT INTO $table VALUES ($t);\n";
|
||||
} else {
|
||||
$complete = FALSE;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tabledump .= "\n";
|
||||
|
||||
return $tabledump;
|
||||
}
|
||||
|
||||
function random($length, $numeric = 0) {
|
||||
PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000);
|
||||
if($numeric) {
|
||||
$hash = sprintf('%0'.$length.'d', mt_rand(0, pow(10, $length) - 1));
|
||||
} else {
|
||||
$hash = '';
|
||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
|
||||
$max = strlen($chars) - 1;
|
||||
for($i = 0; $i < $length; $i++) {
|
||||
$hash .= $chars[mt_rand(0, $max)];
|
||||
}
|
||||
}
|
||||
return $hash;
|
||||
}
|
||||
|
||||
function fetchtablelist($tablepre = '') {
|
||||
global $db;
|
||||
$arr = explode('.', $tablepre);
|
||||
$dbname = isset($arr[1]) && $arr[1] ? $arr[0] : '';
|
||||
$tablepre = str_replace('_', '\_', $tablepre);
|
||||
$sqladd = $dbname ? " FROM $dbname LIKE '$arr[1]%'" : "LIKE '$tablepre%'";
|
||||
$tables = $table = array();
|
||||
$query = $db->query("SHOW TABLE STATUS $sqladd");
|
||||
while($table = $db->fetch_array($query)) {
|
||||
$table['Name'] = ($dbname ? "$dbname." : '').$table['Name'];
|
||||
$tables[] = $table;
|
||||
}
|
||||
return $tables;
|
||||
}
|
||||
|
||||
function _stripslashes($string) {
|
||||
if(is_array($string)) {
|
||||
foreach($string as $key => $val) {
|
||||
$string[$key] = _stripslashes($val);
|
||||
}
|
||||
} else {
|
||||
$string = stripslashes($string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
function _authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
|
||||
$ckey_length = 4;
|
||||
|
||||
$key = md5($key ? $key : UC_KEY);
|
||||
$keya = md5(substr($key, 0, 16));
|
||||
$keyb = md5(substr($key, 16, 16));
|
||||
$keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : '';
|
||||
|
||||
$cryptkey = $keya.md5($keya.$keyc);
|
||||
$key_length = strlen($cryptkey);
|
||||
|
||||
$string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string;
|
||||
$string_length = strlen($string);
|
||||
|
||||
$result = '';
|
||||
$box = range(0, 255);
|
||||
|
||||
$rndkey = array();
|
||||
for($i = 0; $i <= 255; $i++) {
|
||||
$rndkey[$i] = ord($cryptkey[$i % $key_length]);
|
||||
}
|
||||
|
||||
for($j = $i = 0; $i < 256; $i++) {
|
||||
$j = ($j + $box[$i] + $rndkey[$i]) % 256;
|
||||
$tmp = $box[$i];
|
||||
$box[$i] = $box[$j];
|
||||
$box[$j] = $tmp;
|
||||
}
|
||||
|
||||
for($a = $j = $i = 0; $i < $string_length; $i++) {
|
||||
$a = ($a + 1) % 256;
|
||||
$j = ($j + $box[$a]) % 256;
|
||||
$tmp = $box[$a];
|
||||
$box[$a] = $box[$j];
|
||||
$box[$j] = $tmp;
|
||||
$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
|
||||
}
|
||||
|
||||
if($operation == 'DECODE') {
|
||||
if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {
|
||||
return substr($result, 26);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return $keyc.str_replace('=', '', base64_encode($result));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function strexists($haystack, $needle) {
|
||||
return !(strpos($haystack, $needle) === FALSE);
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,259 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: google.php 34713 2014-07-14 02:33:03Z hypowang $
|
||||
*/
|
||||
|
||||
@define('IN_API', true);
|
||||
@define('CURSCRIPT', 'api');
|
||||
|
||||
require_once('../../source/class/class_core.php');
|
||||
require_once('../../source/function/function_home.php');
|
||||
|
||||
$cachelist = array();
|
||||
$discuz = C::app();
|
||||
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_setting = true;
|
||||
$discuz->init_user = false;
|
||||
$discuz->init_session = false;
|
||||
|
||||
$discuz->init();
|
||||
|
||||
$google = new GoogleAPI($discuz);
|
||||
$google->run();
|
||||
|
||||
class GoogleAPI
|
||||
{
|
||||
var $core;
|
||||
var $version = '2.0.0';
|
||||
function GoogleAPI(&$core) {
|
||||
$this->core = &$core;
|
||||
}
|
||||
|
||||
function run() {
|
||||
$this->authcheck();
|
||||
$method = 'on_'.getgpc('a');
|
||||
if(method_exists($this, $method)) {
|
||||
$this->xmlheader();
|
||||
$this->$method();
|
||||
$this->xmlfooter();
|
||||
} else {
|
||||
$this->error('Unknow command');
|
||||
}
|
||||
}
|
||||
|
||||
function authcheck() {
|
||||
$siteuniqueid = C::t('common_setting')->fetch('siteuniqueid');
|
||||
$auth = md5($siteuniqueid.'DISCUZ*COMSENZ*GOOGLE*API'.substr(time(), 0, 6));
|
||||
if($auth != getgpc('s')) {
|
||||
$this->error('Access error');
|
||||
}
|
||||
}
|
||||
|
||||
function error($message) {
|
||||
$this->xmlheader();
|
||||
echo "<error>".$message."</error>";
|
||||
$this->xmlfooter();
|
||||
}
|
||||
|
||||
function result($message = 'success') {
|
||||
$this->xmlheader();
|
||||
echo "<result>".$message."</result>";
|
||||
$this->xmlfooter();
|
||||
}
|
||||
|
||||
function xmlheader() {
|
||||
static $isshowed;
|
||||
if(!$isshowed) {
|
||||
@header("Content-type: application/xml");
|
||||
echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>\n<document>\n";
|
||||
echo "<description>Discuz! API For Google Function</description>\n";
|
||||
echo "<version>{$this->version}</version>\n";
|
||||
$isshowed = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function xmlfooter($halt = true) {
|
||||
echo "\n</document>\n";
|
||||
$halt && exit();
|
||||
}
|
||||
|
||||
function on_on() {
|
||||
C::t('common_setting')->update('google', 1);
|
||||
$this->result();
|
||||
}
|
||||
|
||||
function on_off() {
|
||||
C::t('common_setting')->update('google', 0);
|
||||
$this->result();
|
||||
}
|
||||
|
||||
function on_gtt() {
|
||||
global $_G;
|
||||
$tids = explode(',', getgpc('t'));
|
||||
$msg = getgpc('msg') ? true : false;
|
||||
$att = getgpc('att') ? true : false;
|
||||
$posts = getgpc('post') ? explode(',', getgpc('post')) : array();
|
||||
if($posts) {
|
||||
$posts[0] = intval($posts[0]);
|
||||
$posts[1] = intval($posts[1]);
|
||||
$posts = sprintf('%s , %s', $posts[0], $posts[1]);
|
||||
}
|
||||
$xmlcontent .= "<threadsdata>\n";
|
||||
if(is_array($tids) && !empty($tids)) {
|
||||
$ftid = $threadlist = $postlist = $attachlist = $pattachlist = array();
|
||||
foreach ($tids as $tid) {
|
||||
if(is_numeric($tid)) {
|
||||
$ftid[] = $tid;
|
||||
}
|
||||
}
|
||||
if($ftid) {
|
||||
$threads = C::t('forum_thread')->fetch_all_by_tid($ftid);
|
||||
foreach($threads as $thread) {
|
||||
$thread['message'] = '';
|
||||
if($msg) {
|
||||
if($thread['posttableid']) {
|
||||
$tablenamelist['forum_post_'.intval($thread['posttableid'])][] = $thread['tid'];
|
||||
} else {
|
||||
$tablenamelist['forum_post'][] = $thread['tid'];
|
||||
}
|
||||
}
|
||||
$threadlist[$thread['tid']] = $thread;
|
||||
}
|
||||
if($msg) {
|
||||
foreach($tablenamelist AS $tablename => $tids) {
|
||||
$pquery = DB::query("SELECT tid, message, pid FROM ".DB::table($tablename)." WHERE tid IN (".dimplode($tids).") AND first=1", 'SILENT');
|
||||
while($pquery && $post = DB::fetch($pquery)) {
|
||||
$threadlist[$post['tid']]['message'] = dhtmlspecialchars($post['message']);
|
||||
if($att) {
|
||||
$_tid = (string)$post['tid'];
|
||||
$attachtablename = 'forum_attachment_'.intval($_tid{strlen($_tid)-1});
|
||||
$aquery = DB::query("SELECT dateline, filename, filesize, attachment, remote, description, readperm, price, isimage, width FROM ".DB::table($attachtablename)." WHERE pid='$post[pid]'");
|
||||
$attachs = '';
|
||||
while($aquery && $attach = DB::fetch($aquery)) {
|
||||
$attach['url'] = (($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/').$attach['attachment'];
|
||||
unset($attach['attachment'], $attach['remote']);
|
||||
$attachs .= '<attach>';
|
||||
foreach($attach as $_k => $_v) {
|
||||
$attachs .= '<'.$_k.'>'.$_v.'</'.$_k.'>';
|
||||
}
|
||||
$attachs .= '</attach>';
|
||||
$attachlist[$_tid] = $attachs;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($posts) {
|
||||
$pquery = DB::query("SELECT tid, pid, authorid, message FROM ".DB::table($tablename)." WHERE tid IN (".dimplode($tids).") AND first=0 LIMIT $posts", 'SILENT');
|
||||
while($pquery && $post = DB::fetch($pquery)) {
|
||||
if($att) {
|
||||
$_tid = (string)$post['tid'];
|
||||
$attachtablename = 'forum_attachment_'.intval($_tid{strlen($_tid)-1});
|
||||
$aquery = DB::query("SELECT dateline, filename, filesize, attachment, remote, description, readperm, price, isimage, width FROM ".DB::table($attachtablename)." WHERE pid='$post[pid]'", 'SILENT');
|
||||
$attachs = '';
|
||||
while($aquery && $attach = DB::fetch($aquery)) {
|
||||
$attach['url'] = (($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/').$attach['attachment'];
|
||||
unset($attach['attachment'], $attach['remote']);
|
||||
$attachs .= '<attach>';
|
||||
foreach($attach as $_k => $_v) {
|
||||
$attachs .= '<'.$_k.'>'.$_v.'</'.$_k.'>';
|
||||
}
|
||||
$attachs .= '</attach>';
|
||||
}
|
||||
}
|
||||
$postlist[$post['tid']] .= "<post>\n".
|
||||
" <pid>".$post['pid']."</pid>\n".
|
||||
" <authorid>".$post['authorid']."</authorid>\n".
|
||||
" <message>".dhtmlspecialchars($post['message'])."</message>\n".
|
||||
($attachs ? " <attachments>$attachs</attachments>\n" : '').
|
||||
"</post>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($tablenamelist);
|
||||
}
|
||||
|
||||
foreach($threadlist AS $tid => $thread) {
|
||||
$xmlcontent .=
|
||||
" <thread>\n".
|
||||
" <tid>$thread[tid]</tid>\n".
|
||||
" <fid>$thread[fid]</fid>\n".
|
||||
" <authorid>$thread[authorid]</authorid>\n".
|
||||
" <subject>$thread[subject]</subject>\n".
|
||||
" <views>$thread[views]</views>\n".
|
||||
" <replies>$thread[replies]</replies>\n".
|
||||
" <special>$thread[replies]</special>\n".
|
||||
" <posttableid>$thread[posttableid]</posttableid>\n".
|
||||
" <dateline>$thread[dateline]</dateline>\n".
|
||||
" <lastpost>$thread[lastpost]</lastpost>\n".
|
||||
($msg ? " <message>$thread[message]</message>\n" : '').
|
||||
($attachlist[$tid] ? " <attachments>$attachlist[$tid]</attachments>\n" : '').
|
||||
" </thread>\n".
|
||||
($postlist[$tid] ? " <posts>$postlist[$tid]</posts>\n" : '');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$xmlcontent .= "</threadsdata>";
|
||||
echo $xmlcontent;
|
||||
}
|
||||
|
||||
function on_gts() {
|
||||
$xmlcontent = '';
|
||||
$threads = C::t('forum_thread')->count();
|
||||
|
||||
$posts = 0;
|
||||
loadcache('posttableids');
|
||||
if($_G['cache']['posttableids']) {
|
||||
foreach($_G['cache']['posttableids'] AS $tableid) {
|
||||
$posts += DB::result_first("SELECT COUNT(*) FROM ".DB::table(getposttable($tableid))." LIMIT 1");
|
||||
}
|
||||
}
|
||||
$members = C::t('common_member')->count();
|
||||
$settings = C::t('common_setting')->fetch_all(array('bbname', 'historyposts'));
|
||||
$bbname = $settings['bbname'];
|
||||
$yesterdayposts = $settings['historyposts'];
|
||||
if(!empty($yesterdayposts)) {
|
||||
$yesterdayposts = explode("\t", $yesterdayposts);
|
||||
$yestoday = intval($yesterdayposts[0]);
|
||||
$mostpost = intval($yesterdayposts[1]);
|
||||
} else {
|
||||
$yestoday = $mostpost = 0;
|
||||
}
|
||||
|
||||
$xmlcontent .= "<sitedata>\n".
|
||||
" <bbname>".dhtmlspecialchars($bbname)."</bbname>\n".
|
||||
" <threads>$threads</threads>\n".
|
||||
" <posts>$posts</posts>\n".
|
||||
" <members>$members</members>\n".
|
||||
" <yesterdayposts>$yestoday</yesterdayposts>\n".
|
||||
" <mostposts>$mostpost</mostposts>\n".
|
||||
"</sitedata>\n";
|
||||
echo $xmlcontent;
|
||||
|
||||
echo "<forumdata>\n";
|
||||
$query = C::t('forum_forum')->fetch_all_forum_ignore_access();
|
||||
foreach($query as $forum) {
|
||||
echo " <$forum[type]>\n".
|
||||
" <fid>$forum[fid]</fid>\n".
|
||||
" <fup>$forum[fup]</fup>\n".
|
||||
" <name>".dhtmlspecialchars($forum['name'])."</name>\n".
|
||||
" <description>".dhtmlspecialchars($forum['description'])."</description>\n".
|
||||
" <threads>$forum[threads]</threads>\n".
|
||||
" <posts>$forum[posts]</posts>\n".
|
||||
" <todayposts>$forum[todayposts]</todayposts>\n".
|
||||
" </$forum[type]>\n";
|
||||
}
|
||||
|
||||
echo "</forumdata>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: advertisement.php 25246 2011-11-02 03:34:53Z zhangguosheng $
|
||||
*/
|
||||
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 60).' GMT');
|
||||
|
||||
if(!defined('IN_API')) {
|
||||
exit('document.write(\'Access Denied\')');
|
||||
}
|
||||
|
||||
loadcore();
|
||||
|
||||
$adid = $_GET['adid'];
|
||||
$data = adshow($adid);
|
||||
|
||||
echo 'document.write(\''.preg_replace("/\r\n|\n|\r/", '\n', addcslashes($data, "'\\")).'\');';
|
||||
|
||||
?>
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: javascript.php 25246 2011-11-02 03:34:53Z zhangguosheng $
|
||||
*/
|
||||
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 60).' GMT');
|
||||
|
||||
if(!defined('IN_API')) {
|
||||
exit('document.write(\'Access Denied\')');
|
||||
}
|
||||
|
||||
loadcore();
|
||||
|
||||
include_once libfile('function/block');
|
||||
|
||||
loadcache('blockclass');
|
||||
$bid = intval($_GET['bid']);
|
||||
block_get_batch($bid);
|
||||
$data = block_fetch_content($bid, true);
|
||||
|
||||
$search = "/(href|src)\=(\"|')(?![fhtps]+\:)(.*?)\\2/i";
|
||||
$replace = "\\1=\\2$_G[siteurl]\\3\\2";
|
||||
$data = preg_replace($search, $replace, $data);
|
||||
|
||||
echo 'document.write(\''.preg_replace("/\r\n|\n|\r/", '\n', addcslashes($data, "'\\")).'\');';
|
||||
|
||||
?>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=gbk" />
|
||||
<script language="javascript" type="text/javascript" src="http://static.manyou.com/scripts/my_iframe.js"></script>
|
||||
<script language="javascript">
|
||||
var channel = new MyXD.Channel();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<script language="javascript" type="text/javascript" src="http://discuz.gtimg.cn/cloud/scripts/discuz_channel.js" defer="defer" charset="utf-8"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=GBK">
|
||||
<script type="text/javascript" src="http://widgets.manyou.com/misc/scripts/ab.js" charset="UTF-8"></script>
|
||||
</head>
|
||||
<body onload="MYABC.onCBPageLoad()">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: my.php 34170 2013-10-28 02:58:29Z nemohou $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
define('DISABLEDEFENSE', true);
|
||||
define('DISABLEXSSCHECK', true);
|
||||
require_once('../../source/class/class_core.php');
|
||||
require_once('../../source/function/function_home.php');
|
||||
|
||||
$cachelist = array();
|
||||
$discuz = C::app();
|
||||
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_setting = true;
|
||||
$discuz->init_user = false;
|
||||
$discuz->init_session = false;
|
||||
|
||||
$discuz->init();
|
||||
|
||||
$siteId = $_G['setting']['my_siteid'];
|
||||
$siteKey = $_G['setting']['my_sitekey'];
|
||||
$timezone = $_G['setting']['timeoffset'];
|
||||
$language = $_SC['language'] ? $_SC['language'] : 'zh_CN';
|
||||
$version = $_G['setting']['version'];
|
||||
$myAppStatus = $_G['setting']['my_app_status'];
|
||||
$mySearchStatus = $_G['setting']['my_search_status'];
|
||||
|
||||
$my = Cloud::loadClass('Service_Server_My', array($siteId, $siteKey, $timezone, $version, CHARSET, $language, $myAppStatus, $mySearchStatus));
|
||||
$my->run();
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: index.php 33969 2013-09-10 08:32:14Z nemohou $
|
||||
*/
|
||||
|
||||
if(!empty($_SERVER['QUERY_STRING'])) {
|
||||
$plugin = !empty($_GET['oem']) ? 'mobileoem' : 'mobile';
|
||||
$dir = '../../source/plugin/'.$plugin.'/';
|
||||
chdir($dir);
|
||||
if((isset($_GET['check']) && $_GET['check'] == 'check' || $_SERVER['QUERY_STRING'] == 'check') && is_file('check.php')) {
|
||||
require_once 'check.php';
|
||||
} elseif(is_file('mobile.php')) {
|
||||
require_once 'mobile.php';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: index.php 23508 2011-07-21 06:34:40Z cnteacher $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api_mserver');
|
||||
define('APPTYPEID', 200);
|
||||
|
||||
$_ENV['remote'] = new discuz_remote();
|
||||
$_ENV['remote']->init();
|
||||
$_ENV['remote']->loadservice();
|
||||
|
||||
class discuz_remote {
|
||||
|
||||
var $mod;
|
||||
var $modobj;
|
||||
var $core;
|
||||
|
||||
function init() {
|
||||
|
||||
require_once('../../source/class/class_core.php');
|
||||
|
||||
$cachelist = array();
|
||||
$this->core = C::app();
|
||||
|
||||
$this->core->cachelist = $cachelist;
|
||||
|
||||
|
||||
$this->core->init_setting = true;
|
||||
|
||||
$this->core->init_cron = false;
|
||||
$this->core->init_user = false;
|
||||
$this->core->init_session = false;
|
||||
$this->core->init_misc = false;
|
||||
$this->core->init_mobile = false;
|
||||
|
||||
$this->core->init();
|
||||
|
||||
define('SERVICE_DIR', getglobal('config/remote/dir') ? getglobal('config/remote/dir') : 'remote');
|
||||
$this->core->reject_robot();
|
||||
|
||||
if (empty($_GET['mod']) || preg_match('/[^0-9a-z]/i', $_GET['mod'])) {
|
||||
$this->mod = 'index';
|
||||
} else {
|
||||
$this->mod = $_GET['mod'];
|
||||
}
|
||||
}
|
||||
|
||||
function loadservice() {
|
||||
|
||||
if(!$this->core->config['remote']['on']) {
|
||||
remote_service::error(1, 'remote service is down');
|
||||
}
|
||||
|
||||
if(!$this->core->config['remote']['appkey']) {
|
||||
remote_service::error(1, 'remote service need a appkey, please edit you config.global.php');
|
||||
}
|
||||
|
||||
if ($this->mod != 'index') {
|
||||
|
||||
$sign = $_GET['sign'];
|
||||
unset($_GET['sign']);
|
||||
|
||||
if (empty($sign) || $sign != $this->sign($_GET)) {
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->check_timestamp()) {
|
||||
remote_service::error(5, 'your request is time out');
|
||||
}
|
||||
|
||||
$modfile = DISCUZ_ROOT . './api/' . SERVICE_DIR . '/mod/mod_' . $this->mod . '.php';
|
||||
if (!is_file($modfile)) {
|
||||
remote_service::error(3, 'mod file is missing');
|
||||
}
|
||||
|
||||
require $modfile;
|
||||
$classname = 'mod_'.$this->mod;
|
||||
if(class_exists($classname)) {
|
||||
$service = new $classname;
|
||||
$service->run();
|
||||
}
|
||||
}
|
||||
|
||||
function check_timestamp()
|
||||
{
|
||||
if(empty($_GET['timestamp'])) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
$ttl = abs(empty($_GET['ttl']) ? 600 : $_GET['ttl']);
|
||||
$check = abs(TIMESTAMP - $_GET['timestamp']);
|
||||
return $check > $ttl ? 0 : 1;
|
||||
}
|
||||
|
||||
function sign($arg) {
|
||||
$str = '';
|
||||
foreach ($arg as $k => $v) {
|
||||
$str .= $k . '=' . $v . '&';
|
||||
}
|
||||
return md5($str . getglobal('config/remote/appkey'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class remote_service {
|
||||
|
||||
var $version = '1.0.0';
|
||||
var $config;
|
||||
|
||||
function remote_service() {
|
||||
$this->config = getglobal('config/remote');
|
||||
}
|
||||
|
||||
function run() {
|
||||
remote_service::success('service is done.');
|
||||
}
|
||||
|
||||
function error($code, $msg) {
|
||||
$code = sprintf("%04d", $code);
|
||||
echo $code.':'.ucfirst($msg);
|
||||
exit();
|
||||
}
|
||||
|
||||
function success($msg) {
|
||||
remote_service::error(0, $msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: mod_cron.php 30364 2012-05-24 07:43:27Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class mod_cron extends remote_service
|
||||
{
|
||||
function run() {
|
||||
|
||||
if(!$this->config['cron']) {
|
||||
$this->error(100, 'cron service is off. Please check "config.global.php" on your webserver folder.');
|
||||
}
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->initated = false;
|
||||
$discuz->init_db = false;
|
||||
$discuz->init_setting = true;
|
||||
$discuz->init_user = false;
|
||||
$discuz->init_session = false;
|
||||
$discuz->init_misc = false;
|
||||
$discuz->init_mobile = false;
|
||||
$discuz->init_cron = true;
|
||||
$discuz->init();
|
||||
|
||||
$this->success('Cron work is done');
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: mod_index.php 30462 2012-05-30 03:27:10Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class mod_index extends remote_service {
|
||||
|
||||
var $config;
|
||||
function mod_index() {
|
||||
parent::remote_service();
|
||||
}
|
||||
|
||||
function run() {
|
||||
$this->success('Discuz! Remote Service API '.$this->version);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,296 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: api_alipay.php 31606 2012-09-13 07:26:35Z monkey $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
list($ec_contract, $ec_securitycode, $ec_partner, $ec_creditdirectpay) = explode("\t", authcode($_G['setting']['ec_contract'], 'DECODE', $_G['config']['security']['authkey']));
|
||||
|
||||
define('DISCUZ_PARTNER', $ec_partner);
|
||||
define('DISCUZ_SECURITYCODE', $ec_securitycode);
|
||||
define('DISCUZ_DIRECTPAY', $ec_creditdirectpay);
|
||||
|
||||
define('STATUS_SELLER_SEND', 4);
|
||||
define('STATUS_WAIT_BUYER', 5);
|
||||
define('STATUS_TRADE_SUCCESS', 7);
|
||||
define('STATUS_REFUND_CLOSE', 17);
|
||||
|
||||
function credit_payurl($price, &$orderid) {
|
||||
global $_G;
|
||||
|
||||
$orderid = dgmdate(TIMESTAMP, 'YmdHis').random(18);
|
||||
|
||||
$args = array(
|
||||
'subject' => $_G['setting']['bbname'].' - '.$_G['member']['username'].' - '.lang('forum/misc', 'credit_payment'),
|
||||
'body' => lang('forum/misc', 'credit_forum_payment').' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.intval($price * $_G['setting']['ec_ratio']).' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit'],
|
||||
'service' => 'trade_create_by_buyer',
|
||||
'partner' => DISCUZ_PARTNER,
|
||||
'notify_url' => $_G['siteurl'].'api/trade/notify_credit.php',
|
||||
'return_url' => $_G['siteurl'].'api/trade/notify_credit.php',
|
||||
'show_url' => $_G['siteurl'],
|
||||
'_input_charset' => CHARSET,
|
||||
'out_trade_no' => $orderid,
|
||||
'price' => $price,
|
||||
'quantity' => 1,
|
||||
'seller_email' => $_G['setting']['ec_account'],
|
||||
'extend_param' => 'isv^dz11'
|
||||
);
|
||||
if(DISCUZ_DIRECTPAY) {
|
||||
$args['service'] = 'create_direct_pay_by_user';
|
||||
$args['payment_type'] = '1';
|
||||
} else {
|
||||
$args['logistics_type'] = 'EXPRESS';
|
||||
$args['logistics_fee'] = 0;
|
||||
$args['logistics_payment'] = 'SELLER_PAY';
|
||||
$args['payment_type'] = 1;
|
||||
}
|
||||
return trade_returnurl($args);
|
||||
}
|
||||
|
||||
function invite_payurl($amount, $price, &$orderid) {
|
||||
global $_G;
|
||||
|
||||
$orderid = dgmdate(TIMESTAMP, 'YmdHis').random(18);
|
||||
|
||||
$args = array(
|
||||
'subject' => $_G['setting']['bbname'].' - '.lang('forum/misc', 'invite_payment'),
|
||||
'body' => lang('forum/misc', 'invite_forum_payment').' '.intval($amount).' '.lang('forum/misc', 'invite_forum_payment_unit'),
|
||||
'service' => 'trade_create_by_buyer',
|
||||
'partner' => DISCUZ_PARTNER,
|
||||
'notify_url' => $_G['siteurl'].'api/trade/notify_invite.php',
|
||||
'return_url' => $_G['siteurl'].'api/trade/notify_invite.php',
|
||||
'show_url' => $_G['siteurl'],
|
||||
'_input_charset' => CHARSET,
|
||||
'out_trade_no' => $orderid,
|
||||
'price' => $price,
|
||||
'quantity' => 1,
|
||||
'seller_email' => $_G['setting']['ec_account'],
|
||||
'extend_param' => 'isv^dz11'
|
||||
);
|
||||
if(DISCUZ_DIRECTPAY) {
|
||||
$args['service'] = 'create_direct_pay_by_user';
|
||||
$args['payment_type'] = '1';
|
||||
} else {
|
||||
$args['logistics_type'] = 'EXPRESS';
|
||||
$args['logistics_fee'] = 0;
|
||||
$args['logistics_payment'] = 'SELLER_PAY';
|
||||
$args['payment_type'] = 1;
|
||||
}
|
||||
return trade_returnurl($args);
|
||||
}
|
||||
|
||||
function trade_payurl($pay, $trade, $tradelog) {
|
||||
global $_G;
|
||||
|
||||
$args = array(
|
||||
'service' => 'trade_create_by_buyer',
|
||||
'partner' => DISCUZ_PARTNER,
|
||||
'notify_url' => $_G['siteurl'].'api/trade/notify_trade.php',
|
||||
'return_url' => $_G['siteurl'].'api/trade/notify_trade.php',
|
||||
'show_url' => $tradelog['tid'] ? $_G['siteurl'].'forum.php?mod=viewthread&do=tradeinfo&tid='.$tradelog['tid'].'&pid='.$tradelog['pid'] : $_G['siteurl'],
|
||||
'_input_charset' => CHARSET,
|
||||
'subject' => $trade['subject'],
|
||||
'body' => $trade['subject'],
|
||||
'out_trade_no' => $tradelog['orderid'],
|
||||
'price' => $tradelog['baseprice'],
|
||||
'quantity' => $tradelog['number'],
|
||||
'logistics_type' => $pay['logistics_type'],
|
||||
'logistics_fee' => $tradelog['transportfee'],
|
||||
'logistics_payment' => $pay['transport'],
|
||||
'payment_type' => $trade['itemtype'],
|
||||
'seller_email' => $trade['account'],
|
||||
'extend_param' => 'isv^dz11'
|
||||
);
|
||||
|
||||
if($pay['logistics_type'] == 'VIRTUAL') {
|
||||
if(DISCUZ_DIRECTPAY) {
|
||||
$args['service'] = 'create_direct_pay_by_user';
|
||||
$args['payment_type'] = '1';
|
||||
unset($args['logistics_type'], $args['logistics_fee'], $args['logistics_payment']);
|
||||
} else {
|
||||
$args['logistics_type'] = 'EXPRESS';
|
||||
$args['logistics_payment'] = 'SELLER_PAY';
|
||||
$args['payment_type'] = '1';
|
||||
}
|
||||
}
|
||||
return trade_returnurl($args);
|
||||
}
|
||||
|
||||
function trade_returnurl($args) {
|
||||
global $_G;
|
||||
ksort($args);
|
||||
$urlstr = $sign = '';
|
||||
foreach($args as $key => $val) {
|
||||
$sign .= '&'.$key.'='.$val;
|
||||
$urlstr .= $key.'='.rawurlencode($val).'&';
|
||||
}
|
||||
$sign = substr($sign, 1);
|
||||
$sign = md5($sign.DISCUZ_SECURITYCODE);
|
||||
return 'https://www.alipay.com/cooperate/gateway.do?'.$urlstr.'sign='.$sign.'&sign_type=MD5';
|
||||
}
|
||||
|
||||
function trade_notifycheck($type) {
|
||||
global $_G;
|
||||
if(!empty($_POST)) {
|
||||
$notify = $_POST;
|
||||
$location = FALSE;
|
||||
} elseif(!empty($_GET)) {
|
||||
$notify = $_GET;
|
||||
$location = TRUE;
|
||||
} else {
|
||||
exit('Access Denied');
|
||||
}
|
||||
unset($notify['diy']);
|
||||
if(dfsockopen("http://notify.alipay.com/trade/notify_query.do?partner=".DISCUZ_PARTNER."¬ify_id=".$notify['notify_id'], 60) !== 'true') {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if($type == 'trade') {
|
||||
$urlstr = '';
|
||||
foreach($notify as $key => $val) {
|
||||
$urlstr .= $key.'='.rawurlencode($val).'&';
|
||||
}
|
||||
} else {
|
||||
if(!DISCUZ_SECURITYCODE) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
ksort($notify);
|
||||
$sign = '';
|
||||
foreach($notify as $key => $val) {
|
||||
if($key != 'sign' && $key != 'sign_type') $sign .= "&$key=$val";
|
||||
}
|
||||
if($notify['sign'] != md5(substr($sign,1).DISCUZ_SECURITYCODE)) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
}
|
||||
|
||||
if(($type == 'credit' || $type == 'invite') && (!DISCUZ_DIRECTPAY && $notify['notify_type'] == 'trade_status_sync' && ($notify['trade_status'] == 'WAIT_SELLER_SEND_GOODS' || $notify['trade_status'] == 'TRADE_FINISHED') || DISCUZ_DIRECTPAY && ($notify['trade_status'] == 'TRADE_FINISHED' || $notify['trade_status'] == 'TRADE_SUCCESS'))
|
||||
|| $type == 'trade' && $notify['notify_type'] == 'trade_status_sync') {
|
||||
return array(
|
||||
'validator' => TRUE,
|
||||
'status' => trade_getstatus(!empty($notify['refund_status']) ? $notify['refund_status'] : $notify['trade_status'], 1),
|
||||
'order_no' => $notify['out_trade_no'],
|
||||
'price' => !DISCUZ_DIRECTPAY && $notify['price'] ? $notify['price'] : $notify['total_fee'],
|
||||
'trade_no' => $notify['trade_no'],
|
||||
'notify' => 'success',
|
||||
'location' => $location
|
||||
);
|
||||
} else {
|
||||
return array(
|
||||
'validator' => FALSE,
|
||||
'notify' => 'fail',
|
||||
'location' => $location
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function trade_getorderurl($orderid) {
|
||||
return 'https://www.alipay.com/trade/query_trade_detail.htm?trade_no='.$orderid;
|
||||
}
|
||||
|
||||
function trade_typestatus($method, $status = -1) {
|
||||
switch($method) {
|
||||
case 'buytrades' : $methodvalue = array(1, 5, 11, 12);break;
|
||||
case 'selltrades' : $methodvalue = array(2, 4, 10, 13);break;
|
||||
case 'successtrades' : $methodvalue = array(7);break;
|
||||
case 'tradingtrades' : $methodvalue = array(1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16);break;
|
||||
case 'closedtrades' : $methodvalue = array(8, 17);break;
|
||||
case 'refundsuccess' : $methodvalue = array(17);break;
|
||||
case 'refundtrades' : $methodvalue = array(14, 15, 16, 17, 18);break;
|
||||
case 'unstarttrades' : $methodvalue = array(0);break;
|
||||
case 'eccredittrades' : $methodvalue = array(7, 17);break;
|
||||
}
|
||||
return $status != -1 ? in_array($status, $methodvalue) : $methodvalue;
|
||||
}
|
||||
|
||||
function trade_getstatus($key, $method = 2) {
|
||||
$language = lang('forum/misc');
|
||||
$status[1] = array(
|
||||
'WAIT_BUYER_PAY' => 1,
|
||||
'WAIT_SELLER_CONFIRM_TRADE' => 2,
|
||||
'WAIT_SYS_CONFIRM_PAY' => 3,
|
||||
'WAIT_SELLER_SEND_GOODS' => 4,
|
||||
'WAIT_BUYER_CONFIRM_GOODS' => 5,
|
||||
'WAIT_SYS_PAY_SELLER' => 6,
|
||||
'TRADE_FINISHED' => 7,
|
||||
'TRADE_CLOSED' => 8,
|
||||
'WAIT_SELLER_AGREE' => 10,
|
||||
'SELLER_REFUSE_BUYER' => 11,
|
||||
'WAIT_BUYER_RETURN_GOODS' => 12,
|
||||
'WAIT_SELLER_CONFIRM_GOODS' => 13,
|
||||
'WAIT_ALIPAY_REFUND' => 14,
|
||||
'ALIPAY_CHECK' => 15,
|
||||
'OVERED_REFUND' => 16,
|
||||
'REFUND_SUCCESS' => 17,
|
||||
'REFUND_CLOSED' => 18
|
||||
);
|
||||
$status[2] = array(
|
||||
0 => $language['trade_unstart'],
|
||||
1 => $language['trade_waitbuyerpay'],
|
||||
2 => $language['trade_waitsellerconfirm'],
|
||||
3 => $language['trade_sysconfirmpay'],
|
||||
4 => $language['trade_waitsellersend'],
|
||||
5 => $language['trade_waitbuyerconfirm'],
|
||||
6 => $language['trade_syspayseller'],
|
||||
7 => $language['trade_finished'],
|
||||
8 => $language['trade_closed'],
|
||||
10 => $language['trade_waitselleragree'],
|
||||
11 => $language['trade_sellerrefusebuyer'],
|
||||
12 => $language['trade_waitbuyerreturn'],
|
||||
13 => $language['trade_waitsellerconfirmgoods'],
|
||||
14 => $language['trade_waitalipayrefund'],
|
||||
15 => $language['trade_alipaycheck'],
|
||||
16 => $language['trade_overedrefund'],
|
||||
17 => $language['trade_refundsuccess'],
|
||||
18 => $language['trade_refundclosed']
|
||||
);
|
||||
return $method == -1 ? $status[2] : $status[$method][$key];
|
||||
}
|
||||
|
||||
function trade_setprice($data, &$price, &$pay, &$transportfee) {
|
||||
if($data['transport'] == 1) {
|
||||
$pay['transport'] = 'SELLER_PAY';
|
||||
} elseif($data['transport'] == 2) {
|
||||
$pay['transport'] = 'BUYER_PAY';
|
||||
} elseif($data['transport'] == 3) {
|
||||
$pay['logistics_type'] = 'VIRTUAL';
|
||||
} else {
|
||||
$pay['transport'] = 'BUYER_PAY_AFTER_RECEIVE';
|
||||
}
|
||||
|
||||
if($data['transport'] != 3) {
|
||||
if($data['fee'] == 1) {
|
||||
$pay['logistics_type'] = 'POST';
|
||||
$pay['logistics_fee'] = $data['trade']['ordinaryfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['ordinaryfee'];
|
||||
$transportfee = $data['trade']['ordinaryfee'];
|
||||
}
|
||||
} elseif($data['fee'] == 2) {
|
||||
$pay['logistics_type'] = 'EMS';
|
||||
$pay['logistics_fee'] = $data['trade']['emsfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['emsfee'];
|
||||
$transportfee = $data['trade']['emsfee'];
|
||||
}
|
||||
} else {
|
||||
$pay['logistics_type'] = 'EXPRESS';
|
||||
$pay['logistics_fee'] = $data['trade']['expressfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['expressfee'];
|
||||
$transportfee = $data['trade']['expressfee'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,582 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: api_tenpay.php 32222 2012-12-03 02:28:43Z monkey $
|
||||
*/
|
||||
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('DISCUZ_PARTNER', $_G['setting']['ec_tenpay_bargainor']);
|
||||
define('DISCUZ_SECURITYCODE', $_G['setting']['ec_tenpay_key']);
|
||||
define('DISCUZ_AGENTID', '1204737401');
|
||||
|
||||
define('DISCUZ_TENPAY_OPENTRANS_CHNID', $_G['setting']['ec_tenpay_opentrans_chnid']);
|
||||
define('DISCUZ_TENPAY_OPENTRANS_KEY', $_G['setting']['ec_tenpay_opentrans_key']);
|
||||
|
||||
define('STATUS_SELLER_SEND', 3);
|
||||
define('STATUS_WAIT_BUYER', 4);
|
||||
define('STATUS_TRADE_SUCCESS', 5);
|
||||
define('STATUS_REFUND_CLOSE', 9);
|
||||
|
||||
class RequestHandler {
|
||||
|
||||
var $gateUrl;
|
||||
|
||||
var $key;
|
||||
|
||||
var $parameters;
|
||||
|
||||
var $debugInfo;
|
||||
|
||||
function __construct() {
|
||||
$this->RequestHandler();
|
||||
}
|
||||
|
||||
function RequestHandler() {
|
||||
$this->gateUrl = "https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi";
|
||||
$this->key = "";
|
||||
$this->parameters = array();
|
||||
$this->debugInfo = "";
|
||||
}
|
||||
|
||||
function init() {
|
||||
}
|
||||
|
||||
function getGateURL() {
|
||||
return $this->gateUrl;
|
||||
}
|
||||
|
||||
function setGateURL($gateUrl) {
|
||||
$this->gateUrl = $gateUrl;
|
||||
}
|
||||
|
||||
function getKey() {
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
function setKey($key) {
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
function getParameter($parameter) {
|
||||
return $this->parameters[$parameter];
|
||||
}
|
||||
|
||||
function setParameter($parameter, $parameterValue) {
|
||||
$this->parameters[$parameter] = $parameterValue;
|
||||
}
|
||||
|
||||
function getAllParameters() {
|
||||
$this->createSign();
|
||||
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
function getRequestURL() {
|
||||
$this->createSign();
|
||||
$reqPar = "";
|
||||
ksort($this->parameters);
|
||||
foreach($this->parameters as $k => $v) {
|
||||
$reqPar .= $k . "=" . urlencode($v) . "&";
|
||||
}
|
||||
|
||||
$reqPar = substr($reqPar, 0, strlen($reqPar)-1);
|
||||
$requestURL = $this->getGateURL() . "?" . $reqPar;
|
||||
return $requestURL;
|
||||
|
||||
}
|
||||
|
||||
function getDebugInfo() {
|
||||
return $this->debugInfo;
|
||||
}
|
||||
|
||||
function doSend() {
|
||||
header("Location:" . $this->getRequestURL());
|
||||
exit;
|
||||
}
|
||||
|
||||
function createSign() {
|
||||
$signPars = "";
|
||||
ksort($this->parameters);
|
||||
foreach($this->parameters as $k => $v) {
|
||||
if("" !== $v && "sign" !== $k) {
|
||||
$signPars .= $k . "=" . $v . "&";
|
||||
}
|
||||
}
|
||||
$signPars .= "key=" . $this->getKey();
|
||||
$sign = strtolower(md5($signPars));
|
||||
$this->setParameter("sign", $sign);
|
||||
$this->_setDebugInfo($signPars . " => sign:" . $sign);
|
||||
|
||||
}
|
||||
|
||||
function _setDebugInfo($debugInfo) {
|
||||
$this->debugInfo = $debugInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ResponseHandler {
|
||||
|
||||
var $key;
|
||||
|
||||
var $parameters;
|
||||
|
||||
var $debugInfo;
|
||||
|
||||
function __construct() {
|
||||
$this->ResponseHandler();
|
||||
}
|
||||
|
||||
function ResponseHandler() {
|
||||
$this->key = "";
|
||||
$this->parameters = array();
|
||||
$this->debugInfo = "";
|
||||
|
||||
foreach($_GET as $k => $v) {
|
||||
$this->setParameter($k, $v);
|
||||
}
|
||||
foreach($_POST as $k => $v) {
|
||||
$this->setParameter($k, $v);
|
||||
}
|
||||
}
|
||||
|
||||
function getKey() {
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
function setKey($key) {
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
function getParameter($parameter) {
|
||||
return $this->parameters[$parameter];
|
||||
}
|
||||
|
||||
function setParameter($parameter, $parameterValue) {
|
||||
$this->parameters[$parameter] = $parameterValue;
|
||||
}
|
||||
|
||||
function getAllParameters() {
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
function isTenpaySign() {
|
||||
$signPars = "";
|
||||
|
||||
ksort($this->parameters);
|
||||
foreach($this->parameters as $k => $v) {
|
||||
if("sign" !== $k && "" !== $v) {
|
||||
$signPars .= $k . "=" . $v . "&";
|
||||
}
|
||||
}
|
||||
$signPars .= "key=" . $this->getKey();
|
||||
$sign = strtolower(md5($signPars));
|
||||
$tenpaySign = strtolower($this->getParameter("sign"));
|
||||
$this->_setDebugInfo($signPars . " => sign:" . $sign .
|
||||
" tenpaySign:" . $this->getParameter("sign"));
|
||||
|
||||
return $sign == $tenpaySign;
|
||||
|
||||
}
|
||||
|
||||
function getDebugInfo() {
|
||||
return $this->debugInfo;
|
||||
}
|
||||
|
||||
function _setDebugInfo($debugInfo) {
|
||||
$this->debugInfo = $debugInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MediPayRequestHandler extends RequestHandler {
|
||||
|
||||
function __construct() {
|
||||
$this->MediPayRequestHandler();
|
||||
}
|
||||
|
||||
function MediPayRequestHandler() {
|
||||
$this->setGateURL("https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi");
|
||||
}
|
||||
|
||||
function init() {
|
||||
$this->setParameter("attach", "1");
|
||||
|
||||
$this->setParameter("chnid", "");
|
||||
|
||||
$this->setParameter("cmdno", "12");
|
||||
|
||||
$this->setParameter("encode_type", "1");
|
||||
|
||||
$this->setParameter("mch_desc", "");
|
||||
|
||||
$this->setParameter("mch_name", "");
|
||||
|
||||
$this->setParameter("mch_price", "");
|
||||
|
||||
$this->setParameter("mch_returl", "");
|
||||
|
||||
$this->setParameter("mch_type", "");
|
||||
|
||||
$this->setParameter("mch_vno", "");
|
||||
|
||||
$this->setParameter("need_buyerinfo", "");
|
||||
|
||||
$this->setParameter("seller", "");
|
||||
|
||||
$this->setParameter("show_url", "");
|
||||
|
||||
$this->setParameter("transport_desc", "");
|
||||
|
||||
$this->setParameter("transport_fee", "");
|
||||
|
||||
$this->setParameter("version", "2");
|
||||
|
||||
$this->setParameter("sign", "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MediPayResponseHandler extends ResponseHandler {
|
||||
|
||||
function doShow() {
|
||||
$strHtml = "<html><head>\r\n" .
|
||||
"<meta name=\"TENCENT_ONLINE_PAYMENT\" content=\"China TENCENT\">" .
|
||||
"</head><body></body></html>";
|
||||
|
||||
echo $strHtml;
|
||||
|
||||
exit;
|
||||
}
|
||||
function isTenpaySign() {
|
||||
|
||||
$signParameterArray = array(
|
||||
'attach',
|
||||
'buyer_id',
|
||||
'cft_tid',
|
||||
'chnid',
|
||||
'cmdno',
|
||||
'mch_vno',
|
||||
'retcode',
|
||||
'seller',
|
||||
'status',
|
||||
'total_fee',
|
||||
'trade_price',
|
||||
'transport_fee',
|
||||
'version'
|
||||
);
|
||||
|
||||
ksort($signParameterArray);
|
||||
|
||||
foreach($signParameterArray as $k ) {
|
||||
$v = $this->getParameter($k);
|
||||
if(isset($v)) {
|
||||
$signPars .= $k . "=" . urldecode($v) . "&";
|
||||
}
|
||||
}
|
||||
|
||||
$signPars .= "key=" . $this->getKey();
|
||||
|
||||
$sign = strtolower(md5($signPars));
|
||||
|
||||
$tenpaySign = strtolower($this->getParameter("sign"));
|
||||
|
||||
$this->_setDebugInfo($signPars . " => sign:" . $sign .
|
||||
" tenpaySign:" . $this->getParameter("sign"));
|
||||
|
||||
return $sign == $tenpaySign;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function credit_payurl($price, &$orderid, $bank = 'DEFAULT') {
|
||||
include_once DISCUZ_ROOT . './source/class/class_chinese.php';
|
||||
global $_G;
|
||||
|
||||
$date = dgmdate(TIMESTAMP, 'YmdHis');
|
||||
$suffix = dgmdate(TIMESTAMP, 'His').rand(1000, 9999);
|
||||
$transaction_id = DISCUZ_PARTNER.$date.$suffix;
|
||||
|
||||
$orderid = dgmdate(TIMESTAMP, 'YmdHis').random(14);
|
||||
|
||||
$chinese = new Chinese(strtoupper(CHARSET), 'GBK');
|
||||
$subject = $chinese->Convert(lang('forum/misc', 'credit_forum_payment').' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.intval($price * $_G['setting']['ec_ratio']).' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit']);
|
||||
|
||||
$reqHandler = new RequestHandler();
|
||||
$reqHandler->setGateURL("https://gw.tenpay.com/gateway/pay.htm");
|
||||
|
||||
$reqHandler->init();
|
||||
$reqHandler->setKey(DISCUZ_SECURITYCODE);
|
||||
|
||||
$reqHandler->setParameter("partner", DISCUZ_PARTNER);
|
||||
$reqHandler->setParameter("out_trade_no", $orderid);
|
||||
$reqHandler->setParameter("total_fee", $price * 100);
|
||||
$reqHandler->setParameter("return_url", $_G['siteurl'].'api/trade/notify_credit.php');
|
||||
$reqHandler->setParameter("notify_url", $_G['siteurl'].'api/trade/notify_credit.php');
|
||||
$reqHandler->setParameter("body", $subject);
|
||||
$reqHandler->setParameter("bank_type", $bank);
|
||||
|
||||
$reqHandler->setParameter("spbill_create_ip", $_G['clientip']);
|
||||
$reqHandler->setParameter("fee_type", "1");
|
||||
$reqHandler->setParameter("subject", $subject);
|
||||
|
||||
$reqHandler->setParameter("sign_type", "MD5");
|
||||
$reqHandler->setParameter("service_version", "1.0");
|
||||
$reqHandler->setParameter("input_charset", "GBK");
|
||||
$reqHandler->setParameter("sign_key_index", "1");
|
||||
|
||||
$reqHandler->setParameter("attach", "tenpay");
|
||||
$reqHandler->setParameter("time_start", $date);
|
||||
$reqHandler->setParameter("trade_mode","1");
|
||||
$reqHandler->setParameter("trans_type","1");
|
||||
$reqHandler->setParameter("agentid", DISCUZ_AGENTID);
|
||||
$reqHandler->setParameter("agent_type","2");
|
||||
|
||||
$reqUrl = $reqHandler->getRequestURL();
|
||||
return $reqUrl;
|
||||
}
|
||||
|
||||
function trade_payurl($pay, $trade, $tradelog) {
|
||||
global $_G;
|
||||
|
||||
$key = DISCUZ_TENPAY_OPENTRANS_KEY;
|
||||
|
||||
$chnid = DISCUZ_TENPAY_OPENTRANS_CHNID;
|
||||
|
||||
$seller = $trade['tenpayaccount'];
|
||||
|
||||
$mch_desc = $trade['subject'];
|
||||
|
||||
$mch_name = $trade['subject'];
|
||||
|
||||
$mch_price = $tradelog['baseprice'] * $tradelog['number'] * 100;
|
||||
|
||||
$mch_returl = $_G['siteurl'].'api/trade/notify_trade.php';
|
||||
|
||||
$mch_vno = $tradelog['orderid'];
|
||||
|
||||
$show_url = $_G['siteurl'].'api/trade/notify_trade.php';
|
||||
|
||||
$transport_desc = $pay['logistics_type'];
|
||||
|
||||
$transport_fee = $tradelog['transportfee'] * 100;
|
||||
|
||||
if(strtolower(CHARSET) == 'gbk') {
|
||||
$encode_type = '1';
|
||||
} else {
|
||||
$encode_type = '2';
|
||||
}
|
||||
|
||||
$mch_type = '1';
|
||||
$need_buyerinfo = '1';
|
||||
if($pay['logistics_type'] == 'VIRTUAL') {
|
||||
$mch_type = '2';
|
||||
$need_buyerinfo = '2';
|
||||
}
|
||||
|
||||
$reqHandler = new MediPayRequestHandler();
|
||||
$reqHandler->init();
|
||||
$reqHandler->setKey($key);
|
||||
|
||||
$reqHandler->setParameter("chnid", $chnid);
|
||||
$reqHandler->setParameter("encode_type", $encode_type);
|
||||
$reqHandler->setParameter("mch_desc", $mch_desc);
|
||||
$reqHandler->setParameter("mch_name", $mch_name);
|
||||
$reqHandler->setParameter("mch_price", $mch_price);
|
||||
$reqHandler->setParameter("mch_returl", $mch_returl);
|
||||
$reqHandler->setParameter("mch_type", $mch_type);
|
||||
$reqHandler->setParameter("mch_vno", $mch_vno);
|
||||
$reqHandler->setParameter("need_buyerinfo", $need_buyerinfo);
|
||||
$reqHandler->setParameter("seller", $seller);
|
||||
$reqHandler->setParameter("show_url", $show_url);
|
||||
$reqHandler->setParameter("transport_desc", $transport_desc);
|
||||
$reqHandler->setParameter("transport_fee", $transport_fee);
|
||||
$reqHandler->setParameter('attach', 'tenpay');
|
||||
|
||||
$reqUrl = $reqHandler->getRequestURL();
|
||||
return $reqUrl;
|
||||
}
|
||||
|
||||
|
||||
function invite_payurl($amount, $price, &$orderid, $bank = 'DEFAULT') {
|
||||
include_once DISCUZ_ROOT . './source/class/class_chinese.php';
|
||||
global $_G;
|
||||
|
||||
$date = dgmdate(TIMESTAMP, 'YmdHis');
|
||||
$suffix = dgmdate(TIMESTAMP, 'His').rand(1000, 9999);
|
||||
$transaction_id = DISCUZ_PARTNER.$date.$suffix;
|
||||
|
||||
$orderid = dgmdate(TIMESTAMP, 'YmdHis').random(14);
|
||||
|
||||
$chinese = new Chinese(strtoupper(CHARSET), 'GBK');
|
||||
$subject = $chinese->Convert(lang('forum/misc', 'invite_forum_payment').' '.intval($amount).' '.lang('forum/misc', 'invite_forum_payment_unit'));
|
||||
|
||||
$reqHandler = new RequestHandler();
|
||||
$reqHandler->setGateURL("https://gw.tenpay.com/gateway/pay.htm");
|
||||
|
||||
$reqHandler->init();
|
||||
$reqHandler->setKey(DISCUZ_SECURITYCODE);
|
||||
|
||||
$reqHandler->setParameter("partner", DISCUZ_PARTNER);
|
||||
$reqHandler->setParameter("out_trade_no", $orderid);
|
||||
$reqHandler->setParameter("total_fee", $price * 100);
|
||||
$reqHandler->setParameter("return_url", $_G['siteurl'].'api/trade/notify_invite.php');
|
||||
$reqHandler->setParameter("notify_url", $_G['siteurl'].'api/trade/notify_invite.php');
|
||||
$reqHandler->setParameter("body", $subject);
|
||||
$reqHandler->setParameter("bank_type", $bank);
|
||||
|
||||
$reqHandler->setParameter("spbill_create_ip", $_G['clientip']);
|
||||
$reqHandler->setParameter("fee_type", "1");
|
||||
$reqHandler->setParameter("subject", $subject);
|
||||
|
||||
$reqHandler->setParameter("sign_type", "MD5");
|
||||
$reqHandler->setParameter("service_version", "1.0");
|
||||
$reqHandler->setParameter("input_charset", "GBK");
|
||||
$reqHandler->setParameter("sign_key_index", "1");
|
||||
|
||||
$reqHandler->setParameter("attach", "tenpay");
|
||||
$reqHandler->setParameter("time_start", $date);
|
||||
$reqHandler->setParameter("trade_mode","1");
|
||||
$reqHandler->setParameter("trans_type","1");
|
||||
$reqHandler->setParameter("agentid", DISCUZ_AGENTID);
|
||||
$reqHandler->setParameter("agent_type","2");
|
||||
|
||||
$reqUrl = $reqHandler->getRequestURL();
|
||||
return $reqUrl;
|
||||
}
|
||||
function trade_notifycheck($type) {
|
||||
global $_G;
|
||||
|
||||
if($type == 'credit' || $type == 'invite') {
|
||||
if(!DISCUZ_SECURITYCODE) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
$resHandler = new ResponseHandler();
|
||||
$resHandler->setKey(DISCUZ_SECURITYCODE);
|
||||
|
||||
$resHandler->setParameter("bankname", "");
|
||||
} else {
|
||||
if(!DISCUZ_TENPAY_OPENTRANS_KEY) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
$resHandler = new MediPayResponseHandler();
|
||||
$resHandler->setKey(DISCUZ_TENPAY_OPENTRANS_KEY);
|
||||
}
|
||||
if($type == 'credit' || $type == 'invite') {
|
||||
if($resHandler->isTenpaySign() && DISCUZ_PARTNER == $_GET['partner']) {
|
||||
return array(
|
||||
'validator' => isset($_GET['trade_state']) ? !$_GET['trade_state'] : 0,
|
||||
'order_no' => $_GET['out_trade_no'],
|
||||
'trade_no' => isset($_GET['transaction_id']) ? $_GET['transaction_id'] : '',
|
||||
'price' => $_GET['total_fee'] / 100,
|
||||
'bargainor_id' => $_GET['partner'],
|
||||
'location' => true,
|
||||
);
|
||||
}
|
||||
} elseif($type == 'trade') {
|
||||
if($resHandler->isTenpaySign()) {
|
||||
return array(
|
||||
'validator' => $resHandler->getParameter('retcode') == '0',
|
||||
'order_no' => $resHandler->getParameter('mch_vno'),
|
||||
'trade_no' => $resHandler->getParameter('cft_tid'),
|
||||
'price' => $resHandler->getParameter('total_fee') / 100,
|
||||
'status' => $resHandler->getParameter('status'),
|
||||
'location' => true,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return array(
|
||||
'validator' => FALSE,
|
||||
'location' => 'forum.php?mod=memcp&action=credits&operation=addfunds&return=fail'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function trade_setprice($data, &$price, &$pay, &$transportfee) {
|
||||
if($data['transport'] == 3) {
|
||||
$pay['logistics_type'] = 'VIRTUAL';
|
||||
}
|
||||
|
||||
if($data['transport'] != 3) {
|
||||
if($data['fee'] == 1) {
|
||||
$pay['logistics_type'] = 'POST';
|
||||
$pay['logistics_fee'] = $data['trade']['ordinaryfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['ordinaryfee'];
|
||||
$transportfee = $data['trade']['ordinaryfee'];
|
||||
}
|
||||
} elseif($data['fee'] == 2) {
|
||||
$pay['logistics_type'] = 'EMS';
|
||||
$pay['logistics_fee'] = $data['trade']['emsfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['emsfee'];
|
||||
$transportfee = $data['trade']['emsfee'];
|
||||
}
|
||||
} else {
|
||||
$pay['logistics_type'] = 'EXPRESS';
|
||||
$pay['logistics_fee'] = $data['trade']['expressfee'];
|
||||
if($data['transport'] == 2) {
|
||||
$price = $price + $data['trade']['expressfee'];
|
||||
$transportfee = $data['trade']['expressfee'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function trade_getorderurl($orderid) {
|
||||
return "https://www.tenpay.com/med/tradeDetail.shtml?b=1&trans_id=$orderid";
|
||||
}
|
||||
|
||||
function trade_typestatus($method, $status = -1) {
|
||||
switch($method) {
|
||||
case 'buytrades' : $methodvalue = array(1, 3);break;
|
||||
case 'selltrades' : $methodvalue = array(2, 4);break;
|
||||
case 'successtrades' : $methodvalue = array(5);break;
|
||||
case 'tradingtrades' : $methodvalue = array(1, 2, 3, 4);break;
|
||||
case 'closedtrades' : $methodvalue = array(6, 10);break;
|
||||
case 'refundsuccess' : $methodvalue = array(9);break;
|
||||
case 'refundtrades' : $methodvalue = array(9, 10);break;
|
||||
case 'unstarttrades' : $methodvalue = array(0);break;
|
||||
}
|
||||
return $status != -1 ? in_array($status, $methodvalue) : $methodvalue;
|
||||
}
|
||||
|
||||
function trade_getstatus($key, $method = 2) {
|
||||
$language = lang('forum/misc');
|
||||
$status[1] = array(
|
||||
'WAIT_BUYER_PAY' => 1,
|
||||
'WAIT_SELLER_CONFIRM_TRADE' => 2,
|
||||
'WAIT_SELLER_SEND_GOODS' => 3,
|
||||
'WAIT_BUYER_CONFIRM_GOODS' => 4,
|
||||
'TRADE_FINISHED' => 5,
|
||||
'TRADE_CLOSED' => 6,
|
||||
'REFUND_SUCCESS' => 9,
|
||||
'REFUND_CLOSED' => 10,
|
||||
);
|
||||
$status[2] = array(
|
||||
0 => $language['trade_unstart'],
|
||||
1 => $language['trade_waitbuyerpay'],
|
||||
2 => $language['trade_waitsellerconfirm'],
|
||||
3 => $language['trade_waitsellersend'],
|
||||
4 => $language['trade_waitbuyerconfirm'],
|
||||
5 => $language['trade_finished'],
|
||||
6 => $language['trade_closed'],
|
||||
9 => $language['trade_refundsuccess'],
|
||||
10 => $language['trade_refundclosed']
|
||||
);
|
||||
return $method == -1 ? $status[2] : $status[$method][$key];
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: notify_credit.php 34251 2013-11-25 03:10:11Z nemohou $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
define('DISABLEXSSCHECK', true);
|
||||
|
||||
require '../../source/class/class_core.php';
|
||||
require '../../source/function/function_forum.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init();
|
||||
|
||||
$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach'];
|
||||
require_once DISCUZ_ROOT.'./api/trade/api_'.$apitype.'.php';
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
$_G['siteurl'] = dhtmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/');
|
||||
$notifydata = trade_notifycheck('credit');
|
||||
|
||||
if($notifydata['validator']) {
|
||||
|
||||
$orderid = $notifydata['order_no'];
|
||||
$postprice = $notifydata['price'];
|
||||
$order = C::t('forum_order')->fetch($orderid);
|
||||
$order = array_merge($order, C::t('common_member')->fetch_by_username($order['uid']));
|
||||
if($order && floatval($postprice) == floatval($order['price']) && ($apitype == 'tenpay' || strtolower($_G['setting']['ec_account']) == strtolower($_REQUEST['seller_email']))) {
|
||||
|
||||
if($order['status'] == 1) {
|
||||
C::t('forum_order')->update($orderid, array('status' => '2', 'buyer' => "$notifydata[trade_no]\t$apitype", 'confirmdate' => $_G['timestamp']));
|
||||
updatemembercount($order['uid'], array($_G['setting']['creditstrans'] => $order['amount']), 1, 'AFD', $order['uid']);
|
||||
updatecreditbyaction($action, $uid = 0, $extrasql = array(), $needle = '', $coef = 1, $update = 1, $fid = 0);
|
||||
C::t('forum_order')->delete_by_submitdate($_G['timestamp']-60*86400);
|
||||
$submitdate = dgmdate($order['submitdate']);
|
||||
$confirmdate = dgmdate(TIMESTAMP);
|
||||
|
||||
notification_add($order['uid'], 'credit', 'addfunds', array(
|
||||
'orderid' => $order['orderid'],
|
||||
'price' => $order['price'],
|
||||
'value' => $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'].' '.$order['amount'].' '.$_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit']
|
||||
), 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($notifydata['location']) {
|
||||
$url = rawurlencode('home.php?mod=spacecp&ac=credit');
|
||||
if($apitype == 'tenpay') {
|
||||
echo <<<EOS
|
||||
<meta name="TENCENT_ONLINE_PAYMENT" content="China TENCENT">
|
||||
<html>
|
||||
<body>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href='$_G[siteurl]forum.php?mod=misc&action=paysucceed';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
EOS;
|
||||
} else {
|
||||
dheader('location: '.$_G['siteurl'].'forum.php?mod=misc&action=paysucceed');
|
||||
}
|
||||
} else {
|
||||
exit($notifydata['notify']);
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: notify_invite.php 34251 2013-11-25 03:10:11Z nemohou $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
define('DISABLEXSSCHECK', true);
|
||||
|
||||
require '../../source/class/class_core.php';
|
||||
require '../../source/function/function_forum.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init();
|
||||
|
||||
$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach'];
|
||||
require_once DISCUZ_ROOT.'./api/trade/api_'.$apitype.'.php';
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
$_G['siteurl'] = dhtmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/');
|
||||
$notifydata = trade_notifycheck('invite');
|
||||
if($notifydata['validator']) {
|
||||
$orderid = $notifydata['order_no'];
|
||||
$postprice = $notifydata['price'];
|
||||
$order = C::t('forum_order')->fetch($orderid);
|
||||
if($order && floatval($postprice) == floatval($order['price']) && ($apitype == 'tenpay' || $_G['setting']['ec_account'] == $_REQUEST['seller_email'])) {
|
||||
|
||||
if($order['status'] == 1) {
|
||||
C::t('forum_order')->update($orderid, array('status' => '2', 'buyer' => "$notifydata[trade_no]\t$apitype", 'confirmdate' => $_G['timestamp']));
|
||||
$codes = $codetext = array();
|
||||
$dateline = TIMESTAMP;
|
||||
for($i=0; $i<$order['amount']; $i++) {
|
||||
$code = strtolower(random(6));
|
||||
$codetext[] = $code;
|
||||
$codes[] = "('0', '$code', '$dateline', '".($_G['group']['maxinviteday']?($_G['timestamp']+$_G['group']['maxinviteday']*24*3600):$_G['timestamp']+86400*10)."', '$order[email]', '$_G[clientip]', '$orderid')";
|
||||
$invitedata = array(
|
||||
'uid' => 0,
|
||||
'code' => $code,
|
||||
'dateline' => $dateline,
|
||||
'endtime' => $_G['group']['maxinviteday'] ? ($_G['timestamp']+$_G['group']['maxinviteday']*24*3600) : $_G['timestamp']+86400*10,
|
||||
'email' => $order['email'],
|
||||
'inviteip' => $_G['clientip'],
|
||||
'orderid' => $orderid
|
||||
);
|
||||
C::t('common_invite')->insert($invitedata);
|
||||
}
|
||||
C::t('forum_order')->delete_by_submitdate($_G['timestamp']-60*86400);
|
||||
|
||||
$submitdate = dgmdate($order['submitdate']);
|
||||
$confirmdate = dgmdate(TIMESTAMP);
|
||||
if(!function_exists('sendmail')) {
|
||||
include libfile('function/mail');
|
||||
}
|
||||
$add_member_subject = $_G['setting']['bbname'].' - '.lang('forum/misc', 'invite_payment');
|
||||
$add_member_message = lang('email', 'invite_payment_email_message', array(
|
||||
'orderid' => $order['orderid'],
|
||||
'codetext' => implode('<br />', $codetext),
|
||||
'siteurl' => $_G['siteurl'],
|
||||
'bbname' => $_G['setting']['bbname'],
|
||||
));
|
||||
if(!sendmail($order['email'], $add_member_subject, $add_member_message)) {
|
||||
runlog('sendmail', "$order[email] sendmail failed.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($notifydata['location']) {
|
||||
if($apitype == 'tenpay') {
|
||||
echo <<<EOS
|
||||
<meta name="TENCENT_ONLINE_PAYMENT" content="China TENCENT">
|
||||
<html>
|
||||
<body>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href='$_G[siteurl]misc.php?mod=buyinvitecode&action=paysucceed&orderid=$orderid';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
EOS;
|
||||
} else {
|
||||
dheader('location: '.$_G['siteurl'].'misc.php?mod=buyinvitecode&action=paysucceed&orderid='.$orderid);
|
||||
}
|
||||
} else {
|
||||
exit($notifydata['notify']);
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: notify_trade.php 34251 2013-11-25 03:10:11Z nemohou $
|
||||
*/
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
define('DISABLEXSSCHECK', true);
|
||||
|
||||
require '../../source/class/class_core.php';
|
||||
require '../../source/function/function_forum.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init();
|
||||
|
||||
$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach'];
|
||||
require_once DISCUZ_ROOT.'./api/trade/api_' . $apitype . '.php';
|
||||
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
$_G['siteurl'] = dhtmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api\/trade)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/');
|
||||
|
||||
$notifydata = trade_notifycheck('trade');
|
||||
|
||||
if($notifydata['validator']) {
|
||||
|
||||
$orderid = $notifydata['order_no'];
|
||||
|
||||
if($orderid) {
|
||||
|
||||
$tradelog = C::t('forum_tradelog')->fetch($orderid);
|
||||
|
||||
if($tradelog && $tradelog['status'] != STATUS_TRADE_SUCCESS && $tradelog['status'] != STATUS_REFUND_CLOSE && ($apitype == 'tenpay' || $tradelog['selleraccount'] == $_REQUEST['seller_email'])) {
|
||||
$status = $notifydata['status'];
|
||||
C::t('forum_tradelog')->update($orderid, array(
|
||||
'status' => $status,
|
||||
'lastupdate' => $_G['timestamp'],
|
||||
'tradeno' => $notifydata['trade_no']
|
||||
));
|
||||
if($status != $tradelog['status']) {
|
||||
|
||||
if($status == STATUS_SELLER_SEND) {
|
||||
|
||||
notification_add($tradelog['sellerid'], 'goods', 'trade_seller_send', array(
|
||||
'buyerid' => $tradelog['buyerid'],
|
||||
'buyer' => $tradelog['buyer'],
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
|
||||
} elseif($status == STATUS_WAIT_BUYER) {
|
||||
|
||||
notification_add($tradelog['buyerid'], 'goods', 'trade_buyer_confirm', array(
|
||||
'sellerid' => $tradelog['sellerid'],
|
||||
'seller' => $tradelog['seller'],
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
|
||||
} elseif($status == STATUS_TRADE_SUCCESS) {
|
||||
|
||||
if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit']) {
|
||||
$netcredit = round($tradelog['number'] * $tradelog['basecredit'] * (1 - $_G['setting']['creditstax']));
|
||||
updatemembercount($tradelog['sellerid'], array($_G['setting']['creditstransextra'][5] => $netcredit));
|
||||
} else {
|
||||
$netcredit = 0;
|
||||
}
|
||||
C::t('forum_trade')->update($tradelog['tid'], $tradelog['pid'], array('lastbuyer' => $tradelog['buyer'], 'lastupdate' => $_G['timestamp']));
|
||||
C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], $tradelog['number'], $tradelog['price'], $netcredit);
|
||||
|
||||
updatecreditbyaction('tradefinished', $tradelog['sellerid']);
|
||||
updatecreditbyaction('tradefinished', $tradelog['buyerid']);
|
||||
|
||||
notification_add($tradelog['sellerid'], 'goods', 'trade_success', array(
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
notification_add($tradelog['buyerid'], 'goods', 'trade_success', array(
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
|
||||
} elseif($status == STATUS_REFUND_CLOSE) {
|
||||
|
||||
C::t('forum_trade')->update_counter($tradelog['tid'], $tradelog['pid'], 0, 0, 0, $tradelog['number']);
|
||||
notification_add($tradelog['sellerid'], 'goods', 'trade_fefund_success', array(
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
notification_add($tradelog['buyerid'], 'goods', 'trade_fefund_success', array(
|
||||
'orderid' => $orderid,
|
||||
'subject' => $tradelog['subject']
|
||||
));
|
||||
if($_G['setting']['creditstrans'] && $tradelog['buyerid']) {
|
||||
updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstrans'] => $tradelog['buyercredits']));
|
||||
}
|
||||
if($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit'] && $tradelog['buyerid']) {
|
||||
$credit = $tradelog['number'] * $tradelog['basecredit'];
|
||||
updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => $credit));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($notifydata['location']) {
|
||||
dheader('location: '.$_G['siteurl'].'forum.php?mod=misc&action=paysucceed&orderid='.$orderid);
|
||||
} else {
|
||||
exit($notifydata['notify']);
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,426 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: uc.php 36303 2016-12-15 09:11:58Z nemohou $
|
||||
*/
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
define('UC_CLIENT_VERSION', '1.6.0');
|
||||
define('UC_CLIENT_RELEASE', '20170101');
|
||||
|
||||
define('API_DELETEUSER', 1);
|
||||
define('API_RENAMEUSER', 1);
|
||||
define('API_GETTAG', 1);
|
||||
define('API_SYNLOGIN', 1);
|
||||
define('API_SYNLOGOUT', 1);
|
||||
define('API_UPDATEPW', 1);
|
||||
define('API_UPDATEBADWORDS', 1);
|
||||
define('API_UPDATEHOSTS', 1);
|
||||
define('API_UPDATEAPPS', 1);
|
||||
define('API_UPDATECLIENT', 1);
|
||||
define('API_UPDATECREDIT', 1);
|
||||
define('API_GETCREDIT', 1);
|
||||
define('API_GETCREDITSETTINGS', 1);
|
||||
define('API_UPDATECREDITSETTINGS', 1);
|
||||
define('API_ADDFEED', 1);
|
||||
define('API_RETURN_SUCCEED', '1');
|
||||
define('API_RETURN_FAILED', '-1');
|
||||
define('API_RETURN_FORBIDDEN', '1');
|
||||
|
||||
define('IN_API', true);
|
||||
define('CURSCRIPT', 'api');
|
||||
|
||||
|
||||
if(!defined('IN_UC')) {
|
||||
require_once '../source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init();
|
||||
|
||||
require DISCUZ_ROOT.'./config/config_ucenter.php';
|
||||
|
||||
$get = $post = array();
|
||||
|
||||
$code = @$_GET['code'];
|
||||
parse_str(authcode($code, 'DECODE', UC_KEY), $get);
|
||||
|
||||
if(time() - $get['time'] > 3600) {
|
||||
exit('Authracation has expiried');
|
||||
}
|
||||
if(empty($get)) {
|
||||
exit('Invalid Request');
|
||||
}
|
||||
|
||||
include_once DISCUZ_ROOT.'./uc_client/lib/xml.class.php';
|
||||
$post = xml_unserialize(file_get_contents('php://input'));
|
||||
|
||||
if(in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcredit', 'getcreditsettings', 'updatecreditsettings', 'addfeed'))) {
|
||||
$uc_note = new uc_note();
|
||||
echo call_user_func(array($uc_note, $get['action']), $get, $post);
|
||||
exit();
|
||||
} else {
|
||||
exit(API_RETURN_FAILED);
|
||||
}
|
||||
} else {
|
||||
exit;
|
||||
}
|
||||
|
||||
class uc_note {
|
||||
|
||||
var $dbconfig = '';
|
||||
var $db = '';
|
||||
var $tablepre = '';
|
||||
var $appdir = '';
|
||||
|
||||
function _serialize($arr, $htmlon = 0) {
|
||||
if(!function_exists('xml_serialize')) {
|
||||
include_once DISCUZ_ROOT.'./uc_client/lib/xml.class.php';
|
||||
}
|
||||
return xml_serialize($arr, $htmlon);
|
||||
}
|
||||
|
||||
function uc_note() {
|
||||
|
||||
}
|
||||
|
||||
function test($get, $post) {
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function deleteuser($get, $post) {
|
||||
global $_G;
|
||||
if(!API_DELETEUSER) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
$uids = str_replace("'", '', stripslashes($get['ids']));
|
||||
$ids = array();
|
||||
$ids = array_keys(C::t('common_member')->fetch_all($uids));
|
||||
require_once DISCUZ_ROOT.'./source/function/function_delete.php';
|
||||
$ids && deletemember($ids);
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function renameuser($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_RENAMEUSER) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$tables = array(
|
||||
'common_block' => array('id' => 'uid', 'name' => 'username'),
|
||||
'common_invite' => array('id' => 'fuid', 'name' => 'fusername'),
|
||||
'common_member_verify_info' => array('id' => 'uid', 'name' => 'username'),
|
||||
'common_mytask' => array('id' => 'uid', 'name' => 'username'),
|
||||
'common_report' => array('id' => 'uid', 'name' => 'username'),
|
||||
|
||||
'forum_thread' => array('id' => 'authorid', 'name' => 'author'),
|
||||
'forum_activityapply' => array('id' => 'uid', 'name' => 'username'),
|
||||
'forum_groupuser' => array('id' => 'uid', 'name' => 'username'),
|
||||
'forum_pollvoter' => array('id' => 'uid', 'name' => 'username'),
|
||||
'forum_post' => array('id' => 'authorid', 'name' => 'author'),
|
||||
'forum_postcomment' => array('id' => 'authorid', 'name' => 'author'),
|
||||
'forum_ratelog' => array('id' => 'uid', 'name' => 'username'),
|
||||
|
||||
'home_album' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_blog' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_clickuser' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_docomment' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_doing' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_feed' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_feed_app' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_friend' => array('id' => 'fuid', 'name' => 'fusername'),
|
||||
'home_friend_request' => array('id' => 'fuid', 'name' => 'fusername'),
|
||||
'home_notification' => array('id' => 'authorid', 'name' => 'author'),
|
||||
'home_pic' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_poke' => array('id' => 'fromuid', 'name' => 'fromusername'),
|
||||
'home_share' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_show' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_specialuser' => array('id' => 'uid', 'name' => 'username'),
|
||||
'home_visitor' => array('id' => 'vuid', 'name' => 'vusername'),
|
||||
|
||||
'portal_article_title' => array('id' => 'uid', 'name' => 'username'),
|
||||
'portal_comment' => array('id' => 'uid', 'name' => 'username'),
|
||||
'portal_topic' => array('id' => 'uid', 'name' => 'username'),
|
||||
'portal_topic_pic' => array('id' => 'uid', 'name' => 'username'),
|
||||
);
|
||||
|
||||
if(!C::t('common_member')->update($get['uid'], array('username' => $get[newusername])) && isset($_G['setting']['membersplit'])){
|
||||
C::t('common_member_archive')->update($get['uid'], array('username' => $get[newusername]));
|
||||
}
|
||||
|
||||
loadcache("posttableids");
|
||||
if($_G['cache']['posttableids']) {
|
||||
foreach($_G['cache']['posttableids'] AS $tableid) {
|
||||
$tables[getposttable($tableid)] = array('id' => 'authorid', 'name' => 'author');
|
||||
}
|
||||
}
|
||||
|
||||
foreach($tables as $table => $conf) {
|
||||
DB::query("UPDATE ".DB::table($table)." SET `$conf[name]`='$get[newusername]' WHERE `$conf[id]`='$get[uid]'");
|
||||
}
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function gettag($get, $post) {
|
||||
global $_G;
|
||||
if(!API_GETTAG) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
return $this->_serialize(array($get['id'], array()), 1);
|
||||
}
|
||||
|
||||
function synlogin($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_SYNLOGIN) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
||||
|
||||
$cookietime = 31536000;
|
||||
$uid = intval($get['uid']);
|
||||
if(($member = getuserbyuid($uid, 1))) {
|
||||
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
|
||||
}
|
||||
}
|
||||
|
||||
function synlogout($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_SYNLOGOUT) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
||||
|
||||
dsetcookie('auth', '', -31536000);
|
||||
}
|
||||
|
||||
function updatepw($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATEPW) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$username = $get['username'];
|
||||
$newpw = md5(time().rand(100000, 999999));
|
||||
$uid = 0;
|
||||
if(($uid = C::t('common_member')->fetch_uid_by_username($username))) {
|
||||
$ext = '';
|
||||
} elseif(($uid = C::t('common_member_archive')->fetch_uid_by_username($username))) {
|
||||
$ext = '_archive';
|
||||
}
|
||||
if($uid) {
|
||||
C::t('common_member'.$ext)->update($uid, array('password' => $newpw));
|
||||
}
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function updatebadwords($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATEBADWORDS) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
if(is_array($post)) {
|
||||
foreach($post as $k => $v) {
|
||||
if(substr($v['findpattern'], 0, 1) != '/' || substr($v['findpattern'], -3) != '/is') {
|
||||
$v['findpattern'] = '/' . preg_quote($v['findpattern'], '/') . '/is';
|
||||
}
|
||||
$data['findpattern'][$k] = $v['findpattern'];
|
||||
$data['replace'][$k] = $v['replacement'];
|
||||
}
|
||||
}
|
||||
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/badwords.php';
|
||||
$fp = fopen($cachefile, 'w');
|
||||
$s = "<?php\r\n";
|
||||
$s .= '$_CACHE[\'badwords\'] = '.var_export($data, TRUE).";\r\n";
|
||||
fwrite($fp, $s);
|
||||
fclose($fp);
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function updatehosts($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATEHOSTS) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/hosts.php';
|
||||
$fp = fopen($cachefile, 'w');
|
||||
$s = "<?php\r\n";
|
||||
$s .= '$_CACHE[\'hosts\'] = '.var_export($post, TRUE).";\r\n";
|
||||
fwrite($fp, $s);
|
||||
fclose($fp);
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function updateapps($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATEAPPS) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$UC_API = '';
|
||||
if($post['UC_API']) {
|
||||
$UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
|
||||
unset($post['UC_API']);
|
||||
}
|
||||
|
||||
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/apps.php';
|
||||
$fp = fopen($cachefile, 'w');
|
||||
$s = "<?php\r\n";
|
||||
$s .= '$_CACHE[\'apps\'] = '.var_export($post, TRUE).";\r\n";
|
||||
fwrite($fp, $s);
|
||||
fclose($fp);
|
||||
|
||||
if($UC_API && is_writeable(DISCUZ_ROOT.'./config/config_ucenter.php')) {
|
||||
if(preg_match('/^https?:\/\//is', $UC_API)) {
|
||||
$configfile = trim(file_get_contents(DISCUZ_ROOT.'./config/config_ucenter.php'));
|
||||
$configfile = substr($configfile, -2) == '?>' ? substr($configfile, 0, -2) : $configfile;
|
||||
$configfile = preg_replace("/define\('UC_API',\s*'.*?'\);/i", "define('UC_API', '".addslashes($UC_API)."');", $configfile);
|
||||
if($fp = @fopen(DISCUZ_ROOT.'./config/config_ucenter.php', 'w')) {
|
||||
@fwrite($fp, trim($configfile));
|
||||
@fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function updateclient($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATECLIENT) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/settings.php';
|
||||
$fp = fopen($cachefile, 'w');
|
||||
$s = "<?php\r\n";
|
||||
$s .= '$_CACHE[\'settings\'] = '.var_export($post, TRUE).";\r\n";
|
||||
fwrite($fp, $s);
|
||||
fclose($fp);
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function updatecredit($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATECREDIT) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$credit = $get['credit'];
|
||||
$amount = $get['amount'];
|
||||
$uid = $get['uid'];
|
||||
if(!getuserbyuid($uid)) {
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
updatemembercount($uid, array($credit => $amount));
|
||||
C::t('common_credit_log')->insert(array('uid' => $uid, 'operation' => 'ECU', 'relatedid' => $uid, 'dateline' => time(), 'extcredits'.$credit => $amount));
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function getcredit($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_GETCREDIT) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
$uid = intval($get['uid']);
|
||||
$credit = intval($get['credit']);
|
||||
$_G['uid'] = $_G['member']['uid'] = $uid;
|
||||
return getuserprofile('extcredits'.$credit);
|
||||
}
|
||||
|
||||
function getcreditsettings($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_GETCREDITSETTINGS) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$credits = array();
|
||||
foreach($_G['setting']['extcredits'] as $id => $extcredits) {
|
||||
$credits[$id] = array(strip_tags($extcredits['title']), $extcredits['unit']);
|
||||
}
|
||||
|
||||
return $this->_serialize($credits);
|
||||
}
|
||||
|
||||
function updatecreditsettings($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_UPDATECREDITSETTINGS) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
|
||||
$outextcredits = array();
|
||||
foreach($get['credit'] as $appid => $credititems) {
|
||||
if($appid == UC_APPID) {
|
||||
foreach($credititems as $value) {
|
||||
$outextcredits[$value['appiddesc'].'|'.$value['creditdesc']] = array(
|
||||
'appiddesc' => $value['appiddesc'],
|
||||
'creditdesc' => $value['creditdesc'],
|
||||
'creditsrc' => $value['creditsrc'],
|
||||
'title' => $value['title'],
|
||||
'unit' => $value['unit'],
|
||||
'ratiosrc' => $value['ratiosrc'],
|
||||
'ratiodesc' => $value['ratiodesc'],
|
||||
'ratio' => $value['ratio']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmp = array();
|
||||
foreach($outextcredits as $value) {
|
||||
$key = $value['appiddesc'].'|'.$value['creditdesc'];
|
||||
if(!isset($tmp[$key])) {
|
||||
$tmp[$key] = array('title' => $value['title'], 'unit' => $value['unit']);
|
||||
}
|
||||
$tmp[$key]['ratiosrc'][$value['creditsrc']] = $value['ratiosrc'];
|
||||
$tmp[$key]['ratiodesc'][$value['creditsrc']] = $value['ratiodesc'];
|
||||
$tmp[$key]['creditsrc'][$value['creditsrc']] = $value['ratio'];
|
||||
}
|
||||
$outextcredits = $tmp;
|
||||
|
||||
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/creditsettings.php';
|
||||
$fp = fopen($cachefile, 'w');
|
||||
$s = "<?php\r\n";
|
||||
$s .= '$_CACHE[\'creditsettings\'] = '.var_export($outextcredits, TRUE).";\r\n";
|
||||
fwrite($fp, $s);
|
||||
fclose($fp);
|
||||
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
|
||||
function addfeed($get, $post) {
|
||||
global $_G;
|
||||
|
||||
if(!API_ADDFEED) {
|
||||
return API_RETURN_FORBIDDEN;
|
||||
}
|
||||
return API_RETURN_SUCCEED;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: index.php 17587 2010-10-25 01:25:10Z monkey $
|
||||
*/
|
||||
|
||||
define('IN_ARCHIVER', 1);
|
||||
|
||||
chdir('../');
|
||||
|
||||
$querystring = $_SERVER['QUERY_STRING'];
|
||||
|
||||
if(!empty($_GET['action'])) {
|
||||
$querystring = $_GET['action'].'-'.$_GET['value'];
|
||||
}
|
||||
|
||||
if(substr($querystring, 0, 3) == 'fid') {
|
||||
$_GET['mod'] = 'forumdisplay';
|
||||
$_GET['fid'] = intval(substr($querystring, 4));
|
||||
} elseif(substr($querystring, 0, 3) == 'tid') {
|
||||
$_GET['mod'] = 'viewthread';
|
||||
$_GET['tid'] = intval(substr($querystring, 4));
|
||||
}
|
||||
|
||||
include 'forum.php';
|
||||
|
||||
?>
|
|
@ -0,0 +1,199 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: config_global_default.php 36287 2016-12-12 03:59:05Z nemohou $
|
||||
*/
|
||||
|
||||
$_config = array();
|
||||
|
||||
// ---------------------------- CONFIG DB ----------------------------- //
|
||||
// ---------------------------- 数据库相关设置---------------------------- //
|
||||
|
||||
/**
|
||||
* 数据库主服务器设置, 支持多组服务器设置, 当设置多组服务器时, 则会根据分布式策略使用某个服务器
|
||||
* @example
|
||||
* $_config['db']['1']['dbhost'] = 'localhost'; // 服务器地址
|
||||
* $_config['db']['1']['dbuser'] = 'root'; // 用户
|
||||
* $_config['db']['1']['dbpw'] = 'root';// 密码
|
||||
* $_config['db']['1']['dbcharset'] = 'gbk';// 字符集
|
||||
* $_config['db']['1']['pconnect'] = '0';// 是否持续连接
|
||||
* $_config['db']['1']['dbname'] = 'x1';// 数据库
|
||||
* $_config['db']['1']['tablepre'] = 'pre_';// 表名前缀
|
||||
*
|
||||
* $_config['db']['2']['dbhost'] = 'localhost';
|
||||
* ...
|
||||
*
|
||||
*/
|
||||
$_config['db'][1]['dbhost'] = 'localhost';
|
||||
$_config['db'][1]['dbuser'] = 'root';
|
||||
$_config['db'][1]['dbpw'] = 'root';
|
||||
$_config['db'][1]['dbcharset'] = 'utf8';
|
||||
$_config['db'][1]['pconnect'] = 0;
|
||||
$_config['db'][1]['dbname'] = 'ultrax';
|
||||
$_config['db'][1]['tablepre'] = 'pre_';
|
||||
|
||||
/**
|
||||
* 数据库从服务器设置( slave, 只读 ), 支持多组服务器设置, 当设置多组服务器时, 系统根据每次随机使用
|
||||
* @example
|
||||
* $_config['db']['1']['slave']['1']['dbhost'] = 'localhost';
|
||||
* $_config['db']['1']['slave']['1']['dbuser'] = 'root';
|
||||
* $_config['db']['1']['slave']['1']['dbpw'] = 'root';
|
||||
* $_config['db']['1']['slave']['1']['dbcharset'] = 'gbk';
|
||||
* $_config['db']['1']['slave']['1']['pconnect'] = '0';
|
||||
* $_config['db']['1']['slave']['1']['dbname'] = 'x1';
|
||||
* $_config['db']['1']['slave']['1']['tablepre'] = 'pre_';
|
||||
* $_config['db']['1']['slave']['1']['weight'] = '0'; //权重:数据越大权重越高
|
||||
*
|
||||
* $_config['db']['1']['slave']['2']['dbhost'] = 'localhost';
|
||||
* ...
|
||||
*
|
||||
*/
|
||||
$_config['db']['1']['slave'] = array();
|
||||
|
||||
//启用从服务器的开关
|
||||
$_config['db']['slave'] = false;
|
||||
/**
|
||||
* 数据库 分布部署策略设置
|
||||
*
|
||||
* @example 将 common_member 部署到第二服务器, common_session 部署在第三服务器, 则设置为
|
||||
* $_config['db']['map']['common_member'] = 2;
|
||||
* $_config['db']['map']['common_session'] = 3;
|
||||
*
|
||||
* 对于没有明确声明服务器的表, 则一律默认部署在第一服务器上
|
||||
*
|
||||
*/
|
||||
$_config['db']['map'] = array();
|
||||
|
||||
/**
|
||||
* 数据库 公共设置, 此类设置通常对针对每个部署的服务器
|
||||
*/
|
||||
$_config['db']['common'] = array();
|
||||
|
||||
/**
|
||||
* 禁用从数据库的数据表, 表名字之间使用逗号分割
|
||||
*
|
||||
* @example common_session, common_member 这两个表仅从主服务器读写, 不使用从服务器
|
||||
* $_config['db']['common']['slave_except_table'] = 'common_session, common_member';
|
||||
*
|
||||
*/
|
||||
$_config['db']['common']['slave_except_table'] = '';
|
||||
|
||||
/**
|
||||
* 内存服务器优化设置
|
||||
* 以下设置需要PHP扩展组件支持,其中 memcache 优先于其他设置,
|
||||
* 当 memcache 无法启用时,会自动开启另外的两种优化模式
|
||||
*/
|
||||
|
||||
//内存变量前缀, 可更改,避免同服务器中的程序引用错乱
|
||||
$_config['memory']['prefix'] = 'discuz_';
|
||||
|
||||
/* reids设置, 需要PHP扩展组件支持, timeout参数的作用没有查证 */
|
||||
$_config['memory']['redis']['server'] = '';
|
||||
$_config['memory']['redis']['port'] = 6379;
|
||||
$_config['memory']['redis']['pconnect'] = 1;
|
||||
$_config['memory']['redis']['timeout'] = 0;
|
||||
$_config['memory']['redis']['requirepass'] = '';
|
||||
/**
|
||||
* 是否使用 Redis::SERIALIZER_IGBINARY选项,需要igbinary支持,windows下测试时请关闭,否则会出>现错误Reading from client: Connection reset by peer
|
||||
* 支持以下选项,默认使用PHP的serializer
|
||||
* [重要] 该选项已经取代原来的 $_config['memory']['redis']['igbinary'] 选项
|
||||
* Redis::SERIALIZER_IGBINARY =2
|
||||
* Redis::SERIALIZER_PHP =1
|
||||
* Redis::SERIALIZER_NONE =0 //则不使用serialize,即无法保存array
|
||||
*/
|
||||
$_config['memory']['redis']['serializer'] = 1;
|
||||
|
||||
$_config['memory']['memcache']['server'] = ''; // memcache 服务器地址
|
||||
$_config['memory']['memcache']['port'] = 11211; // memcache 服务器端口
|
||||
$_config['memory']['memcache']['pconnect'] = 1; // memcache 是否长久连接
|
||||
$_config['memory']['memcache']['timeout'] = 1; // memcache 服务器连接超时
|
||||
|
||||
$_config['memory']['apc'] = 1; // 启动对 apc 的支持
|
||||
$_config['memory']['xcache'] = 1; // 启动对 xcache 的支持
|
||||
$_config['memory']['eaccelerator'] = 1; // 启动对 eaccelerator 的支持
|
||||
$_config['memory']['wincache'] = 1; // 启动对 wincache 的支持
|
||||
// 服务器相关设置
|
||||
$_config['server']['id'] = 1; // 服务器编号,多webserver的时候,用于标识当前服务器的ID
|
||||
|
||||
// 附件下载相关
|
||||
//
|
||||
// 本地文件读取模式; 模式2为最节省内存方式,但不支持多线程下载
|
||||
// 1=fread 2=readfile 3=fpassthru 4=fpassthru+multiple
|
||||
$_config['download']['readmod'] = 2;
|
||||
|
||||
// 是否启用 X-Sendfile 功能(需要服务器支持)0=close 1=nginx 2=lighttpd 3=apache
|
||||
$_config['download']['xsendfile']['type'] = 0;
|
||||
|
||||
// 启用 nginx X-sendfile 时,论坛附件目录的虚拟映射路径,请使用 / 结尾
|
||||
$_config['download']['xsendfile']['dir'] = '/down/';
|
||||
|
||||
// 页面输出设置
|
||||
$_config['output']['charset'] = 'utf-8'; // 页面字符集
|
||||
$_config['output']['forceheader'] = 1; // 强制输出页面字符集,用于避免某些环境乱码
|
||||
$_config['output']['gzip'] = 0; // 是否采用 Gzip 压缩输出
|
||||
$_config['output']['tplrefresh'] = 1; // 模板自动刷新开关 0=关闭, 1=打开
|
||||
$_config['output']['language'] = 'zh_cn'; // 页面语言 zh_cn/zh_tw
|
||||
$_config['output']['staticurl'] = 'static/'; // 站点静态文件路径,“/”结尾
|
||||
$_config['output']['ajaxvalidate'] = 0; // 是否严格验证 Ajax 页面的真实性 0=关闭,1=打开
|
||||
$_config['output']['iecompatible'] = 0; // 页面 IE 兼容模式
|
||||
|
||||
// COOKIE 设置
|
||||
$_config['cookie']['cookiepre'] = 'discuz_'; // COOKIE前缀
|
||||
$_config['cookie']['cookiedomain'] = ''; // COOKIE作用域
|
||||
$_config['cookie']['cookiepath'] = '/'; // COOKIE作用路径
|
||||
|
||||
// 站点安全设置
|
||||
$_config['security']['authkey'] = 'asdfasfas'; // 站点加密密钥
|
||||
$_config['security']['urlxssdefend'] = true; // 自身 URL XSS 防御
|
||||
$_config['security']['attackevasive'] = 0; // CC 攻击防御 1|2|4|8
|
||||
|
||||
$_config['security']['querysafe']['status'] = 1; // 是否开启SQL安全检测,可自动预防SQL注入攻击
|
||||
$_config['security']['querysafe']['dfunction'] = array('load_file','hex','substring','if','ord','char');
|
||||
$_config['security']['querysafe']['daction'] = array('@','intooutfile','intodumpfile','unionselect','(select', 'unionall', 'uniondistinct');
|
||||
$_config['security']['querysafe']['dnote'] = array('/*','*/','#','--','"');
|
||||
$_config['security']['querysafe']['dlikehex'] = 1;
|
||||
$_config['security']['querysafe']['afullnote'] = 0;
|
||||
|
||||
$_config['admincp']['founder'] = '1'; // 站点创始人:拥有站点管理后台的最高权限,每个站点可以设置 1名或多名创始人
|
||||
// 可以使用uid,也可以使用用户名;多个创始人之间请使用逗号“,”分开;
|
||||
$_config['admincp']['forcesecques'] = 0; // 管理人员必须设置安全提问才能进入系统设置 0=否, 1=是[安全]
|
||||
$_config['admincp']['checkip'] = 1; // 后台管理操作是否验证管理员的 IP, 1=是[安全], 0=否。仅在管理员无法登陆后台时设置 0。
|
||||
$_config['admincp']['runquery'] = 0; // 是否允许后台运行 SQL 语句 1=是 0=否[安全]
|
||||
$_config['admincp']['dbimport'] = 1; // 是否允许后台恢复论坛数据 1=是 0=否[安全]
|
||||
|
||||
/**
|
||||
* 系统远程调用功能模块
|
||||
*/
|
||||
|
||||
// 远程调用: 总开关 0=关 1=开
|
||||
$_config['remote']['on'] = 0;
|
||||
|
||||
// 远程调用: 程序目录名. 出于安全考虑,您可以更改这个目录名, 修改完毕, 请手工修改程序的实际目录
|
||||
$_config['remote']['dir'] = 'remote';
|
||||
|
||||
// 远程调用: 通信密钥. 用于客户端和本服务端的通信加密. 长度不少于 32 位
|
||||
// 默认值是 $_config['security']['authkey'] 的 md5, 您也可以手工指定
|
||||
$_config['remote']['appkey'] = md5($_config['security']['authkey']);
|
||||
|
||||
// 远程调用: 开启外部 cron 任务. 系统内部不再执行cron, cron任务由外部程序激活
|
||||
$_config['remote']['cron'] = 0;
|
||||
|
||||
// $_GET|$_POST的兼容处理,0为关闭,1为开启;开启后即可使用$_G['gp_xx'](xx为变量名,$_GET和$_POST集合的所有变量名),值为已经addslashes()处理过
|
||||
$_config['input']['compatible'] = 1;
|
||||
|
||||
// Addon Setting
|
||||
//$_config['addonsource'] = 'xx1';
|
||||
//$_config['addon'] = array(
|
||||
// 'xx1' => array(
|
||||
// 'website_url' => 'http://127.0.0.1/AppCenter',
|
||||
// 'download_url' => 'http://127.0.0.1/AppCenter/index.php',
|
||||
// 'download_ip' => '',
|
||||
// 'check_url' => 'http://127.0.0.1/AppCenter/?ac=check&file=',
|
||||
// 'check_ip' => ''
|
||||
// )
|
||||
//);
|
||||
|
||||
?>
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: config_ucenter_default.php 11023 2010-05-20 02:23:09Z monkey $
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
define('UC_CONNECT', 'mysql'); // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen(), mysql 是直接连接的数据库, 为了效率, 建议采用 mysql
|
||||
// 数据库相关 (mysql 连接时)
|
||||
define('UC_DBHOST', 'localhost'); // UCenter 数据库主机
|
||||
define('UC_DBUSER', 'root'); // UCenter 数据库用户名
|
||||
define('UC_DBPW', 'root'); // UCenter 数据库密码
|
||||
define('UC_DBNAME', 'ucenter'); // UCenter 数据库名称
|
||||
define('UC_DBCHARSET', 'utf8'); // UCenter 数据库字符集
|
||||
define('UC_DBTABLEPRE', '`ucenter`.uc_'); // UCenter 数据库表前缀
|
||||
define('UC_DBCONNECT', '0'); // UCenter 数据库持久连接 0=关闭, 1=打开
|
||||
|
||||
// 通信相关
|
||||
define('UC_KEY', 'yeN3g9EbNfiaYfodV63dI1j8Fbk5HaL7W4yaW4y7u2j4Mf45mfg2v899g451k576'); // 与 UCenter 的通信密钥, 要与 UCenter 保持一致
|
||||
define('UC_API', 'http://localhost/ucenter/branches/1.5.0/server'); // UCenter 的 URL 地址, 在调用头像时依赖此常量
|
||||
define('UC_CHARSET', 'utf-8'); // UCenter 的字符集
|
||||
define('UC_IP', '127.0.0.1'); // UCenter 的 IP, 当 UC_CONNECT 为非 mysql 方式时, 并且当前应用服务器解析域名有问题时, 请设置此值
|
||||
define('UC_APPID', '1'); // 当前应用的 ID
|
||||
|
||||
// ============================================================================
|
||||
|
||||
define('UC_PPP', '20');
|
||||
|
||||
?>
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/*
|
||||
[Discuz!] (C)2001-2009 Comsenz Inc.
|
||||
This is NOT a freeware, use is subject to license terms
|
||||
|
||||
$Id: connect.php 26424 2011-12-13 03:02:20Z zhouxiaobo $
|
||||
*/
|
||||
|
||||
|
||||
if($_GET['mod'] == 'register') {
|
||||
$_GET['mod'] = 'connect';
|
||||
$_GET['action'] = 'register';
|
||||
require_once 'member.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
define('APPTYPEID', 126);
|
||||
define('CURSCRIPT', 'connect');
|
||||
|
||||
require_once './source/class/class_core.php';
|
||||
require_once './source/function/function_home.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$mod = $discuz->var['mod'];
|
||||
$discuz->init();
|
||||
|
||||
if(!in_array($mod, array('config', 'login', 'feed', 'check', 'user'))) {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
if(!$_G['setting']['connect']['allow']) {
|
||||
showmessage('qqconnect:qqconnect_closed');
|
||||
}
|
||||
|
||||
define('CURMODULE', $mod);
|
||||
runhooks();
|
||||
|
||||
$connectService = Cloud::loadClass('Service_Connect');
|
||||
require_once libfile('connect/'.$mod, 'plugin/qqconnect');
|
||||
?>
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: cp.php 9379 2010-04-28 07:30:09Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
$_GET['mod'] = 'manage';
|
||||
require_once 'userapp.php';
|
||||
?>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0"?>
|
||||
<cross-domain-policy>
|
||||
<allow-access-from domain="*" />
|
||||
</cross-domain-policy>
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<settings>
|
||||
<font>Tahoma</font>
|
||||
<plot_area>
|
||||
<margins><left>60</left><top>10</top><right>20</right><bottom>60</bottom></margins>
|
||||
</plot_area>
|
||||
<values>
|
||||
<x>
|
||||
<enabled>true</enabled>
|
||||
|
||||
</x>
|
||||
<y_left><enabled>true</enabled><min>0</min></y_left>
|
||||
</values>
|
||||
<grid>
|
||||
<x>
|
||||
<color>#000000</color>
|
||||
<dashed>false</dashed>
|
||||
|
||||
<dash_length>5</dash_length>
|
||||
<approx_count>7</approx_count>
|
||||
</x>
|
||||
<y_left>
|
||||
<approx_count>5</approx_count>
|
||||
</y_left>
|
||||
</grid>
|
||||
|
||||
<legend>
|
||||
<enabled>true</enabled>
|
||||
<key><size>12</size></key>
|
||||
</legend>
|
||||
<indicator>
|
||||
<enabled>true</enabled>
|
||||
<x_balloon_enabled>true</x_balloon_enabled>
|
||||
|
||||
<y_balloon_on_off>true</y_balloon_on_off>
|
||||
</indicator>
|
||||
</settings>
|
After Width: | Height: | Size: 5.4 KiB |
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: forum.php 33828 2013-08-20 02:29:32Z nemohou $
|
||||
*/
|
||||
|
||||
|
||||
define('APPTYPEID', 2);
|
||||
define('CURSCRIPT', 'forum');
|
||||
|
||||
|
||||
require './source/class/class_core.php';
|
||||
|
||||
|
||||
require './source/function/function_forum.php';
|
||||
|
||||
|
||||
$modarray = array('ajax','announcement','attachment','forumdisplay',
|
||||
'group','image','index','medal','misc','modcp','notice','post','redirect',
|
||||
'relatekw','relatethread','rss','topicadmin','trade','viewthread','tag','collection','guide'
|
||||
);
|
||||
|
||||
$modcachelist = array(
|
||||
'index' => array('announcements', 'onlinelist', 'forumlinks',
|
||||
'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum'),
|
||||
'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
|
||||
'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum'),
|
||||
'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups',
|
||||
'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
|
||||
'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum'),
|
||||
'redirect' => array('threadtableids', 'threadtable_info', 'posttable_info'),
|
||||
'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
|
||||
'domainwhitelist', 'albumcategory'),
|
||||
'space' => array('fields_required', 'fields_optional', 'custominfo'),
|
||||
'group' => array('grouptype', 'diytemplatenamegroup'),
|
||||
);
|
||||
|
||||
$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod'];
|
||||
|
||||
define('CURMODULE', $mod);
|
||||
$cachelist = array();
|
||||
if(isset($modcachelist[CURMODULE])) {
|
||||
$cachelist = $modcachelist[CURMODULE];
|
||||
|
||||
$cachelist[] = 'plugin';
|
||||
$cachelist[] = 'pluginlanguage_system';
|
||||
}
|
||||
if(C::app()->var['mod'] == 'group') {
|
||||
$_G['basescript'] = 'group';
|
||||
}
|
||||
|
||||
C::app()->cachelist = $cachelist;
|
||||
C::app()->init();
|
||||
|
||||
|
||||
loadforum();
|
||||
|
||||
|
||||
set_rssauth();
|
||||
|
||||
|
||||
runhooks();
|
||||
|
||||
|
||||
|
||||
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);
|
||||
$_G['setting']['threadhidethreshold'] = 1;
|
||||
require DISCUZ_ROOT.'./source/module/forum/forum_'.$mod.'.php';
|
||||
|
||||
?>
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: group.php 31307 2012-08-10 02:10:56Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
define('APPTYPEID', 3);
|
||||
define('CURSCRIPT', 'group');
|
||||
|
||||
|
||||
require './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$cachelist = array('grouptype', 'groupindex', 'diytemplatenamegroup');
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init();
|
||||
|
||||
$_G['disabledwidthauto'] = 0;
|
||||
|
||||
$modarray = array('index', 'my', 'attentiongroup');
|
||||
$mod = !in_array($_G['mod'], $modarray) ? 'index' : $_G['mod'];
|
||||
|
||||
define('CURMODULE', $mod);
|
||||
|
||||
runhooks();
|
||||
|
||||
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['group']);
|
||||
|
||||
require DISCUZ_ROOT.'./source/module/group/group_'.$mod.'.php';
|
||||
?>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: home.php 32932 2013-03-25 06:53:01Z zhangguosheng $
|
||||
*/
|
||||
|
||||
define('APPTYPEID', 1);
|
||||
define('CURSCRIPT', 'home');
|
||||
|
||||
if(!empty($_GET['mod']) && ($_GET['mod'] == 'misc' || $_GET['mod'] == 'invite')) {
|
||||
define('ALLOWGUEST', 1);
|
||||
}
|
||||
|
||||
require_once './source/class/class_core.php';
|
||||
require_once './source/function/function_home.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$cachelist = array('magic','userapp','usergroups', 'diytemplatenamehome');
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init();
|
||||
|
||||
$space = array();
|
||||
|
||||
$mod = getgpc('mod');
|
||||
if(!in_array($mod, array('space', 'spacecp', 'misc', 'magic', 'editor', 'invite', 'task', 'medal', 'rss', 'follow'))) {
|
||||
$mod = 'space';
|
||||
$_GET['do'] = 'home';
|
||||
}
|
||||
|
||||
if($mod == 'space' && ((empty($_GET['do']) || $_GET['do'] == 'index') && ($_G['inajax']))) {
|
||||
$_GET['do'] = 'profile';
|
||||
}
|
||||
$curmod = !empty($_G['setting']['followstatus']) && (empty($_GET['diy']) && empty($_GET['do']) && $mod == 'space' || $_GET['do'] == 'follow') ? 'follow' : $mod;
|
||||
define('CURMODULE', $curmod);
|
||||
runhooks($_GET['do'] == 'profile' && $_G['inajax'] ? 'card' : $_GET['do']);
|
||||
|
||||
require_once libfile('home/'.$mod, 'module');
|
||||
|
||||
|
||||
?>
|
|
@ -0,0 +1,156 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: index.php 34524 2014-05-15 04:42:23Z nemohou $
|
||||
*/
|
||||
|
||||
if(!empty($_SERVER['QUERY_STRING']) && is_numeric($_SERVER['QUERY_STRING'])) {
|
||||
$_ENV['curapp'] = 'home';
|
||||
$_GET = array('mod'=>'space', 'uid'=>$_SERVER['QUERY_STRING']);
|
||||
} else {
|
||||
|
||||
$url = '';
|
||||
$domain = $_ENV = array();
|
||||
$jump = false;
|
||||
@include_once './data/sysdata/cache_domain.php';
|
||||
$_ENV['domain'] = $domain;
|
||||
if(empty($_ENV['domain'])) {
|
||||
$_ENV['curapp'] = 'forum';
|
||||
} else {
|
||||
$_ENV['defaultapp'] = array('portal.php' => 'portal', 'forum.php' => 'forum', 'group.php' => 'group', 'home.php' => 'home');
|
||||
$_ENV['hostarr'] = explode('.', $_SERVER['HTTP_HOST']);
|
||||
$_ENV['domainroot'] = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1);
|
||||
if(!empty($_ENV['domain']['app']) && is_array($_ENV['domain']['app']) && in_array($_SERVER['HTTP_HOST'], $_ENV['domain']['app'])) {
|
||||
$_ENV['curapp'] = array_search($_SERVER['HTTP_HOST'], $_ENV['domain']['app']);
|
||||
if($_ENV['curapp'] == 'mobile') {
|
||||
$_ENV['curapp'] = 'forum';
|
||||
if(!isset($_GET['mobile'])) {
|
||||
@$_GET['mobile'] = '2';
|
||||
}
|
||||
}
|
||||
if($_ENV['curapp'] == 'default' || !isset($_ENV['defaultapp'][$_ENV['curapp'].'.php'])) {
|
||||
$_ENV['curapp'] = '';
|
||||
}
|
||||
} elseif(!empty($_ENV['domain']['root']) && is_array($_ENV['domain']['root']) && in_array($_ENV['domainroot'], $_ENV['domain']['root'])) {
|
||||
|
||||
$_G['setting']['holddomain'] = $_ENV['domain']['holddomain'] ? $_ENV['domain']['holddomain'] : array('www');
|
||||
$list = $_ENV['domain']['list'];
|
||||
if(isset($list[$_SERVER['HTTP_HOST']])) {
|
||||
$domain = $list[$_SERVER['HTTP_HOST']];
|
||||
switch($domain['idtype']) {
|
||||
case 'subarea':
|
||||
$_ENV['curapp'] = 'forum';
|
||||
$_GET['gid'] = intval($domain['id']);
|
||||
break;
|
||||
case 'forum':
|
||||
$_ENV['curapp'] = 'forum';
|
||||
$_GET['mod'] = 'forumdisplay';
|
||||
$_GET['fid'] = intval($domain['id']);
|
||||
break;
|
||||
case 'topic':
|
||||
$_ENV['curapp'] = 'portal';
|
||||
$_GET['mod'] = 'topic';
|
||||
$_GET['topicid'] = intval($domain['id']);
|
||||
break;
|
||||
case 'channel':
|
||||
$_ENV['curapp'] = 'portal';
|
||||
$_GET['mod'] = 'list';
|
||||
$_GET['catid'] = intval($domain['id']);
|
||||
break;
|
||||
case 'plugin':
|
||||
$_ENV['curapp'] = 'plugin';
|
||||
$_GET['id'] = $domain['id'];
|
||||
$_GET['fromapp'] = 'index';
|
||||
break;
|
||||
}
|
||||
} elseif(count($_ENV['hostarr']) > 2 && $_ENV['hostarr'][0] != 'www' && !checkholddomain($_ENV['hostarr'][0])) {
|
||||
$_ENV['prefixdomain'] = addslashes($_ENV['hostarr'][0]);
|
||||
$_ENV['domainroot'] = addslashes($_ENV['domainroot']);
|
||||
require_once './source/class/class_core.php';
|
||||
C::app()->init_setting = true;
|
||||
C::app()->init_user = false;
|
||||
C::app()->init_session = false;
|
||||
C::app()->init_cron = false;
|
||||
C::app()->init_misc = false;
|
||||
C::app()->init();
|
||||
$jump = true;
|
||||
$domain = C::t('common_domain')->fetch_by_domain_domainroot($_ENV['prefixdomain'], $_ENV['domainroot']);
|
||||
$apphost = $_ENV['domain']['app'][$domain['idtype']] ? $_ENV['domain']['app'][$domain['idtype']] : $_ENV['domain']['app']['default'];
|
||||
$apphost = $apphost ? 'http://'.$apphost.'/' : '';
|
||||
switch($domain['idtype']) {
|
||||
case 'home':
|
||||
if($_G['setting']['rewritestatus'] && in_array('home_space', $_G['setting']['rewritestatus'])) {
|
||||
$url = rewriteoutput('home_space', 1, $apphost, $domain['id']);
|
||||
} else {
|
||||
$url = $apphost.'home.php?mod=space&uid='.$domain['id'];
|
||||
}
|
||||
break;
|
||||
case 'group':
|
||||
if($_G['setting']['rewritestatus'] && in_array('group_group', $_G['setting']['rewritestatus'])) {
|
||||
$url = rewriteoutput('group_group', 1, $apphost, $domain['id']);
|
||||
} else {
|
||||
$url = $apphost.'forum.php?mod=group&fid='.$domain['id'].'&page=1';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$jump = true;
|
||||
}
|
||||
if(empty($url) && empty($_ENV['curapp'])) {
|
||||
if(!empty($_ENV['domain']['defaultindex']) && !$jump) {
|
||||
if($_ENV['defaultapp'][$_ENV['domain']['defaultindex']]) {
|
||||
$_ENV['curapp'] = $_ENV['defaultapp'][$_ENV['domain']['defaultindex']];
|
||||
} else {
|
||||
$url = $_ENV['domain']['defaultindex'];
|
||||
}
|
||||
} else {
|
||||
if($jump) {
|
||||
$url = empty($_ENV['domain']['app']['default']) ? (!empty($_ENV['domain']['defaultindex']) ? $_ENV['domain']['defaultindex'] : 'forum.php') : 'http://'.$_ENV['domain']['app']['default'];
|
||||
} else {
|
||||
$_ENV['curapp'] = 'forum';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($url)) {
|
||||
$delimiter = strrpos($url, '?') ? '&' : '?';
|
||||
if(isset($_GET['fromuid']) && $_GET['fromuid']) {
|
||||
$url .= sprintf('%sfromuid=%d', $delimiter, $_GET['fromuid']);
|
||||
} elseif(isset($_GET['fromuser']) && $_GET['fromuser']) {
|
||||
$url .= sprintf('%sfromuser=%s', $delimiter, rawurlencode($_GET['fromuser']));
|
||||
}
|
||||
header("HTTP/1.1 301 Moved Permanently");
|
||||
header("location: $url");
|
||||
} else {
|
||||
require './'.$_ENV['curapp'].'.php';
|
||||
}
|
||||
|
||||
function checkholddomain($domain) {
|
||||
global $_G;
|
||||
|
||||
$domain = strtolower($domain);
|
||||
if(preg_match("/^[^a-z]/i", $domain)) return true;
|
||||
$holdmainarr = empty($_G['setting']['holddomain']) ? array('www') : explode('|', $_G['setting']['holddomain']);
|
||||
$ishold = false;
|
||||
foreach ($holdmainarr as $value) {
|
||||
if(strpos($value, '*') === false) {
|
||||
if(strtolower($value) == $domain) {
|
||||
$ishold = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$value = str_replace('*', '.*?', $value);
|
||||
if(@preg_match("/$value/i", $domain)) {
|
||||
$ishold = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ishold;
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,208 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<root>
|
||||
<item id="spacecss"><![CDATA[#portal_block_1 .dxb_bc {margin-left:0px !important;}#portal_block_2 .dxb_bc {font-size:14px !important;margin-left:10px !important;}]]></item>
|
||||
<item id="layoutdata">
|
||||
<item id="diy1"><![CDATA[]]></item>
|
||||
<item id="diycontenttop"><![CDATA[]]></item>
|
||||
<item id="diy5">
|
||||
<item id="frame`framez4HEbL">
|
||||
<item id="attr">
|
||||
<item id="name"><![CDATA[framez4HEbL]]></item>
|
||||
<item id="moveable"><![CDATA[true]]></item>
|
||||
<item id="className"><![CDATA[frame move-span cl frame-1-1]]></item>
|
||||
<item id="titles"><![CDATA[]]></item>
|
||||
</item>
|
||||
<item id="column`framez4HEbL_left">
|
||||
<item id="attr">
|
||||
<item id="name"><![CDATA[framez4HEbL_left]]></item>
|
||||
<item id="className"><![CDATA[column frame-1-1-l]]></item>
|
||||
</item>
|
||||
<item id="block`portal_block_1">
|
||||
<item id="attr">
|
||||
<item id="name"><![CDATA[portal_block_1]]></item>
|
||||
<item id="className"><![CDATA[block move-span]]></item>
|
||||
<item id="titles"><![CDATA[]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="column`framez4HEbL_center">
|
||||
<item id="attr">
|
||||
<item id="name"><![CDATA[framez4HEbL_center]]></item>
|
||||
<item id="className"><![CDATA[column frame-1-1-r]]></item>
|
||||
</item>
|
||||
<item id="block`portal_block_2">
|
||||
<item id="attr">
|
||||
<item id="name"><![CDATA[portal_block_2]]></item>
|
||||
<item id="className"><![CDATA[block move-span]]></item>
|
||||
<item id="titles"><![CDATA[]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="diycommendtop"><![CDATA[]]></item>
|
||||
<item id="diycategorytop"><![CDATA[]]></item>
|
||||
<item id="diycontentbottom"><![CDATA[]]></item>
|
||||
<item id="diysidetop"><![CDATA[]]></item>
|
||||
<item id="diysidemiddle"><![CDATA[]]></item>
|
||||
<item id="diysidebottom"><![CDATA[]]></item>
|
||||
<item id="diy4"><![CDATA[]]></item>
|
||||
</item>
|
||||
<item id="style"><![CDATA[]]></item>
|
||||
<item id="blockdata">
|
||||
<item id="block">
|
||||
<item id="1">
|
||||
<item id="bid"><![CDATA[1]]></item>
|
||||
<item id="blockclass"><![CDATA[group_thread]]></item>
|
||||
<item id="blocktype"><![CDATA[0]]></item>
|
||||
<item id="name"><![CDATA[]]></item>
|
||||
<item id="title"><![CDATA[]]></item>
|
||||
<item id="classname"><![CDATA[]]></item>
|
||||
<item id="summary"><![CDATA[]]></item>
|
||||
<item id="uid"><![CDATA[1]]></item>
|
||||
<item id="username"><![CDATA[admin]]></item>
|
||||
<item id="styleid"><![CDATA[0]]></item>
|
||||
<item id="blockstyle">
|
||||
<item id="name"><![CDATA[]]></item>
|
||||
<item id="blockclass"><![CDATA[group_thread]]></item>
|
||||
<item id="makethumb"><![CDATA[1]]></item>
|
||||
<item id="getpic"><![CDATA[1]]></item>
|
||||
<item id="getsummary"><![CDATA[0]]></item>
|
||||
<item id="settarget"><![CDATA[1]]></item>
|
||||
<item id="fields">
|
||||
<item id="0"><![CDATA[url]]></item>
|
||||
<item id="1"><![CDATA[pic]]></item>
|
||||
<item id="2"><![CDATA[title]]></item>
|
||||
</item>
|
||||
<item id="template">
|
||||
<item id="raw"><![CDATA[<div class="module cl slidebox">
|
||||
<ul class="slideshow">
|
||||
[loop]
|
||||
<li style="width: {picwidth}px; height: {picheight}px;"><a href="{url}"{target}><img src="{pic}" width="{picwidth}" height="{picheight}" /></a><span class="title">{title}</span></li>
|
||||
[/loop]
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
runslideshow();
|
||||
</script>]]></item>
|
||||
<item id="footer"><![CDATA[]]></item>
|
||||
<item id="header"><![CDATA[]]></item>
|
||||
<item id="indexplus">
|
||||
</item>
|
||||
<item id="index">
|
||||
</item>
|
||||
<item id="orderplus">
|
||||
</item>
|
||||
<item id="order">
|
||||
</item>
|
||||
<item id="loopplus">
|
||||
</item>
|
||||
<item id="loop"><![CDATA[<li style="width: {picwidth}px; height: {picheight}px;"><a href="{url}"{target}><img src="{pic}" width="{picwidth}" height="{picheight}" /></a><span class="title">{title}</span></li>]]></item>
|
||||
</item>
|
||||
<item id="hash"><![CDATA[7af6727c]]></item>
|
||||
</item>
|
||||
<item id="picwidth"><![CDATA[339]]></item>
|
||||
<item id="picheight"><![CDATA[215]]></item>
|
||||
<item id="target"><![CDATA[blank]]></item>
|
||||
<item id="dateformat"><![CDATA[Y-m-d]]></item>
|
||||
<item id="dateuformat"><![CDATA[0]]></item>
|
||||
<item id="script"><![CDATA[groupthread]]></item>
|
||||
<item id="param">
|
||||
<item id="gtids">
|
||||
<item id="0"><![CDATA[0]]></item>
|
||||
</item>
|
||||
<item id="rewardstatus"><![CDATA[0]]></item>
|
||||
<item id="titlelength"><![CDATA[40]]></item>
|
||||
<item id="summarylength"><![CDATA[80]]></item>
|
||||
<item id="startrow"><![CDATA[0]]></item>
|
||||
<item id="items"><![CDATA[4]]></item>
|
||||
<item id="special">
|
||||
<item id="0"><![CDATA[0]]></item>
|
||||
</item>
|
||||
<item id="picrequired"><![CDATA[1]]></item>
|
||||
</item>
|
||||
<item id="shownum"><![CDATA[4]]></item>
|
||||
<item id="cachetime"><![CDATA[0]]></item>
|
||||
<item id="punctualupdate"><![CDATA[0]]></item>
|
||||
<item id="hidedisplay"><![CDATA[0]]></item>
|
||||
<item id="dateline"><![CDATA[1308275841]]></item>
|
||||
<item id="notinherited"><![CDATA[0]]></item>
|
||||
<item id="isblank"><![CDATA[0]]></item>
|
||||
</item>
|
||||
<item id="2">
|
||||
<item id="bid"><![CDATA[2]]></item>
|
||||
<item id="blockclass"><![CDATA[group_thread]]></item>
|
||||
<item id="blocktype"><![CDATA[0]]></item>
|
||||
<item id="name"><![CDATA[]]></item>
|
||||
<item id="title"><![CDATA[]]></item>
|
||||
<item id="classname"><![CDATA[]]></item>
|
||||
<item id="summary"><![CDATA[]]></item>
|
||||
<item id="uid"><![CDATA[1]]></item>
|
||||
<item id="username"><![CDATA[admin]]></item>
|
||||
<item id="styleid"><![CDATA[24]]></item>
|
||||
<item id="blockstyle"><![CDATA[]]></item>
|
||||
<item id="picwidth"><![CDATA[0]]></item>
|
||||
<item id="picheight"><![CDATA[0]]></item>
|
||||
<item id="target"><![CDATA[blank]]></item>
|
||||
<item id="dateformat"><![CDATA[Y-m-d]]></item>
|
||||
<item id="dateuformat"><![CDATA[0]]></item>
|
||||
<item id="script"><![CDATA[groupthreadspecial]]></item>
|
||||
<item id="param">
|
||||
<item id="gtids">
|
||||
<item id="0"><![CDATA[0]]></item>
|
||||
</item>
|
||||
<item id="rewardstatus"><![CDATA[0]]></item>
|
||||
<item id="picrequired"><![CDATA[0]]></item>
|
||||
<item id="titlelength"><![CDATA[40]]></item>
|
||||
<item id="summarylength"><![CDATA[80]]></item>
|
||||
<item id="items"><![CDATA[10]]></item>
|
||||
</item>
|
||||
<item id="shownum"><![CDATA[10]]></item>
|
||||
<item id="cachetime"><![CDATA[3600]]></item>
|
||||
<item id="punctualupdate"><![CDATA[0]]></item>
|
||||
<item id="hidedisplay"><![CDATA[0]]></item>
|
||||
<item id="dateline"><![CDATA[1308275761]]></item>
|
||||
<item id="notinherited"><![CDATA[0]]></item>
|
||||
<item id="isblank"><![CDATA[0]]></item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="style">
|
||||
<item id="24">
|
||||
<item id="styleid"><![CDATA[24]]></item>
|
||||
<item id="blockclass"><![CDATA[group_thread]]></item>
|
||||
<item id="name"><![CDATA[[内置]帖子标题]]></item>
|
||||
<item id="template">
|
||||
<item id="raw"><![CDATA[<div class="module cl xl xl1">
|
||||
<ul>
|
||||
[loop]
|
||||
<li><a href="{url}" title="{title}"{target}>{title}</a></li>
|
||||
[/loop]
|
||||
</ul>
|
||||
</div>]]></item>
|
||||
<item id="footer"><![CDATA[]]></item>
|
||||
<item id="header"><![CDATA[]]></item>
|
||||
<item id="indexplus">
|
||||
</item>
|
||||
<item id="index">
|
||||
</item>
|
||||
<item id="orderplus">
|
||||
</item>
|
||||
<item id="order">
|
||||
</item>
|
||||
<item id="loopplus">
|
||||
</item>
|
||||
<item id="loop"><![CDATA[<li><a href="{url}" title="{title}"{target}>{title}</a></li>]]></item>
|
||||
</item>
|
||||
<item id="hash"><![CDATA[176fcc68]]></item>
|
||||
<item id="getpic"><![CDATA[0]]></item>
|
||||
<item id="getsummary"><![CDATA[0]]></item>
|
||||
<item id="makethumb"><![CDATA[0]]></item>
|
||||
<item id="settarget"><![CDATA[1]]></item>
|
||||
<item id="fields">
|
||||
<item id="0"><![CDATA[url]]></item>
|
||||
<item id="1"><![CDATA[title]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</root>
|
After Width: | Height: | Size: 116 B |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 546 B |
After Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 2.6 KiB |
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
(C) 2001-2009 Comsenz Inc.
|
||||
*/
|
||||
|
||||
/* common */
|
||||
*{ word-wrap:break-word; }
|
||||
body{ padding:5px 0; background:#FFF; text-align:center; }
|
||||
body, td, input, textarea, select, button{ color:#666; font:12px/1.5 Verdana, Tahoma, Arial, 'Microsoft Yahei', 'Simsun', sans-serif; }
|
||||
ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin:0; padding:0; }
|
||||
h1, h2, h3, h4, h5, h6{ font-size:12px; }
|
||||
a{ color:#2366A8; text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
a img{ border:none; }
|
||||
em, cite, strong, th{ font-style:normal; font-weight:normal; }
|
||||
table{ border-collapse:collapse; }
|
||||
th{ text-align:left; }
|
||||
|
||||
/* box */
|
||||
.container{ overflow:hidden; margin:0 auto; width:700px; height:auto !important;text-align:left; border:1px solid #B5CFD9; }
|
||||
.header{ *overflow:hidden; height:194px; background:url(bg_repx.gif) repeat-x; }
|
||||
.header h1{ text-indent:-9999px; width:270px; height:48px; background:url(bg_repno.gif) no-repeat 26px 22px; }
|
||||
.header span { float: right; padding-right: 10px; }
|
||||
.main{ padding:20px 20px 0; background:#F7FBFE url(bg_repx.gif) repeat-x 0 -194px; }
|
||||
.main h3{ margin:10px auto; width:75%; color:#6CA1B4; font-weight:700; }
|
||||
.desc{ margin:0 auto; width:537px; line-height:180%; clear:both; }
|
||||
.desc ul{ margin-left:20px; }
|
||||
.desc1{ margin:10px 0; width:100%; }
|
||||
.desc1 ul{ margin-left:25px; }
|
||||
.desc1 li{ margin:3px 0; }
|
||||
.tb, .tb2{ margin:15px 0 15px 67px; }
|
||||
.tb th{ padding:5px; color:#6CA1B4; font-weight:700; }
|
||||
.tb td{ padding:3px 5px; }
|
||||
.tb .w, .tb .nw, .tb .padleft{ padding-left:45px; }
|
||||
.tb .pdleft1{ padding-left:67px; }
|
||||
.tb2{}
|
||||
.tb2 th, .tb2 td{ padding:3px 5px; }
|
||||
.tbopt{ width:130px; }
|
||||
.btnbox{ text-align:center; }
|
||||
.btnbox input{ margin:0 2px; }
|
||||
.btnbox textarea{ margin-bottom:10px; height:150px; }
|
||||
.btn{ margin-top:10px; }
|
||||
.footer{ line-height:40px; text-align:center; background:url(bg_footer.gif) repeat-x; font-size:11px; }
|
||||
|
||||
/* form */
|
||||
.txt{ width:200px; }
|
||||
|
||||
/* step num */
|
||||
.setup{ margin:46px 0 0 200px; padding-left:70px; }
|
||||
.setup h2{ padding-top:0; *padding-top:6px; line-height:1.2; color:#6CA1B4; font-size:36px; }
|
||||
.setup p{ margin:0 0 10px 6px; color:#999; }
|
||||
.step1{ background:url(stepnum.gif) no-repeat 0 8px; }
|
||||
.step2{ background:url(stepnum.gif) no-repeat 0 -92px; }
|
||||
.step3{ background:url(stepnum.gif) no-repeat 0 -192px; }
|
||||
.step4{ background:url(stepnum.gif) no-repeat 0 -292px; }
|
||||
|
||||
/* step status */
|
||||
.stepstat{ position:relative; bottom:-5px; *bottom:0; left:80px; *width:593px; height:30px; }
|
||||
.stepstatbg{ position:absolute; top:18px; z-index:90; width:535px; height:9px; overflow:hidden; background:#81C6F0 url(bg_stepstatus.gif) no-repeat; }
|
||||
.stepstat ul{ position:absolute; top:3px; left:-2px; z-index:100; list-style:none; width:600px; white-space:nowrap; overflow:hidden; }
|
||||
.stepstat li{ float:left; text-indent:20px; width:175px; height:30px; line-height:14px; font-size:12px; background:url(bg_repno.gif) no-repeat 0 -38px; }
|
||||
.stepstat .current{ background:url(bg_repno.gif) no-repeat 0 -71px; font-weight:700; }
|
||||
.stepstat .unactivated{ background:url(bg_repno.gif) no-repeat 0 -103px; }
|
||||
.stepstat .last{ width:50px; }
|
||||
.stepstat1{ background-position:-750px 0; }
|
||||
.stepstat2{ background-position:-570px 0; }
|
||||
.stepstat3{ background-position:-390px 0; }
|
||||
.stepstat4{ background-position:-210px 0; }
|
||||
|
||||
/* file status */
|
||||
.w{ background:url(bg_repno.gif) no-repeat 45px -148px; }
|
||||
.nw{ background:url(bg_repno.gif) no-repeat 45px -197px; }
|
||||
|
||||
/* space */
|
||||
.marginbot{ margin-bottom:20px; }
|
||||
.margintop{ margin-top:20px; }
|
||||
.red{ color:red; }
|
||||
|
||||
.licenseblock{ margin-bottom:15px; padding:8px; height:280px; border:1px solid #EEE; background:#FFF; overflow:scroll; overflow-x:hidden; }
|
||||
.license{}
|
||||
.license h1{ padding-bottom:10px; font-size:14px; text-align:center; }
|
||||
.license h3{ margin:0; color:#666; }
|
||||
.license p{ line-height:150%; margin:10px 0; text-indent:25px; }
|
||||
.license li{ line-height:150%; margin:5px 0; }
|
||||
.title{ margin:5px 0 -15px 60px; }
|
||||
|
||||
#notice { overflow: hidden; margin: 20px; padding: 5px; height: 300px; border: 1px solid #B5CFD9; text-align: left; }
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_extvar.php 31245 2012-07-31 02:54:24Z liulanbo $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
$settings = array(
|
||||
'extcredits' => array(
|
||||
1 => array('title' => $lang['init_credits_money'], 'ratio' => 0, 'available' => 1),
|
||||
2 => array('title' => $lang['init_credits_karma'], 'ratio' => 0, 'available' => 1),
|
||||
),
|
||||
'postnocustom' => array(
|
||||
0 => $lang['init_postno0'], 1 => $lang['init_postno1'], 2 => $lang['init_postno2'], 3 => $lang['init_postno3']
|
||||
),
|
||||
|
||||
'recommendthread' => array(
|
||||
'status' => '1',
|
||||
'addtext' => $lang['init_support'],
|
||||
'subtracttext' => $lang['init_opposition'],
|
||||
'defaultshow' => '1',
|
||||
'daycount' => '0',
|
||||
'ownthread' => '0',
|
||||
'iconlevels' => '0,100,200',
|
||||
),
|
||||
|
||||
'tasktypes' => array(
|
||||
'promotion' => array(
|
||||
'name' => $lang['init_promotion_task'],
|
||||
'version' => '1.0',
|
||||
),
|
||||
'gift' => array(
|
||||
'name' => $lang['init_gift_task'],
|
||||
'version' => '1.0',
|
||||
),
|
||||
'avatar' => array(
|
||||
'name' => $lang['init_avatar_task'],
|
||||
'version' => '1.0',
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
|
@ -0,0 +1,369 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_lang.php 36287 2016-12-12 03:59:05Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('UC_VERNAME', '中文版');
|
||||
$lang = array(
|
||||
'SC_GBK' => '简体中文版',
|
||||
'TC_BIG5' => '繁体中文版',
|
||||
'SC_UTF8' => '简体中文 UTF8 版',
|
||||
'TC_UTF8' => '繁体中文 UTF8 版',
|
||||
'EN_ISO' => 'ENGLISH ISO8859',
|
||||
'EN_UTF8' => 'ENGLIST UTF-8',
|
||||
|
||||
'title_install' => SOFT_NAME.' 安装向导',
|
||||
'agreement_yes' => '我同意',
|
||||
'agreement_no' => '我不同意',
|
||||
'notset' => '不限制',
|
||||
'enable' => '开启',
|
||||
'disable' => '关闭',
|
||||
|
||||
'message_title' => '提示信息',
|
||||
'error_message' => '错误信息',
|
||||
'message_return' => '返回',
|
||||
'return' => '返回',
|
||||
'install_wizard' => '安装向导',
|
||||
'config_nonexistence' => '配置文件不存在',
|
||||
'nodir' => '目录不存在',
|
||||
'redirect' => '浏览器会自动跳转页面,无需人工干预。<br>除非当您的浏览器没有自动跳转时,请点击这里',
|
||||
'auto_redirect' => '浏览器会自动跳转页面,无需人工干预',
|
||||
'database_errno_2003' => '无法连接数据库,请检查数据库是否启动,数据库服务器地址是否正确',
|
||||
'database_errno_1044' => '无法创建新的数据库,请检查数据库名称填写是否正确',
|
||||
'database_errno_1045' => '无法连接数据库,请检查数据库用户名或者密码是否正确',
|
||||
'database_errno_1064' => 'SQL 语法错误',
|
||||
|
||||
'dbpriv_createtable' => '没有CREATE TABLE权限,无法继续安装',
|
||||
'dbpriv_insert' => '没有INSERT权限,无法继续安装',
|
||||
'dbpriv_select' => '没有SELECT权限,无法继续安装',
|
||||
'dbpriv_update' => '没有UPDATE权限,无法继续安装',
|
||||
'dbpriv_delete' => '没有DELETE权限,无法继续安装',
|
||||
'dbpriv_droptable' => '没有DROP TABLE权限,无法安装',
|
||||
|
||||
'db_not_null' => '数据库中已经安装过 UCenter, 继续安装会清空原有数据。',
|
||||
'db_drop_table_confirm' => '继续安装会清空全部原有数据,您确定要继续吗?',
|
||||
|
||||
'writeable' => '可写',
|
||||
'unwriteable' => '不可写',
|
||||
'old_step' => '上一步',
|
||||
'new_step' => '下一步',
|
||||
|
||||
'database_errno_2003' => '无法连接数据库,请检查数据库是否启动,数据库服务器地址是否正确',
|
||||
'database_errno_1044' => '无法创建新的数据库,请检查数据库名称填写是否正确',
|
||||
'database_errno_1045' => '无法连接数据库,请检查数据库用户名或者密码是否正确',
|
||||
'database_connect_error' => '数据库连接错误',
|
||||
|
||||
'step_title_1' => '检查安装环境',
|
||||
'step_title_2' => '设置运行环境',
|
||||
'step_title_3' => '创建数据库',
|
||||
'step_title_4' => '安装',
|
||||
'step_env_check_title' => '开始安装',
|
||||
'step_env_check_desc' => '环境以及文件目录权限检查',
|
||||
'step_db_init_title' => '安装数据库',
|
||||
'step_db_init_desc' => '正在执行数据库安装',
|
||||
|
||||
'step1_file' => '目录文件',
|
||||
'step1_need_status' => '所需状态',
|
||||
'step1_status' => '当前状态',
|
||||
'not_continue' => '请将以上红叉部分修正再试',
|
||||
|
||||
'tips_dbinfo' => '填写数据库信息',
|
||||
'tips_dbinfo_comment' => '',
|
||||
'tips_admininfo' => '填写管理员信息',
|
||||
'step_ext_info_title' => '安装成功。',
|
||||
'step_ext_info_comment' => '点击进入登录',
|
||||
|
||||
'ext_info_succ' => '安装成功。',
|
||||
'install_submit' => '提交',
|
||||
'install_locked' => '安装锁定,已经安装过了,如果您确定要重新安装,请到服务器上删除<br /> '.str_replace(ROOT_PATH, '', $lockfile),
|
||||
'error_quit_msg' => '您必须解决以上问题,安装才可以继续',
|
||||
|
||||
'step_app_reg_title' => '设置运行环境',
|
||||
'step_app_reg_desc' => '检测服务器环境以及设置 UCenter',
|
||||
'tips_ucenter' => '请填写 UCenter 相关信息',
|
||||
'tips_ucenter_comment' => 'UCenter 是 Comsenz 公司产品的核心服务程序,Discuz! Board 的安装和运行依赖此程序。如果您已经安装了 UCenter,请填写以下信息。否则,请到 <a href="http://www.discuz.com/" target="blank">Comsenz 产品中心</a> 下载并且安装,然后再继续。',
|
||||
|
||||
'advice_mysql_connect' => '请检查 mysql 模块是否正确加载',
|
||||
'advice_gethostbyname' => '是否 PHP 配置中禁止了 gethostbyname 函数。请联系空间商,确定开启了此项功能',
|
||||
'advice_file_get_contents' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系空间商,确定开启了此项功能',
|
||||
'advice_xml_parser_create' => '该函数需要 PHP 支持 XML。请联系空间商,确定开启了此项功能',
|
||||
'advice_fsockopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系空间商,确定开启了此项功能',
|
||||
'advice_pfsockopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系空间商,确定开启了此项功能',
|
||||
'advice_stream_socket_client' => '是否 PHP 配置中禁止了 stream_socket_client 函数',
|
||||
'advice_curl_init' => '是否 PHP 配置中禁止了 curl_init 函数',
|
||||
|
||||
'ucurl' => 'UCenter 的 URL',
|
||||
'ucpw' => 'UCenter 创始人密码',
|
||||
'ucip' => 'UCenter 的IP地址',
|
||||
'ucenter_ucip_invalid' => '格式错误,请填写正确的 IP 地址',
|
||||
'ucip_comment' => '绝大多数情况下您可以不填',
|
||||
|
||||
'tips_siteinfo' => '请填写站点信息',
|
||||
'sitename' => '站点名称',
|
||||
'siteurl' => '站点 URL',
|
||||
|
||||
'forceinstall' => '强制安装',
|
||||
'dbinfo_forceinstall_invalid' => '当前数据库当中已经含有同样表前缀的数据表,您可以修改“表名前缀”来避免删除旧的数据,或者选择强制安装。强制安装会删除旧数据,且无法恢复',
|
||||
|
||||
'click_to_back' => '点击返回上一步',
|
||||
'adminemail' => '系统信箱 Email',
|
||||
'adminemail_comment' => '用于发送程序错误报告',
|
||||
'dbhost_comment' => '数据库服务器地址, 一般为 localhost',
|
||||
'tablepre_comment' => '同一数据库运行多个论坛时,请修改前缀',
|
||||
'forceinstall_check_label' => '我要删除数据,强制安装 !!!',
|
||||
|
||||
'uc_url_empty' => '您没有填写 UCenter 的 URL,请返回填写',
|
||||
'uc_url_invalid' => 'URL 格式错误',
|
||||
'uc_url_unreachable' => 'UCenter 的 URL 地址可能填写错误,请检查',
|
||||
'uc_ip_invalid' => '无法解析该域名,请填写站点的 IP',
|
||||
'uc_admin_invalid' => 'UCenter 创始人密码错误,请重新填写',
|
||||
'uc_data_invalid' => '通信失败,请检查 UCenter 的URL 地址是否正确 ',
|
||||
'uc_dbcharset_incorrect' => 'UCenter 数据库字符集与当前应用字符集不一致',
|
||||
'uc_api_add_app_error' => '向 UCenter 添加应用错误',
|
||||
'uc_dns_error' => 'UCenter DNS解析错误,请返回填写一下 UCenter 的 IP地址',
|
||||
|
||||
'ucenter_ucurl_invalid' => 'UCenter 的URL为空,或者格式错误,请检查',
|
||||
'ucenter_ucpw_invalid' => 'UCenter 的创始人密码为空,或者格式错误,请检查',
|
||||
'siteinfo_siteurl_invalid' => '站点URL为空,或者格式错误,请检查',
|
||||
'siteinfo_sitename_invalid' => '站点名称为空,或者格式错误,请检查',
|
||||
'dbinfo_dbhost_invalid' => '数据库服务器为空,或者格式错误,请检查',
|
||||
'dbinfo_dbname_invalid' => '数据库名为空,或者格式错误,请检查',
|
||||
'dbinfo_dbuser_invalid' => '数据库用户名为空,或者格式错误,请检查',
|
||||
'dbinfo_dbpw_invalid' => '数据库密码为空,或者格式错误,请检查',
|
||||
'dbinfo_adminemail_invalid' => '系统邮箱为空,或者格式错误,请检查',
|
||||
'dbinfo_tablepre_invalid' => '数据表前缀为空,或者格式错误,请检查',
|
||||
'admininfo_username_invalid' => '管理员用户名为空,或者格式错误,请检查',
|
||||
'admininfo_email_invalid' => '管理员Email为空,或者格式错误,请检查',
|
||||
'admininfo_password_invalid' => '管理员密码为空,请填写',
|
||||
'admininfo_password2_invalid' => '两次密码不一致,请检查',
|
||||
|
||||
'install_dzfull' => '<br><label><input type="radio"'.(getgpc('install_ucenter') != 'no' ? ' checked="checked"' : '').' name="install_ucenter" value="yes" onclick="if(this.checked)$(\'form_items_2\').style.display=\'none\';" /> 全新安装 Discuz! X (含 UCenter Server)</label>',
|
||||
'install_dzonly' => '<br><label><input type="radio"'.(getgpc('install_ucenter') == 'no' ? ' checked="checked"' : '').' name="install_ucenter" value="no" onclick="if(this.checked)$(\'form_items_2\').style.display=\'\';" /> 仅安装 Discuz! X (手工指定已经安装的 UCenter Server)</label>',
|
||||
|
||||
'username' => '管理员账号',
|
||||
'email' => '管理员 Email',
|
||||
'password' => '管理员密码',
|
||||
'password_comment' => '管理员密码不能为空',
|
||||
'password2' => '重复密码',
|
||||
|
||||
'admininfo_invalid' => '管理员信息不完整,请检查管理员账号,密码,邮箱',
|
||||
'dbname_invalid' => '数据库名为空,请填写数据库名称',
|
||||
'tablepre_invalid' => '数据表前缀为空,或者格式错误,请检查',
|
||||
'admin_username_invalid' => '非法用户名,用户名长度不应当超过 15 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字',
|
||||
'admin_password_invalid' => '密码和上面不一致,请重新输入',
|
||||
'admin_email_invalid' => 'Email 地址错误,此邮件地址已经被使用或者格式无效,请更换为其他地址',
|
||||
'admin_invalid' => '您的信息管理员信息没有填写完整,请仔细填写每个项目',
|
||||
'admin_exist_password_error' => '该用户已经存在,如果您要设置此用户为论坛的管理员,请正确输入该用户的密码,或者请更换论坛管理员的名字',
|
||||
|
||||
'tagtemplates_subject' => '标题',
|
||||
'tagtemplates_uid' => '用户 ID',
|
||||
'tagtemplates_username' => '发帖者',
|
||||
'tagtemplates_dateline' => '日期',
|
||||
'tagtemplates_url' => '主题地址',
|
||||
|
||||
'uc_version_incorrect' => '您的 UCenter 服务端版本过低,请升级 UCenter 服务端到最新版本,并且升级,下载地址:http://www.comsenz.com/ 。',
|
||||
'config_unwriteable' => '安装向导无法写入配置文件, 请设置 config.inc.php 程序属性为可写状态(777)',
|
||||
|
||||
'install_in_processed' => '正在安装...',
|
||||
'install_succeed' => '安装成功,点击进入',
|
||||
'install_cloud' => '安装成功,欢迎开通Discuz!云平台<br>Discuz!云平台致力于帮助站长提高网站流量,增强网站运营能力,增加网站收入。<br>Discuz!云平台目前免费提供了QQ互联、腾讯分析、纵横搜索、漫游应用、SOSO表情服务。Discuz!云平台将陆续提供更多优质服务项目。<br>开通Discuz!平台之前,请确保您的网站(Discuz!、UCHome或SupeSite)已经升级到Discuz! X3。',
|
||||
'to_install_cloud' => '到后台开通',
|
||||
'to_index' => '暂不开通',
|
||||
|
||||
'init_credits_karma' => '威望',
|
||||
'init_credits_money' => '金钱',
|
||||
|
||||
'init_postno0' => '楼主',
|
||||
'init_postno1' => '沙发',
|
||||
'init_postno2' => '板凳',
|
||||
'init_postno3' => '地板',
|
||||
|
||||
'init_support' => '支持',
|
||||
'init_opposition' => '反对',
|
||||
|
||||
'init_group_0' => '会员',
|
||||
'init_group_1' => '管理员',
|
||||
'init_group_2' => '超级版主',
|
||||
'init_group_3' => '版主',
|
||||
'init_group_4' => '禁止发言',
|
||||
'init_group_5' => '禁止访问',
|
||||
'init_group_6' => '禁止 IP',
|
||||
'init_group_7' => '游客',
|
||||
'init_group_8' => '等待验证会员',
|
||||
'init_group_9' => '乞丐',
|
||||
'init_group_10' => '新手上路',
|
||||
'init_group_11' => '注册会员',
|
||||
'init_group_12' => '中级会员',
|
||||
'init_group_13' => '高级会员',
|
||||
'init_group_14' => '金牌会员',
|
||||
'init_group_15' => '论坛元老',
|
||||
|
||||
'init_rank_1' => '新生入学',
|
||||
'init_rank_2' => '小试牛刀',
|
||||
'init_rank_3' => '实习记者',
|
||||
'init_rank_4' => '自由撰稿人',
|
||||
'init_rank_5' => '特聘作家',
|
||||
|
||||
'init_cron_1' => '清空今日发帖数',
|
||||
'init_cron_2' => '清空本月在线时间',
|
||||
'init_cron_3' => '每日数据清理',
|
||||
'init_cron_4' => '生日统计与邮件祝福',
|
||||
'init_cron_5' => '主题回复通知',
|
||||
'init_cron_6' => '每日公告清理',
|
||||
'init_cron_7' => '限时操作清理',
|
||||
'init_cron_8' => '论坛推广清理',
|
||||
'init_cron_9' => '每月主题清理',
|
||||
'init_cron_10' => '每日 X-Space更新用户',
|
||||
'init_cron_11' => '每周主题更新',
|
||||
|
||||
'init_bbcode_1' => '使内容横向滚动,这个效果类似 HTML 的 marquee 标签,注意:这个效果只在 Internet Explorer 浏览器下有效。',
|
||||
'init_bbcode_2' => '嵌入 Flash 动画',
|
||||
'init_bbcode_3' => '显示 QQ 在线状态,点这个图标可以和他(她)聊天',
|
||||
'init_bbcode_4' => '上标',
|
||||
'init_bbcode_5' => '下标',
|
||||
'init_bbcode_6' => '嵌入 Windows media 音频',
|
||||
'init_bbcode_7' => '嵌入 Windows media 音频或视频',
|
||||
|
||||
'init_qihoo_searchboxtxt' =>'输入关键词,快速搜索本论坛',
|
||||
'init_threadsticky' =>'全局置顶,分类置顶,本版置顶',
|
||||
|
||||
'init_default_style' => '默认风格',
|
||||
'init_default_forum' => '默认版块',
|
||||
'init_default_template' => '默认模板套系',
|
||||
'init_default_template_copyright' => '北京康盛新创科技有限责任公司',
|
||||
|
||||
'init_dataformat' => 'Y-n-j',
|
||||
'init_modreasons' => '广告/SPAM\r\n恶意灌水\r\n违规内容\r\n文不对题\r\n重复发帖\r\n\r\n我很赞同\r\n精品文章\r\n原创内容',
|
||||
'init_userreasons' => '很给力!\r\n神马都是浮云\r\n赞一个!\r\n山寨\r\n淡定',
|
||||
'init_link' => 'Discuz! 官方论坛',
|
||||
'init_link_note' => '提供最新 Discuz! 产品新闻、软件下载与技术交流',
|
||||
|
||||
'init_promotion_task' => '网站推广任务',
|
||||
'init_gift_task' => '红包类任务',
|
||||
'init_avatar_task' => '头像类任务',
|
||||
|
||||
'license' => '<div class="license"><h1>中文版授权协议 适用于中文用户</h1>
|
||||
|
||||
<p>版权所有 (c) 2001-2017,北京康盛新创科技有限责任公司保留所有权利。</p>
|
||||
|
||||
<p>感谢您选择康盛产品。希望我们的努力能为您提供一个高效快速、强大的站点解决方案,和强大的社区论坛解决方案。康盛公司网址为 http://www.comsenz.com,产品官方讨论区网址为 http://www.discuz.net。</p>
|
||||
|
||||
<p>用户须知:本协议是您与康盛公司之间关于您使用康盛公司提供的各种软件产品及服务的法律协议。无论您是个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,包括免除或者限制康盛责任的免责条款及对您的权利限制。请您审阅并接受或不接受本服务条款。如您不同意本服务条款及/或康盛随时对其的修改,您应不使用或主动取消康盛公司提供的康盛产品。否则,您的任何对康盛产品中的相关服务的注册、登陆、下载、查看等使用行为将被视为您对本服务条款全部的完全接受,包括接受康盛对服务条款随时所做的任何修改。
|
||||
<p>本服务条款一旦发生变更, 康盛将在网页上公布修改内容。修改后的服务条款一旦在网站管理后台上公布即有效代替原来的服务条款。您可随时登陆康盛官方论坛查阅最新版服务条款。如果您选择接受本条款,即表示您同意接受协议各项条件的约束。如果您不同意本服务条款,则不能获得使用本服务的权利。您若有违反本条款规定,康盛公司有权随时中止或终止您对康盛产品的使用资格并保留追究相关法律责任的权利。</p>
|
||||
<p>在理解、同意、并遵守本协议的全部条款后,方可开始使用康盛产品。您可能与康盛公司直接签订另一书面协议,以补充或者取代本协议的全部或者任何部分。</p></p>
|
||||
|
||||
<p>康盛拥有本软件的全部知识产权。本软件只供许可协议,并非出售。康盛只允许您在遵守本协议各项条款的情况下复制、下载、安装、使用或者以其他方式受益于本软件的功能或者知识产权。</p>
|
||||
|
||||
<h3>I. 协议许可的权利</h3>
|
||||
<ol>
|
||||
<li>您可以在完全遵守本许可协议的基础上,将本软件应用于非商业用途,而不必支付软件版权许可费用。</li>
|
||||
<li>您可以在协议规定的约束和限制范围内修改康盛产品源代码(如果被提供的话)或界面风格以适应您的网站要求。</li>
|
||||
<li>您拥有使用本软件构建的网站中全部会员资料、文章及相关信息的所有权,并独立承担与使用本软件构建的网站内容的审核、注意义务,确保其不侵犯任何人的合法权益,独立承担因使用康盛软件和服务带来的全部责任,若造成康盛公司或用户损失的,您应予以全部赔偿。</li>
|
||||
<li>若您需将康盛软件或服务用户商业用途,必须另行获得康盛的书面许可,您在获得商业授权之后,您可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持期限、技术支持方式和技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。</li>
|
||||
<li>您可以从康盛提供的应用中心服务中下载适合您网站的应用程序,但应向应用程序开发者/所有者支付相应的费用。</li>
|
||||
</ol>
|
||||
|
||||
<h3>II. 协议规定的约束和限制</h3>
|
||||
<ol>
|
||||
<li>未获康盛公司书面商业授权之前,不得将本软件用于商业用途(包括但不限于企业网站、经营性网站、以营利为目或实现盈利的网站)。购买商业授权请登陆http://www.discuz.com参考相关说明,也可以致电8610-51282255了解详情。</li>
|
||||
<li>不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。</li>
|
||||
<li>无论如何,即无论用途如何、是否经过修改或美化、修改程度如何,只要使用康盛产品的整体或任何部分,未经书面许可,页面页脚处的康盛产品名称和康盛公司下属网站(http://www.comsenz.com、或 http://www.discuz.net) 的链接都必须保留,而不能清除或修改。</li>
|
||||
<li>禁止在康盛产品的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。</li>
|
||||
<li>您从应用中心下载的应用程序,未经应用程序开发者/所有者的书面许可,不得对其进行反向工程、反向汇编、反向编译等,不得擅自复制、修改、链接、转载、汇编、发表、出版、发展与之有关的衍生产品、作品等。</li>
|
||||
<li>如果您未能遵守本协议的条款,您的授权将被终止,所许可的权利将被收回,同时您应承担相应法律责任。</li>
|
||||
</ol>
|
||||
|
||||
<h3>III. 有限担保和免责声明</h3>
|
||||
<ol>
|
||||
<li>本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。</li>
|
||||
<li>用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。</li>
|
||||
<li>康盛公司不对使用本软件构建的网站中或者论坛中的文章或信息承担责任,全部责任由您自行承担。</li>
|
||||
<li>康盛公司无法全面监控由第三方上传至应用中心的应用程序,因此不保证应用程序的合法性、安全性、完整性、真实性或品质等;您从应用中心下载应用程序时,同意自行判断并承担所有风险,而不依赖于康盛公司。但在任何情况下,康盛公司有权依法停止应用中心服务并采取相应行动,包括但不限于对于相关应用程序进行卸载,暂停服务的全部或部分,保存有关记录,并向有关机关报告。由此对您及第三人可能造成的损失,康盛公司不承担任何直接、间接或者连带的责任。</li>
|
||||
<li>康盛公司对康盛提供的软件和服务之及时性、安全性、准确性不作担保,由于不可抗力因素、康盛公司无法控制的因素(包括黑客攻击、停断电等)等造成软件使用和服务中止或终止,而给您造成损失的,您同意放弃追究康盛公司责任的全部权利。 6.康盛公司特别提请您注意,康盛公司为了保障公司业务发展和调整的自主权,康盛公司拥有随时经或未经事先通知而修改服务内容、中止或终止部分或全部软件使用和服务的权利,修改会公布于康盛公司网站相关页面上,一经公布视为通知。 康盛公司行使修改或中止、终止部分或全部软件使用和服务的权利而造成损失的,康盛公司不需对您或任何第三方负责。</li>
|
||||
</ol>
|
||||
|
||||
<p>有关康盛产品最终用户授权协议、商业授权与技术服务的详细内容,均由康盛公司独家提供。康盛公司拥有在不事先通知的情况下,修改授权协议和服务价目表的权利,修改后的协议或价目表对自改变之日起的新授权用户生效。</p>
|
||||
|
||||
<p>一旦您开始安装康盛产品,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权利的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。</p>
|
||||
|
||||
<p>本许可协议条款的解释,效力及纠纷的解决,适用于中华人民共和国大陆法律。</p>
|
||||
|
||||
<p>若您和康盛之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,您在此完全同意将纠纷或争议提交康盛所在地北京市海淀区人民法院管辖。康盛公司拥有对以上各项条款内容的解释权及修改权。</p>
|
||||
|
||||
<p>(正文完)</p>
|
||||
|
||||
<p align="right">康盛公司</p>
|
||||
|
||||
</div>',
|
||||
|
||||
'uc_installed' => '您已经安装过 UCenter,如果需要重新安装,请删除 data/install.lock 文件',
|
||||
'i_agree' => '我已仔细阅读,并同意上述条款中的所有内容',
|
||||
'supportted' => '支持',
|
||||
'unsupportted' => '不支持',
|
||||
'max_size' => '支持/最大尺寸',
|
||||
'project' => '项目',
|
||||
'ucenter_required' => 'Discuz! 所需配置',
|
||||
'ucenter_best' => 'Discuz! 最佳',
|
||||
'curr_server' => '当前服务器',
|
||||
'env_check' => '环境检查',
|
||||
'os' => '操作系统',
|
||||
'php' => 'PHP 版本',
|
||||
'attachmentupload' => '附件上传',
|
||||
'unlimit' => '不限制',
|
||||
'version' => '版本',
|
||||
'gdversion' => 'GD 库',
|
||||
'allow' => '允许 ',
|
||||
'unix' => '类Unix',
|
||||
'diskspace' => '磁盘空间',
|
||||
'opcache' => 'OPcache',
|
||||
'curl' => 'cURL 库',
|
||||
'priv_check' => '目录、文件权限检查',
|
||||
'func_depend' => '函数依赖性检查',
|
||||
'func_name' => '函数名称',
|
||||
'check_result' => '检查结果',
|
||||
'suggestion' => '建议',
|
||||
'advice_mysql' => '请检查 mysql 模块是否正确加载',
|
||||
'advice_fopen' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系空间商,确定开启了此项功能',
|
||||
'advice_file_get_contents' => '该函数需要 php.ini 中 allow_url_fopen 选项开启。请联系空间商,确定开启了此项功能',
|
||||
'advice_xml' => '该函数需要 PHP 支持 XML。请联系空间商,确定开启了此项功能',
|
||||
'none' => '无',
|
||||
|
||||
'dbhost' => '数据库服务器',
|
||||
'dbuser' => '数据库用户名',
|
||||
'dbpw' => '数据库密码',
|
||||
'dbname' => '数据库名',
|
||||
'tablepre' => '数据表前缀',
|
||||
|
||||
'ucfounderpw' => '创始人密码',
|
||||
'ucfounderpw2' => '重复创始人密码',
|
||||
|
||||
'init_log' => '初始化记录',
|
||||
'clear_dir' => '清空目录',
|
||||
'select_db' => '选择数据库',
|
||||
'create_table' => '建立数据表',
|
||||
'succeed' => '成功 ',
|
||||
|
||||
'install_data' => '正在安装数据',
|
||||
'install_test_data' => '正在安装附加数据',
|
||||
|
||||
'method_undefined' => '未定义方法',
|
||||
'database_nonexistence' => '数据库操作对象不存在',
|
||||
'skip_current' => '跳过本步',
|
||||
'topic' => '专题',
|
||||
'install_finish' => '您的论坛已完成安装,点此访问',
|
||||
|
||||
);
|
||||
|
||||
$msglang = array(
|
||||
'config_nonexistence' => '您的 config.inc.php 不存在, 无法继续安装, 请用 FTP 将该文件上传后再试。',
|
||||
);
|
||||
|
||||
?>
|
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_mysql.php 33334 2013-05-28 09:51:11Z kamichen $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class dbstuff {
|
||||
var $querynum = 0;
|
||||
var $link;
|
||||
var $histories;
|
||||
var $time;
|
||||
var $tablepre;
|
||||
|
||||
function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect = 0, $tablepre='', $time = 0) {
|
||||
$this->time = $time;
|
||||
$this->tablepre = $tablepre;
|
||||
if($pconnect) {
|
||||
if(!$this->link = mysql_pconnect($dbhost, $dbuser, $dbpw)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
} else {
|
||||
if(!$this->link = mysql_connect($dbhost, $dbuser, $dbpw, 1)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
}
|
||||
|
||||
if($this->version() > '4.1') {
|
||||
if($dbcharset) {
|
||||
mysql_query("SET character_set_connection=".$dbcharset.", character_set_results=".$dbcharset.", character_set_client=binary", $this->link);
|
||||
}
|
||||
|
||||
if($this->version() > '5.0.1') {
|
||||
mysql_query("SET sql_mode=''", $this->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($dbname) {
|
||||
mysql_select_db($dbname, $this->link);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fetch_array($query, $result_type = MYSQL_ASSOC) {
|
||||
return mysql_fetch_array($query, $result_type);
|
||||
}
|
||||
|
||||
function result_first($sql, &$data) {
|
||||
$query = $this->query($sql);
|
||||
$data = $this->result($query, 0);
|
||||
}
|
||||
|
||||
function fetch_first($sql, &$arr) {
|
||||
$query = $this->query($sql);
|
||||
$arr = $this->fetch_array($query);
|
||||
}
|
||||
|
||||
function fetch_all($sql, &$arr) {
|
||||
$query = $this->query($sql);
|
||||
while($data = $this->fetch_array($query)) {
|
||||
$arr[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
function cache_gc() {
|
||||
$this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time");
|
||||
}
|
||||
|
||||
function query($sql, $type = '', $cachetime = FALSE) {
|
||||
$func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query';
|
||||
if(!($query = $func($sql, $this->link)) && $type != 'SILENT') {
|
||||
$this->halt('SQL:', $sql);
|
||||
}
|
||||
$this->querynum++;
|
||||
$this->histories[] = $sql;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function affected_rows() {
|
||||
return mysql_affected_rows($this->link);
|
||||
}
|
||||
|
||||
function error() {
|
||||
return (($this->link) ? mysql_error($this->link) : mysql_error());
|
||||
}
|
||||
|
||||
function errno() {
|
||||
return intval(($this->link) ? mysql_errno($this->link) : mysql_errno());
|
||||
}
|
||||
|
||||
function result($query, $row) {
|
||||
$query = @mysql_result($query, $row);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_rows($query) {
|
||||
$query = mysql_num_rows($query);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_fields($query) {
|
||||
return mysql_num_fields($query);
|
||||
}
|
||||
|
||||
function free_result($query) {
|
||||
return mysql_free_result($query);
|
||||
}
|
||||
|
||||
function insert_id() {
|
||||
return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);
|
||||
}
|
||||
|
||||
function fetch_row($query) {
|
||||
$query = mysql_fetch_row($query);
|
||||
return $query;
|
||||
}
|
||||
|
||||
function fetch_fields($query) {
|
||||
return mysql_fetch_field($query);
|
||||
}
|
||||
|
||||
function version() {
|
||||
return mysql_get_server_info($this->link);
|
||||
}
|
||||
|
||||
function escape_string($str) {
|
||||
return mysql_escape_string($str);
|
||||
}
|
||||
|
||||
function close() {
|
||||
return mysql_close($this->link);
|
||||
}
|
||||
|
||||
function halt($message = '', $sql = '') {
|
||||
show_error('run_sql_error', $message.$sql.'<br /> Error:'.$this->error().'<br />Errno:'.$this->errno(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,139 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_mysql.php 6758 2010-03-25 09:05:10Z cnteacher $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class dbstuff {
|
||||
var $querynum = 0;
|
||||
var $link;
|
||||
var $histories;
|
||||
var $time;
|
||||
var $tablepre;
|
||||
|
||||
function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect = 0, $tablepre='', $time = 0) {
|
||||
$this->time = $time;
|
||||
$this->tablepre = $tablepre;
|
||||
$this->link = new mysqli();
|
||||
if(!$this->link->real_connect($dbhost, $dbuser, $dbpw, $dbname, null, null, MYSQLI_CLIENT_COMPRESS)) {
|
||||
$this->halt('Can not connect to MySQL server');
|
||||
}
|
||||
|
||||
if($this->version() > '4.1') {
|
||||
if($dbcharset) {
|
||||
$this->link->set_charset($dbcharset);
|
||||
}
|
||||
|
||||
if($this->version() > '5.0.1') {
|
||||
$this->query("SET sql_mode=''");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_array($query, $result_type = MYSQLI_ASSOC) {
|
||||
return $query ? $query->fetch_array($result_type) : null;
|
||||
}
|
||||
|
||||
function result_first($sql, &$data) {
|
||||
$query = $this->query($sql);
|
||||
$data = $this->result($query, 0);
|
||||
}
|
||||
|
||||
function fetch_first($sql, &$arr) {
|
||||
$query = $this->query($sql);
|
||||
$arr = $this->fetch_array($query);
|
||||
}
|
||||
|
||||
function fetch_all($sql, &$arr) {
|
||||
$query = $this->query($sql);
|
||||
while($data = $this->fetch_array($query)) {
|
||||
$arr[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
function cache_gc() {
|
||||
$this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time");
|
||||
}
|
||||
|
||||
function query($sql, $type = '', $cachetime = FALSE) {
|
||||
$resultmode = $type == 'UNBUFFERED' ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT;
|
||||
if(!($query = $this->link->query($sql, $resultmode)) && $type != 'SILENT') {
|
||||
$this->halt('SQL:', $sql);
|
||||
}
|
||||
$this->querynum++;
|
||||
$this->histories[] = $sql;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function affected_rows() {
|
||||
return $this->link->affected_rows;
|
||||
}
|
||||
|
||||
function error() {
|
||||
return (($this->link) ? $this->link->error : mysqli_error());
|
||||
}
|
||||
|
||||
function errno() {
|
||||
return intval(($this->link) ? $this->link->errno : mysqli_errno());
|
||||
}
|
||||
|
||||
function result($query, $row) {
|
||||
if(!$query || $query->num_rows == 0) {
|
||||
return null;
|
||||
}
|
||||
$query->data_seek($row);
|
||||
$assocs = $query->fetch_row();
|
||||
return $assocs[0];
|
||||
}
|
||||
|
||||
function num_rows($query) {
|
||||
$query = $query ? $query->num_rows : 0;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function num_fields($query) {
|
||||
return $query ? $query->field_count : 0;
|
||||
}
|
||||
|
||||
function free_result($query) {
|
||||
return $query ? $query->free() : false;
|
||||
}
|
||||
|
||||
function insert_id() {
|
||||
return ($id = $this->link->insert_id) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);
|
||||
}
|
||||
|
||||
function fetch_row($query) {
|
||||
$query = $query ? $query->fetch_row() : null;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function fetch_fields($query) {
|
||||
return $query ? $query->fetch_field() : null;
|
||||
}
|
||||
|
||||
function version() {
|
||||
return $this->link->server_info;
|
||||
}
|
||||
|
||||
function escape_string($str) {
|
||||
return $this->link->escape_string($str);
|
||||
}
|
||||
|
||||
function close() {
|
||||
return $this->link->close();
|
||||
}
|
||||
|
||||
function halt($message = '', $sql = '') {
|
||||
show_error('run_sql_error', $message.$sql.'<br /> Error:'.$this->error().'<br />Errno:'.$this->errno(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_plugin.php 32877 2013-03-19 03:48:10Z liulanbo $
|
||||
*/
|
||||
|
||||
define('IN_COMSENZ', TRUE);
|
||||
define('IN_ADMINCP', TRUE);
|
||||
|
||||
chdir('../../');
|
||||
|
||||
require_once './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_session = false;
|
||||
$discuz->init();
|
||||
|
||||
if($_GET['key'] !== md5($_G['setting']['authkey'].$_SERVER['REMOTE_ADDR'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'cloudsearch', 'qqgroup', 'security', 'xf_storage', 'pcmgr_url_safeguard');
|
||||
|
||||
require_once libfile('function/plugin');
|
||||
require_once libfile('function/admincp');
|
||||
require_once libfile('function/cache');
|
||||
|
||||
foreach($plugins as $pluginid) {
|
||||
$importfile = DISCUZ_ROOT.'./source/plugin/'.$pluginid.'/discuz_plugin_'.$pluginid.'.xml';
|
||||
$importtxt = @implode('', file($importfile));
|
||||
$pluginarray = getimportdata('Discuz! Plugin', $importtxt);
|
||||
if(plugininstall($pluginarray)) {
|
||||
if(!empty($pluginarray['installfile']) && file_exists(DISCUZ_ROOT.'./source/plugin/'.$pluginid.'/'.$pluginarray['installfile'])) {
|
||||
@include_once DISCUZ_ROOT.'./source/plugin/'.$pluginid.'/'.$pluginarray['installfile'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,424 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_var.php 36287 2016-12-12 03:59:05Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('SOFT_NAME', 'Discuz!');
|
||||
|
||||
define('INSTALL_LANG', 'SC_UTF8');
|
||||
|
||||
define('CONFIG', './config/config_global.php');
|
||||
define('CONFIG_UC', './config/config_ucenter.php');
|
||||
|
||||
$sqlfile = ROOT_PATH.((file_exists(ROOT_PATH.'./install/data/install_dev.sql')) ? './install/data/install_dev.sql' : './install/data/install.sql');
|
||||
$lockfile = ROOT_PATH.'./data/install.lock';
|
||||
|
||||
@include ROOT_PATH.CONFIG;
|
||||
|
||||
define('CHARSET', 'utf-8');
|
||||
define('DBCHARSET', 'utf8');
|
||||
|
||||
define('ORIG_TABLEPRE', 'pre_');
|
||||
|
||||
define('METHOD_UNDEFINED', 255);
|
||||
define('ENV_CHECK_RIGHT', 0);
|
||||
define('ERROR_CONFIG_VARS', 1);
|
||||
define('SHORT_OPEN_TAG_INVALID', 2);
|
||||
define('INSTALL_LOCKED', 3);
|
||||
define('DATABASE_NONEXISTENCE', 4);
|
||||
define('PHP_VERSION_TOO_LOW', 5);
|
||||
define('MYSQL_VERSION_TOO_LOW', 6);
|
||||
define('UC_URL_INVALID', 7);
|
||||
define('UC_DNS_ERROR', 8);
|
||||
define('UC_URL_UNREACHABLE', 9);
|
||||
define('UC_VERSION_INCORRECT', 10);
|
||||
define('UC_DBCHARSET_INCORRECT', 11);
|
||||
define('UC_API_ADD_APP_ERROR', 12);
|
||||
define('UC_ADMIN_INVALID', 13);
|
||||
define('UC_DATA_INVALID', 14);
|
||||
define('DBNAME_INVALID', 15);
|
||||
define('DATABASE_ERRNO_2003', 16);
|
||||
define('DATABASE_ERRNO_1044', 17);
|
||||
define('DATABASE_ERRNO_1045', 18);
|
||||
define('DATABASE_CONNECT_ERROR', 19);
|
||||
define('TABLEPRE_INVALID', 20);
|
||||
define('CONFIG_UNWRITEABLE', 21);
|
||||
define('ADMIN_USERNAME_INVALID', 22);
|
||||
define('ADMIN_EMAIL_INVALID', 25);
|
||||
define('ADMIN_EXIST_PASSWORD_ERROR', 26);
|
||||
define('ADMININFO_INVALID', 27);
|
||||
define('LOCKFILE_NO_EXISTS', 28);
|
||||
define('TABLEPRE_EXISTS', 29);
|
||||
define('ERROR_UNKNOW_TYPE', 30);
|
||||
define('ENV_CHECK_ERROR', 31);
|
||||
define('UNDEFINE_FUNC', 32);
|
||||
define('MISSING_PARAMETER', 33);
|
||||
define('LOCK_FILE_NOT_TOUCH', 34);
|
||||
|
||||
$func_items = array(function_exists('mysql_connect') ? 'mysql_connect' : 'mysqli_connect', 'gethostbyname', 'file_get_contents', 'xml_parser_create');
|
||||
|
||||
$filesock_items = array('fsockopen', 'pfsockopen', 'stream_socket_client', 'curl_init');
|
||||
|
||||
$env_items = array
|
||||
(
|
||||
'os' => array('c' => 'PHP_OS', 'r' => 'notset', 'b' => 'unix'),
|
||||
'php' => array('c' => 'PHP_VERSION', 'r' => '5.2', 'b' => '7.0'),
|
||||
'attachmentupload' => array('r' => 'notset', 'b' => '2M'),
|
||||
'gdversion' => array('r' => '1.0', 'b' => '2.0'),
|
||||
'curl' => array('r' => 'notset', 'b' => 'enable'),
|
||||
'opcache' => array('r' => 'notset', 'b' => 'enable'),
|
||||
'diskspace' => array('r' => '30MB', 'b' => 'notset'),
|
||||
);
|
||||
|
||||
$dirfile_items = array
|
||||
(
|
||||
|
||||
'config' => array('type' => 'file', 'path' => CONFIG),
|
||||
'ucenter config' => array('type' => 'file', 'path' => CONFIG_UC),
|
||||
'config_dir' => array('type' => 'dir', 'path' => './config'),
|
||||
'data' => array('type' => 'dir', 'path' => './data'),
|
||||
'cache' => array('type' => 'dir', 'path' => './data/cache'),
|
||||
'avatar' => array('type' => 'dir', 'path' => './data/avatar'),
|
||||
'plugindata' => array('type' => 'dir', 'path' => './data/plugindata'),
|
||||
'plugindownload' => array('type' => 'dir', 'path' => './data/download'),
|
||||
'addonmd5' => array('type' => 'dir', 'path' => './data/addonmd5'),
|
||||
'ftemplates' => array('type' => 'dir', 'path' => './data/template'),
|
||||
'threadcache' => array('type' => 'dir', 'path' => './data/threadcache'),
|
||||
'attach' => array('type' => 'dir', 'path' => './data/attachment'),
|
||||
'attach_album' => array('type' => 'dir', 'path' => './data/attachment/album'),
|
||||
'attach_forum' => array('type' => 'dir', 'path' => './data/attachment/forum'),
|
||||
'attach_group' => array('type' => 'dir', 'path' => './data/attachment/group'),
|
||||
|
||||
'logs' => array('type' => 'dir', 'path' => './data/log'),
|
||||
'uccache' => array('type' => 'dir', 'path' => './uc_client/data/cache'),
|
||||
|
||||
'uc_server_data' => array('type' => 'dir', 'path' => './uc_server/data/'),
|
||||
'uc_server_data_cache' => array('type' => 'dir', 'path' => './uc_server/data/cache'),
|
||||
'uc_server_data_avatar' => array('type' => 'dir', 'path' => './uc_server/data/avatar'),
|
||||
'uc_server_data_backup' => array('type' => 'dir', 'path' => './uc_server/data/backup'),
|
||||
'uc_server_data_logs' => array('type' => 'dir', 'path' => './uc_server/data/logs'),
|
||||
'uc_server_data_tmp' => array('type' => 'dir', 'path' => './uc_server/data/tmp'),
|
||||
'uc_server_data_view' => array('type' => 'dir', 'path' => './uc_server/data/view'),
|
||||
);
|
||||
|
||||
|
||||
$form_app_reg_items = array
|
||||
(
|
||||
'ucenter' => array
|
||||
(
|
||||
'ucurl' => array('type' => 'text', 'required' => 1, 'reg' => '/^https?:\/\//', 'value' => array('type' => 'var', 'var' => 'ucapi')),
|
||||
'ucip' => array('type' => 'text', 'required' => 0, 'reg' => '/^\d+\.\d+\.\d+\.\d+$/'),
|
||||
'ucpw' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/')
|
||||
),
|
||||
'siteinfo' => array
|
||||
(
|
||||
'sitename' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'constant', 'var' => 'SOFT_NAME')),
|
||||
'siteurl' => array('type' => 'text', 'required' => 1, 'reg' => '/^https?:\/\//', 'value' => array('type' => 'var', 'var' => 'default_appurl'))
|
||||
)
|
||||
);
|
||||
|
||||
$form_db_init_items = array
|
||||
(
|
||||
'dbinfo' => array
|
||||
(
|
||||
'dbhost' => array('type' => 'text', 'required' => 1, 'reg' => '/^.+$/', 'value' => array('type' => 'var', 'var' => 'dbhost')),
|
||||
'dbname' => array('type' => 'text', 'required' => 1, 'reg' => '/^.+$/', 'value' => array('type' => 'var', 'var' => 'dbname')),
|
||||
'dbuser' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/', 'value' => array('type' => 'var', 'var' => 'dbuser')),
|
||||
'dbpw' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*$/', 'value' => array('type' => 'var', 'var' => 'dbpw')),
|
||||
'tablepre' => array('type' => 'text', 'required' => 0, 'reg' => '/^.*+/', 'value' => array('type' => 'var', 'var' => 'tablepre')),
|
||||
'adminemail' => array('type' => 'text', 'required' => 1, 'reg' => '/@/', 'value' => array('type' => 'var', 'var' => 'adminemail')),
|
||||
),
|
||||
'admininfo' => array
|
||||
(
|
||||
'username' => array('type' => 'text', 'required' => 1, 'reg' => '/^.*$/', 'value' => array('type' => 'constant', 'var' => 'admin')),
|
||||
'password' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'),
|
||||
'password2' => array('type' => 'password', 'required' => 1, 'reg' => '/^.*$/'),
|
||||
'email' => array('type' => 'text', 'required' => 1, 'reg' => '/@/', 'value' => array('type' => 'var', 'var' => 'adminemail')),
|
||||
)
|
||||
);
|
||||
|
||||
$serialize_sql_setting = array (
|
||||
'extcredits' =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '威望',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => '1',
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '金钱',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => '1',
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '贡献',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => '1',
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => NULL,
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => NULL,
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
6 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => NULL,
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
7 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => NULL,
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
8 =>
|
||||
array (
|
||||
'img' => '',
|
||||
'title' => '',
|
||||
'unit' => '',
|
||||
'ratio' => 0,
|
||||
'available' => NULL,
|
||||
'showinthread' => NULL,
|
||||
'allowexchangein' => NULL,
|
||||
'allowexchangeout' => NULL,
|
||||
),
|
||||
),
|
||||
'postnocustom' =>
|
||||
array (
|
||||
0 => '楼主',
|
||||
1 => '沙发',
|
||||
2 => '板凳',
|
||||
3 => '地板',
|
||||
),
|
||||
'recommendthread' =>
|
||||
array (
|
||||
'status' => '0',
|
||||
'addtext' => '支持',
|
||||
'subtracttext' => '反对',
|
||||
'defaultshow' => '1',
|
||||
'daycount' => '0',
|
||||
'ownthread' => '0',
|
||||
'iconlevels' => '50,100,200',
|
||||
),
|
||||
'seotitle' =>
|
||||
array (
|
||||
'portal' => '门户',
|
||||
'forum' => '论坛',
|
||||
'group' => '群组',
|
||||
'home' => '家园',
|
||||
'userapp' => '应用',
|
||||
),
|
||||
'activityfield' =>
|
||||
array (
|
||||
'realname' => '真实姓名',
|
||||
'mobile' => '手机',
|
||||
'qq' => 'QQ号',
|
||||
),
|
||||
'article_tags' =>
|
||||
array (
|
||||
1 => '原创',
|
||||
2 => '热点',
|
||||
3 => '组图',
|
||||
4 => '爆料',
|
||||
5 => '头条',
|
||||
6 => '幻灯',
|
||||
7 => '滚动',
|
||||
8 => '推荐',
|
||||
),
|
||||
'verify' =>
|
||||
array (
|
||||
6 =>
|
||||
array (
|
||||
'title' => '实名认证',
|
||||
'available' => '0',
|
||||
'showicon' => '0',
|
||||
'viewrealname' => '0',
|
||||
'field' =>
|
||||
array (
|
||||
'realname' => 'realname',
|
||||
),
|
||||
'icon' => false,
|
||||
),
|
||||
'enabled' => false,
|
||||
1 =>
|
||||
array (
|
||||
'icon' => '',
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'icon' => '',
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
'icon' => '',
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
'icon' => '',
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
'icon' => '',
|
||||
),
|
||||
7 =>
|
||||
array (
|
||||
'title' => '视频认证',
|
||||
'available' => '0',
|
||||
'showicon' => '0',
|
||||
'viewvideophoto' => '0',
|
||||
'icon' => '',
|
||||
),
|
||||
),
|
||||
'focus' =>
|
||||
array (
|
||||
'title' => '站长推荐',
|
||||
'data' =>
|
||||
array (
|
||||
),
|
||||
'cookie' => '1',
|
||||
),
|
||||
'profilegroup' =>
|
||||
array (
|
||||
'base' =>
|
||||
array (
|
||||
'available' => 1,
|
||||
'displayorder' => 0,
|
||||
'title' => '基本资料',
|
||||
'field' =>
|
||||
array (
|
||||
'realname' => 'realname',
|
||||
'gender' => 'gender',
|
||||
'birthday' => 'birthday',
|
||||
'birthcity' => 'birthcity',
|
||||
'residecity' => 'residecity',
|
||||
'residedist' => 'residedist',
|
||||
'affectivestatus' => 'affectivestatus',
|
||||
'lookingfor' => 'lookingfor',
|
||||
'bloodtype' => 'bloodtype',
|
||||
'field1' => 'field1',
|
||||
'field2' => 'field2',
|
||||
'field3' => 'field3',
|
||||
'field4' => 'field4',
|
||||
'field5' => 'field5',
|
||||
'field6' => 'field6',
|
||||
'field7' => 'field7',
|
||||
'field8' => 'field8',
|
||||
),
|
||||
),
|
||||
'contact' =>
|
||||
array (
|
||||
'title' => '联系方式',
|
||||
'available' => '1',
|
||||
'displayorder' => '1',
|
||||
'field' =>
|
||||
array (
|
||||
'telephone' => 'telephone',
|
||||
'mobile' => 'mobile',
|
||||
'icq' => 'icq',
|
||||
'qq' => 'qq',
|
||||
'yahoo' => 'yahoo',
|
||||
'msn' => 'msn',
|
||||
'taobao' => 'taobao',
|
||||
),
|
||||
),
|
||||
'edu' =>
|
||||
array (
|
||||
'available' => 1,
|
||||
'displayorder' => 2,
|
||||
'title' => '教育情况',
|
||||
'field' =>
|
||||
array (
|
||||
'graduateschool' => 'graduateschool',
|
||||
'education' => 'education',
|
||||
),
|
||||
),
|
||||
'work' =>
|
||||
array (
|
||||
'available' => 1,
|
||||
'displayorder' => 3,
|
||||
'title' => '工作情况',
|
||||
'field' =>
|
||||
array (
|
||||
'occupation' => 'occupation',
|
||||
'company' => 'company',
|
||||
'position' => 'position',
|
||||
'revenue' => 'revenue',
|
||||
),
|
||||
),
|
||||
'info' =>
|
||||
array (
|
||||
'title' => '个人信息',
|
||||
'available' => '1',
|
||||
'displayorder' => '4',
|
||||
'field' =>
|
||||
array (
|
||||
'idcardtype' => 'idcardtype',
|
||||
'idcard' => 'idcard',
|
||||
'address' => 'address',
|
||||
'zipcode' => 'zipcode',
|
||||
'site' => 'site',
|
||||
'bio' => 'bio',
|
||||
'interest' => 'interest',
|
||||
'sightml' => 'sightml',
|
||||
'customstatus' => 'customstatus',
|
||||
'timeoffset' => 'timeoffset',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
|
@ -0,0 +1,508 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: index.php 22348 2011-05-04 01:16:02Z monkey $
|
||||
*/
|
||||
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
@set_time_limit(1000);
|
||||
|
||||
if(function_exists('set_magic_quotes_runtime')) {
|
||||
@set_magic_quotes_runtime(0);
|
||||
}
|
||||
|
||||
define('IN_DISCUZ', TRUE);
|
||||
define('IN_COMSENZ', TRUE);
|
||||
define('ROOT_PATH', dirname(__FILE__).'/../');
|
||||
|
||||
require ROOT_PATH.'./source/discuz_version.php';
|
||||
require ROOT_PATH.'./install/include/install_var.php';
|
||||
if(function_exists('mysql_connect')) {
|
||||
require ROOT_PATH.'./install/include/install_mysql.php';
|
||||
} else {
|
||||
require ROOT_PATH.'./install/include/install_mysqli.php';
|
||||
}
|
||||
require ROOT_PATH.'./install/include/install_function.php';
|
||||
require ROOT_PATH.'./install/include/install_lang.php';
|
||||
|
||||
$view_off = getgpc('view_off');
|
||||
|
||||
define('VIEW_OFF', $view_off ? TRUE : FALSE);
|
||||
|
||||
$allow_method = array('show_license', 'env_check', 'app_reg', 'db_init', 'ext_info', 'install_check', 'tablepre_check');
|
||||
|
||||
$step = intval(getgpc('step', 'R')) ? intval(getgpc('step', 'R')) : 0;
|
||||
$method = getgpc('method');
|
||||
|
||||
header('Content-Type: text/html; charset='.CHARSET);
|
||||
|
||||
if(empty($method) || !in_array($method, $allow_method)) {
|
||||
$method = isset($allow_method[$step]) ? $allow_method[$step] : '';
|
||||
}
|
||||
|
||||
if(empty($method)) {
|
||||
show_msg('method_undefined', $method, 0);
|
||||
}
|
||||
|
||||
if(file_exists($lockfile) && $method != 'ext_info') {
|
||||
show_msg('install_locked', '', 0);
|
||||
} elseif(!class_exists('dbstuff')) {
|
||||
show_msg('database_nonexistence', '', 0);
|
||||
}
|
||||
|
||||
timezone_set();
|
||||
|
||||
$uchidden = getgpc('uchidden');
|
||||
|
||||
if(in_array($method, array('app_reg', 'ext_info'))) {
|
||||
$isHTTPS = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||
$bbserver = 'http'.($isHTTPS ? 's' : '').'://'.preg_replace("/\:\d+/", '', $_SERVER['HTTP_HOST']).($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 ? ':'.$_SERVER['SERVER_PORT'] : '');
|
||||
$default_ucapi = $bbserver.'/ucenter';
|
||||
$default_appurl = $bbserver.substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') - 8);
|
||||
}
|
||||
|
||||
if($method == 'show_license') {
|
||||
|
||||
transfer_ucinfo($_POST);
|
||||
show_license();
|
||||
|
||||
} elseif($method == 'env_check') {
|
||||
|
||||
VIEW_OFF && function_check($func_items);
|
||||
|
||||
env_check($env_items);
|
||||
|
||||
dirfile_check($dirfile_items);
|
||||
|
||||
show_env_result($env_items, $dirfile_items, $func_items, $filesock_items);
|
||||
|
||||
} elseif($method == 'app_reg') {
|
||||
|
||||
@include ROOT_PATH.CONFIG;
|
||||
@include ROOT_PATH.CONFIG_UC;
|
||||
if(!defined('UC_API')) {
|
||||
define('UC_API', '');
|
||||
}
|
||||
if(getgpc('install_ucenter') == 'yes') {
|
||||
header("Location: index.php?step=3&install_ucenter=yes");
|
||||
die;
|
||||
}
|
||||
$submit = true;
|
||||
$error_msg = array();
|
||||
if(isset($form_app_reg_items) && is_array($form_app_reg_items)) {
|
||||
foreach($form_app_reg_items as $key => $items) {
|
||||
$$key = getgpc($key, 'p');
|
||||
if(!isset($$key) || !is_array($$key)) {
|
||||
$submit = false;
|
||||
break;
|
||||
}
|
||||
foreach($items as $k => $v) {
|
||||
$tmp = $$key;
|
||||
$$k = $tmp[$k];
|
||||
if(empty($$k) || !preg_match($v['reg'], $$k)) {
|
||||
if(empty($$k) && !$v['required']) {
|
||||
continue;
|
||||
}
|
||||
$submit = false;
|
||||
VIEW_OFF or $error_msg[$key][$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$submit = false;
|
||||
}
|
||||
|
||||
$ucapi = defined('UC_API') && UC_API ? UC_API : $default_ucapi;
|
||||
|
||||
if($submit) {
|
||||
|
||||
$app_type = 'DISCUZX'; // Only For Discuz!
|
||||
|
||||
$app_name = $sitename ? $sitename : SOFT_NAME;
|
||||
$app_url = $siteurl ? $siteurl : $default_appurl;
|
||||
|
||||
$ucapi = $ucurl ? $ucurl : (defined('UC_API') && UC_API ? UC_API : $default_ucapi);
|
||||
$ucip = isset($ucip) ? $ucip : '';
|
||||
$ucfounderpw = $ucpw;
|
||||
$app_tagtemplates = 'apptagtemplates[template]='.urlencode('<a href="{url}" target="_blank">{subject}</a>').'&'.
|
||||
'apptagtemplates[fields][subject]='.urlencode($lang['tagtemplates_subject']).'&'.
|
||||
'apptagtemplates[fields][uid]='.urlencode($lang['tagtemplates_uid']).'&'.
|
||||
'apptagtemplates[fields][username]='.urlencode($lang['tagtemplates_username']).'&'.
|
||||
'apptagtemplates[fields][dateline]='.urlencode($lang['tagtemplates_dateline']).'&'.
|
||||
'apptagtemplates[fields][url]='.urlencode($lang['tagtemplates_url']);
|
||||
|
||||
$ucapi = preg_replace("/\/$/", '', trim($ucapi));
|
||||
if(empty($ucapi) || !preg_match("/^(http:\/\/)/i", $ucapi)) {
|
||||
show_msg('uc_url_invalid', $ucapi, 0);
|
||||
} else {
|
||||
if(!$ucip) {
|
||||
$temp = @parse_url($ucapi);
|
||||
$ucip = gethostbyname($temp['host']);
|
||||
if(ip2long($ucip) == -1 || ip2long($ucip) === FALSE) {
|
||||
show_msg('uc_dns_error', $ucapi, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
include_once ROOT_PATH.'./uc_client/client.php';
|
||||
|
||||
$ucinfo = dfopen($ucapi.'/index.php?m=app&a=ucinfo&release='.UC_CLIENT_RELEASE, 500, '', '', 1, $ucip);
|
||||
list($status, $ucversion, $ucrelease, $uccharset, $ucdbcharset, $apptypes) = explode('|', $ucinfo);
|
||||
if($status != 'UC_STATUS_OK') {
|
||||
show_msg('uc_url_unreachable', $ucapi, 0);
|
||||
} else {
|
||||
$dbcharset = strtolower($dbcharset ? str_replace('-', '', $dbcharset) : $dbcharset);
|
||||
$ucdbcharset = strtolower($ucdbcharset ? str_replace('-', '', $ucdbcharset) : $ucdbcharset);
|
||||
if(UC_CLIENT_VERSION > $ucversion) {
|
||||
show_msg('uc_version_incorrect', $ucversion, 0);
|
||||
} elseif($dbcharset && $ucdbcharset != $dbcharset) {
|
||||
show_msg('uc_dbcharset_incorrect', '', 0);
|
||||
}
|
||||
|
||||
$postdata = "m=app&a=add&ucfounder=&ucfounderpw=".urlencode($ucpw)."&apptype=".urlencode($app_type)."&appname=".urlencode($app_name)."&appurl=".urlencode($app_url)."&appip=&appcharset=".CHARSET.'&appdbcharset='.DBCHARSET.'&'.$app_tagtemplates.'&release='.UC_CLIENT_RELEASE;
|
||||
$ucconfig = dfopen($ucapi.'/index.php', 500, $postdata, '', 1, $ucip);
|
||||
if(empty($ucconfig)) {
|
||||
show_msg('uc_api_add_app_error', $ucapi, 0);
|
||||
} elseif($ucconfig == '-1') {
|
||||
show_msg('uc_admin_invalid', '', 0);
|
||||
} else {
|
||||
list($appauthkey, $appid) = explode('|', $ucconfig);
|
||||
$ucconfig_array = explode('|', $ucconfig);
|
||||
$ucconfig_array[] = $ucapi;
|
||||
$ucconfig_array[] = $ucip;
|
||||
if(empty($appauthkey) || empty($appid)) {
|
||||
show_msg('uc_data_invalid', '', 0);
|
||||
} elseif($succeed = save_uc_config($ucconfig_array, ROOT_PATH.CONFIG_UC)) {
|
||||
if(VIEW_OFF) {
|
||||
show_msg('app_reg_success');
|
||||
} else {
|
||||
$step = $step + 1;
|
||||
header("Location: index.php?step=$step");
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
show_msg('config_unwriteable', '', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(VIEW_OFF) {
|
||||
|
||||
show_msg('missing_parameter', '', 0);
|
||||
|
||||
} else {
|
||||
|
||||
show_form($form_app_reg_items, $error_msg);
|
||||
|
||||
}
|
||||
|
||||
} elseif($method == 'db_init') {
|
||||
|
||||
if(getgpc('install_ucenter') == 'yes') {
|
||||
define('DZUCFULL', true);
|
||||
} else {
|
||||
define('DZUCFULL', false);
|
||||
}
|
||||
|
||||
$submit = true;
|
||||
|
||||
$default_config = $_config = array();
|
||||
$default_configfile = './config/config_global_default.php';
|
||||
|
||||
if(!file_exists(ROOT_PATH.$default_configfile)) {
|
||||
exit('config_global_default.php was lost, please reupload this file.');
|
||||
} else {
|
||||
include ROOT_PATH.$default_configfile;
|
||||
$default_config = $_config;
|
||||
}
|
||||
|
||||
if(file_exists(ROOT_PATH.CONFIG)) {
|
||||
include ROOT_PATH.CONFIG;
|
||||
} else {
|
||||
$_config = $default_config;
|
||||
}
|
||||
|
||||
$dbhost = $_config['db'][1]['dbhost'];
|
||||
$dbname = $_config['db'][1]['dbname'];
|
||||
$dbpw = $_config['db'][1]['dbpw'];
|
||||
$dbuser = $_config['db'][1]['dbuser'];
|
||||
$tablepre = $_config['db'][1]['tablepre'];
|
||||
|
||||
$adminemail = 'admin@admin.com';
|
||||
|
||||
$error_msg = array();
|
||||
if(isset($form_db_init_items) && is_array($form_db_init_items)) {
|
||||
foreach($form_db_init_items as $key => $items) {
|
||||
$$key = getgpc($key, 'p');
|
||||
if(!isset($$key) || !is_array($$key)) {
|
||||
$submit = false;
|
||||
break;
|
||||
}
|
||||
foreach($items as $k => $v) {
|
||||
$tmp = $$key;
|
||||
$$k = $tmp[$k];
|
||||
if(empty($$k) || !preg_match($v['reg'], $$k)) {
|
||||
if(empty($$k) && !$v['required']) {
|
||||
continue;
|
||||
}
|
||||
$submit = false;
|
||||
VIEW_OFF or $error_msg[$key][$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$submit = false;
|
||||
}
|
||||
|
||||
if($submit && !VIEW_OFF && $_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if($password != $password2) {
|
||||
$error_msg['admininfo']['password2'] = 1;
|
||||
$submit = false;
|
||||
}
|
||||
$forceinstall = isset($_POST['dbinfo']['forceinstall']) ? $_POST['dbinfo']['forceinstall'] : '';
|
||||
$dbname_not_exists = true;
|
||||
if(!empty($dbhost) && empty($forceinstall)) {
|
||||
$dbname_not_exists = check_db($dbhost, $dbuser, $dbpw, $dbname, $tablepre);
|
||||
if(!$dbname_not_exists) {
|
||||
$form_db_init_items['dbinfo']['forceinstall'] = array('type' => 'checkbox', 'required' => 0, 'reg' => '/^.*+/');
|
||||
$error_msg['dbinfo']['forceinstall'] = 1;
|
||||
$submit = false;
|
||||
$dbname_not_exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($submit) {
|
||||
|
||||
$step = $step + 1;
|
||||
if(empty($dbname)) {
|
||||
show_msg('dbname_invalid', $dbname, 0);
|
||||
} else {
|
||||
$mysqlmode = function_exists("mysql_connect") ? 'mysql' : 'mysqli';
|
||||
$link = ($mysqlmode == 'mysql') ? @mysql_connect($dbhost, $dbuser, $dbpw) : new mysqli($dbhost, $dbuser, $dbpw);
|
||||
if(!$link) {
|
||||
$errno = ($mysqlmode == 'mysql') ? mysql_errno($link) : $link->errno;
|
||||
$error = ($mysqlmode == 'mysql') ? mysql_error($link) : $link->error;
|
||||
if($errno == 1045) {
|
||||
show_msg('database_errno_1045', $error, 0);
|
||||
} elseif($errno == 2003) {
|
||||
show_msg('database_errno_2003', $error, 0);
|
||||
} else {
|
||||
show_msg('database_connect_error', $error, 0);
|
||||
}
|
||||
}
|
||||
$mysql_version = ($mysqlmode == 'mysql') ? mysql_get_server_info() : $link->server_info;
|
||||
if($mysql_version > '4.1') {
|
||||
if($mysqlmode == 'mysql') {
|
||||
mysql_query("CREATE DATABASE IF NOT EXISTS `$dbname` DEFAULT CHARACTER SET ".DBCHARSET, $link);
|
||||
} else {
|
||||
$link->query("CREATE DATABASE IF NOT EXISTS `$dbname` DEFAULT CHARACTER SET ".DBCHARSET);
|
||||
}
|
||||
} else {
|
||||
if($mysqlmode == 'mysql') {
|
||||
mysql_query("CREATE DATABASE IF NOT EXISTS `$dbname`", $link);
|
||||
} else {
|
||||
$link->query("CREATE DATABASE IF NOT EXISTS `$dbname`");
|
||||
}
|
||||
}
|
||||
|
||||
if(($mysqlmode == 'mysql') ? mysql_errno($link) : $link->errno) {
|
||||
show_msg('database_errno_1044', ($mysqlmode == 'mysql') ? mysql_error($link) : $link->error, 0);
|
||||
}
|
||||
if($mysqlmode == 'mysql') {
|
||||
mysql_close($link);
|
||||
} else {
|
||||
$link->close();
|
||||
}
|
||||
}
|
||||
|
||||
if(strpos($tablepre, '.') !== false || intval($tablepre{0})) {
|
||||
show_msg('tablepre_invalid', $tablepre, 0);
|
||||
}
|
||||
|
||||
if($username && $email && $password) {
|
||||
if(strlen($username) > 15 || preg_match("/^$|^c:\\con\\con$| |[,\"\s\t\<\>&]|^Guest/is", $username)) {
|
||||
show_msg('admin_username_invalid', $username, 0);
|
||||
} elseif(!strstr($email, '@') || $email != stripslashes($email) || $email != dhtmlspecialchars($email)) {
|
||||
show_msg('admin_email_invalid', $email, 0);
|
||||
} else {
|
||||
if(!DZUCFULL) {
|
||||
$adminuser = check_adminuser($username, $password, $email);
|
||||
if($adminuser['uid'] < 1) {
|
||||
show_msg($adminuser['error'], '', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
show_msg('admininfo_invalid', '', 0);
|
||||
}
|
||||
|
||||
|
||||
$uid = DZUCFULL ? 1 : $adminuser['uid'];
|
||||
$authkey = substr(md5($_SERVER['SERVER_ADDR'].$_SERVER['HTTP_USER_AGENT'].$dbhost.$dbuser.$dbpw.$dbname.$username.$password.$pconnect.substr($timestamp, 0, 6)), 8, 6).random(10);
|
||||
$_config['db'][1]['dbhost'] = $dbhost;
|
||||
$_config['db'][1]['dbname'] = $dbname;
|
||||
$_config['db'][1]['dbpw'] = $dbpw;
|
||||
$_config['db'][1]['dbuser'] = $dbuser;
|
||||
$_config['db'][1]['tablepre'] = $tablepre;
|
||||
$_config['admincp']['founder'] = (string)$uid;
|
||||
$_config['security']['authkey'] = $authkey;
|
||||
$_config['cookie']['cookiepre'] = random(4).'_';
|
||||
$_config['memory']['prefix'] = random(6).'_';
|
||||
|
||||
save_config_file(ROOT_PATH.CONFIG, $_config, $default_config);
|
||||
|
||||
$db = new dbstuff;
|
||||
|
||||
$db->connect($dbhost, $dbuser, $dbpw, $dbname, DBCHARSET);
|
||||
|
||||
if(!VIEW_OFF) {
|
||||
show_header();
|
||||
show_install();
|
||||
}
|
||||
|
||||
if(DZUCFULL) {
|
||||
install_uc_server();
|
||||
}
|
||||
|
||||
$sql = file_get_contents($sqlfile);
|
||||
$sql = str_replace("\r\n", "\n", $sql);
|
||||
|
||||
runquery($sql);
|
||||
runquery($extrasql);
|
||||
|
||||
$sql = file_get_contents(ROOT_PATH.'./install/data/install_data.sql');
|
||||
$sql = str_replace("\r\n", "\n", $sql);
|
||||
runquery($sql);
|
||||
|
||||
$onlineip = $_SERVER['REMOTE_ADDR'];
|
||||
$timestamp = time();
|
||||
$backupdir = substr(md5($_SERVER['SERVER_ADDR'].$_SERVER['HTTP_USER_AGENT'].substr($timestamp, 0, 4)), 8, 6);
|
||||
$ret = false;
|
||||
if(is_dir(ROOT_PATH.'data/backup')) {
|
||||
$ret = @rename(ROOT_PATH.'data/backup', ROOT_PATH.'data/backup_'.$backupdir);
|
||||
}
|
||||
if(!$ret) {
|
||||
@mkdir(ROOT_PATH.'data/backup_'.$backupdir, 0777);
|
||||
}
|
||||
if(is_dir(ROOT_PATH.'data/backup_'.$backupdir)) {
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('backupdir', '$backupdir')");
|
||||
}
|
||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
|
||||
$siteuniqueid = 'DX'.$chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($onlineip.$timestamp), 0, 4).random(4);
|
||||
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('authkey', '$authkey')");
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('siteuniqueid', '$siteuniqueid')");
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('adminemail', '$email')");
|
||||
|
||||
install_extra_setting();
|
||||
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('backupdir', '".$backupdir."')");
|
||||
|
||||
$password = md5(random(10));
|
||||
|
||||
$db->query("REPLACE INTO {$tablepre}common_member (uid, username, password, adminid, groupid, email, regdate) VALUES ('$uid', '$username', '$password', '1', '1', '$email', '".time()."');");
|
||||
|
||||
$notifyusers = addslashes('a:1:{i:1;a:2:{s:8:"username";s:'.strlen($username).':"'.$username.'";s:5:"types";s:20:"11111111111111111111";}}');
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('notifyusers', '$notifyusers')");
|
||||
|
||||
$db->query("UPDATE {$tablepre}common_cron SET lastrun='0', nextrun='".($timestamp + 3600)."'");
|
||||
|
||||
install_data($username, $uid);
|
||||
|
||||
$testdata = $portalstatus = 1;
|
||||
$groupstatus = $homestatus = 0;
|
||||
|
||||
if($testdata) {
|
||||
install_testdata($username, $uid);
|
||||
}
|
||||
|
||||
if(!$portalstatus) {
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('portalstatus', '0')");
|
||||
}
|
||||
|
||||
if(!$groupstatus) {
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('groupstatus', '0')");
|
||||
}
|
||||
|
||||
if(!$homestatus) {
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('homestatus', '0')");
|
||||
}
|
||||
$yearmonth = date('Ym_', time());
|
||||
loginit($yearmonth.'ratelog');
|
||||
loginit($yearmonth.'illegallog');
|
||||
loginit($yearmonth.'modslog');
|
||||
loginit($yearmonth.'cplog');
|
||||
loginit($yearmonth.'errorlog');
|
||||
loginit($yearmonth.'banlog');
|
||||
|
||||
dir_clear(ROOT_PATH.'./data/template');
|
||||
dir_clear(ROOT_PATH.'./data/cache');
|
||||
dir_clear(ROOT_PATH.'./data/threadcache');
|
||||
dir_clear(ROOT_PATH.'./uc_client/data');
|
||||
dir_clear(ROOT_PATH.'./uc_client/data/cache');
|
||||
|
||||
foreach($serialize_sql_setting as $k => $v) {
|
||||
$v = addslashes(serialize($v));
|
||||
$db->query("REPLACE INTO {$tablepre}common_setting VALUES ('$k', '$v')");
|
||||
}
|
||||
|
||||
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}common_member");
|
||||
$totalmembers = $db->result($query, 0);
|
||||
$userstats = array('totalmembers' => $totalmembers, 'newsetuser' => $username);
|
||||
$ctype = 1;
|
||||
$data = addslashes(serialize($userstats));
|
||||
$db->query("REPLACE INTO {$tablepre}common_syscache (cname, ctype, dateline, data) VALUES ('userstats', '$ctype', '".time()."', '$data')");
|
||||
|
||||
VIEW_OFF && show_msg('initdbresult_succ');
|
||||
|
||||
if(!VIEW_OFF) {
|
||||
echo '<script type="text/javascript">function setlaststep() {document.getElementById("laststep").disabled=false;window.location=\'index.php?method=ext_info\';}</script><script type="text/javascript">setTimeout(function(){window.location=\'index.php?method=ext_info\'}, 30000);</script><iframe src="../misc.php?mod=initsys" style="display:none;" onload="setlaststep()"></iframe>'."\r\n";
|
||||
show_footer();
|
||||
}
|
||||
|
||||
}
|
||||
if(VIEW_OFF) {
|
||||
|
||||
show_msg('missing_parameter', '', 0);
|
||||
|
||||
} else {
|
||||
show_form($form_db_init_items, $error_msg);
|
||||
|
||||
}
|
||||
|
||||
} elseif($method == 'ext_info') {
|
||||
@touch($lockfile);
|
||||
if(VIEW_OFF) {
|
||||
show_msg('ext_info_succ');
|
||||
} else {
|
||||
show_header();
|
||||
echo '</div><div class="main" style="margin-top: -123px;padding-left:30px"><span id="platformIntro"></span>';
|
||||
echo '<iframe frameborder="0" width="700" height="550" allowTransparency="true" src="http://addon.discuz.com/api/outer.php?id=installed&siteurl='.urlencode($default_appurl).'&version='.DISCUZ_VERSION.'"></iframe>';
|
||||
echo '<p align="right"><a href="'.$default_appurl.'">'.$lang['install_finish'].'</a></p><br />';
|
||||
echo '</div>';
|
||||
show_footer();
|
||||
}
|
||||
|
||||
} elseif($method == 'install_check') {
|
||||
|
||||
if(file_exists($lockfile)) {
|
||||
show_msg('installstate_succ');
|
||||
} else {
|
||||
show_msg('lock_file_not_touch', $lockfile, 0);
|
||||
}
|
||||
|
||||
} elseif($method == 'tablepre_check') {
|
||||
|
||||
$dbinfo = getgpc('dbinfo');
|
||||
extract($dbinfo);
|
||||
if(check_db($dbhost, $dbuser, $dbpw, $dbname, $tablepre)) {
|
||||
show_msg('tablepre_not_exists', 0);
|
||||
} else {
|
||||
show_msg('tablepre_exists', $tablepre, 0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member.php 34253 2013-11-25 03:36:23Z nemohou $
|
||||
*/
|
||||
|
||||
define('APPTYPEID', 0);
|
||||
define('CURSCRIPT', 'member');
|
||||
|
||||
require './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$modarray = array('activate', 'emailverify', 'getpasswd',
|
||||
'groupexpiry', 'logging', 'lostpasswd',
|
||||
'register', 'regverify', 'switchstatus');
|
||||
|
||||
|
||||
$mod = !in_array($discuz->var['mod'], $modarray) && (!preg_match('/^\w+$/', $discuz->var['mod']) || !file_exists(DISCUZ_ROOT.'./source/module/member/member_'.$discuz->var['mod'].'.php')) ? 'register' : $discuz->var['mod'];
|
||||
|
||||
define('CURMODULE', $mod);
|
||||
|
||||
$discuz->init();
|
||||
if($mod == 'register' && $discuz->var['mod'] != $_G['setting']['regname']) {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
|
||||
require libfile('function/member');
|
||||
require libfile('class/member');
|
||||
runhooks();
|
||||
|
||||
|
||||
require DISCUZ_ROOT.'./source/module/member/member_'.$mod.'.php';
|
||||
|
||||
?>
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: misc.php 34264 2013-11-27 03:14:58Z nemohou $
|
||||
*/
|
||||
|
||||
if(isset($_GET['css'])) {
|
||||
$css = explode('|', $_GET['css']);
|
||||
$string = '';
|
||||
$size = 0;
|
||||
foreach($css as $file) {
|
||||
if(preg_match('/^\w+$/', $file)) {
|
||||
$file = './data/cache/style_'.$file.'.css';
|
||||
$string .= @implode('', file($file));
|
||||
}
|
||||
}
|
||||
ob_start('ob_gzhandler');
|
||||
header('Content-Type: text/css');
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 2592000).' GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
|
||||
echo $string;
|
||||
exit;
|
||||
}
|
||||
if(isset($_GET['js'])) {
|
||||
$js = explode('|', $_GET['js']);
|
||||
$string = '';
|
||||
$size = 0;
|
||||
foreach($js as $file) {
|
||||
$file = substr($file, 0, strpos($file, '.'));
|
||||
if(preg_match('/^\w+$/', $file)) {
|
||||
$file = './data/cache/'.$file.'.js';
|
||||
$string .= @implode('', file($file));
|
||||
}
|
||||
}
|
||||
ob_start('ob_gzhandler');
|
||||
header('Content-Type: text/javascript');
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 2592000).' GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
|
||||
echo $string;
|
||||
exit;
|
||||
}
|
||||
|
||||
define('APPTYPEID', 100);
|
||||
define('CURSCRIPT', 'misc');
|
||||
|
||||
|
||||
require './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$discuz->reject_robot();
|
||||
$modarray = array('seccode', 'secqaa', 'initsys', 'invite', 'faq', 'report',
|
||||
'swfupload', 'manyou', 'stat', 'ranklist', 'buyinvitecode',
|
||||
'tag', 'diyhelp', 'mobile', 'patch', 'getatuser', 'imgcropper',
|
||||
'userstatus', 'signin');
|
||||
|
||||
$modcachelist = array(
|
||||
'ranklist' => array('forums', 'diytemplatename'),
|
||||
);
|
||||
|
||||
$mod = getgpc('mod');
|
||||
$mod = (empty($mod) || !in_array($mod, $modarray)) ? 'error' : $mod;
|
||||
|
||||
if(in_array($mod, array('seccode', 'secqaa', 'initsys', 'faq', 'swfupload', 'mobile'))) {
|
||||
define('ALLOWGUEST', 1);
|
||||
}
|
||||
|
||||
$cachelist = array();
|
||||
if(isset($modcachelist[$mod])) {
|
||||
$cachelist = $modcachelist[$mod];
|
||||
}
|
||||
|
||||
$discuz->cachelist = $cachelist;
|
||||
|
||||
switch ($mod) {
|
||||
case 'secqaa':
|
||||
case 'manyou':
|
||||
case 'userstatus':
|
||||
case 'seccode':
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_session = false;
|
||||
break;
|
||||
case 'updatecache':
|
||||
$discuz->init_cron = false;
|
||||
$discuz->init_session = false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$discuz->init();
|
||||
|
||||
define('CURMODULE', $mod);
|
||||
runhooks();
|
||||
|
||||
require DISCUZ_ROOT.'./source/module/misc/misc_'.$mod.'.php';
|
||||
|
||||
?>
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: plugin.php 27335 2012-01-16 10:15:37Z monkey $
|
||||
*/
|
||||
|
||||
define('APPTYPEID', 127);
|
||||
define('CURSCRIPT', 'plugin');
|
||||
|
||||
|
||||
require './source/class/class_core.php';
|
||||
|
||||
$discuz = C::app();
|
||||
|
||||
$cachelist = array('plugin', 'diytemplatename');
|
||||
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init();
|
||||
|
||||
if(!empty($_GET['id'])) {
|
||||
list($identifier, $module) = explode(':', $_GET['id']);
|
||||
$module = $module !== NULL ? $module : $identifier;
|
||||
} else {
|
||||
showmessage('plugin_nonexistence');
|
||||
}
|
||||
$mnid = 'plugin_'.$identifier.'_'.$module;
|
||||
$pluginmodule = isset($_G['setting']['pluginlinks'][$identifier][$module]) ? $_G['setting']['pluginlinks'][$identifier][$module] : (isset($_G['setting']['plugins']['script'][$identifier][$module]) ? $_G['setting']['plugins']['script'][$identifier][$module] : array('adminid' => 0, 'directory' => preg_match("/^[a-z]+[a-z0-9_]*$/i", $identifier) ? $identifier.'/' : ''));
|
||||
|
||||
if(!preg_match('/^[\w\_]+$/', $identifier)) {
|
||||
showmessage('plugin_nonexistence');
|
||||
}
|
||||
|
||||
if(empty($identifier) || !preg_match("/^[a-z0-9_\-]+$/i", $module) || !in_array($identifier, $_G['setting']['plugins']['available'])) {
|
||||
showmessage('plugin_nonexistence');
|
||||
} elseif($pluginmodule['adminid'] && ($_G['adminid'] < 1 || ($_G['adminid'] > 0 && $pluginmodule['adminid'] < $_G['adminid']))) {
|
||||
showmessage('plugin_nopermission');
|
||||
} elseif(@!file_exists(DISCUZ_ROOT.($modfile = './source/plugin/'.$pluginmodule['directory'].$module.'.inc.php'))) {
|
||||
showmessage('plugin_module_nonexistence', '', array('mod' => $modfile));
|
||||
}
|
||||
|
||||
define('CURMODULE', $identifier);
|
||||
runhooks();
|
||||
|
||||
include DISCUZ_ROOT.$modfile;
|
||||
|
||||
?>
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: portal.php 33234 2013-05-08 04:13:19Z andyzheng $
|
||||
*/
|
||||
|
||||
define('APPTYPEID', 4);
|
||||
define('CURSCRIPT', 'portal');
|
||||
|
||||
require './source/class/class_core.php';
|
||||
$discuz = C::app();
|
||||
|
||||
$cachelist = array('userapp', 'portalcategory', 'diytemplatenameportal');
|
||||
$discuz->cachelist = $cachelist;
|
||||
$discuz->init();
|
||||
|
||||
require DISCUZ_ROOT.'./source/function/function_home.php';
|
||||
require DISCUZ_ROOT.'./source/function/function_portal.php';
|
||||
|
||||
if(empty($_GET['mod']) || !in_array($_GET['mod'], array('list', 'view', 'comment', 'portalcp', 'topic', 'attachment', 'rss', 'block'))) $_GET['mod'] = 'index';
|
||||
|
||||
|
||||
define('CURMODULE', $_GET['mod']);
|
||||
runhooks();
|
||||
|
||||
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['portal']);
|
||||
$_G['disabledwidthauto'] = 1;
|
||||
|
||||
require_once libfile('portal/'.$_GET['mod'], 'module');
|
||||
|
||||
?>
|