Total re-factor to split out SMF-specific functionality, config variables, and theme, preparing this to be used in multiple places.
|
@ -0,0 +1,4 @@
|
|||
.idea/
|
||||
serverstatus.php
|
||||
**~
|
||||
**.class
|
46
README
|
@ -1,23 +1,23 @@
|
|||
PHP Server Status Page
|
||||
======================
|
||||
PHP Server Status Page v0.5
|
||||
===========================
|
||||
Allow users to post their servers and keep track of uptime,
|
||||
votes, and more with this simple and extensible PHP script.
|
||||
|
||||
Author: Travis Burtrum (moparisthebest)
|
||||
Email: admin@moparisthebest.com
|
||||
|
||||
Originally written for: https://www.moparscape.org/serverstatus.php
|
||||
Originally written for: http://www.moparscape.org/serverstatus.php
|
||||
I plan to keep the repository up to date with the currently running
|
||||
code at all times.
|
||||
|
||||
Features:
|
||||
----------------------
|
||||
1. Integration with SMF forum, but extensible to other forums as well.
|
||||
1. Integration with SMF forum, but extensible to other forums as well (check ss_sources/forums/).
|
||||
2. Premium (Sponsored) server support.
|
||||
3. Layout entirely configurable from CSS.
|
||||
3. Layout entirely configurable from CSS (theme support in ss_sources/themes/).
|
||||
4. Full WYSIWYG editor and bbcode support thanks to SMF.
|
||||
5. IP owner verification.
|
||||
6. Voting support.
|
||||
6. Voting support. (with optional ReCaptcha verification)
|
||||
7. Dynamic status images, with clean URL support.
|
||||
8. Can sort by all meaningful table columns.
|
||||
9. Uses MySQLi.
|
||||
|
@ -25,15 +25,21 @@ Features:
|
|||
|
||||
How to make it work:
|
||||
----------------------
|
||||
1. edit the database details in ss_sources/util.php
|
||||
2. create databases by importing database.sql
|
||||
1. Copy ss_sources/copy_edit_me.php to where you want the script to run
|
||||
(like /serverstatus.php) and fill in all config details. You can copy
|
||||
to multiple locations with different details to run multiple instances
|
||||
of the application with the same codebase.
|
||||
2. Create databases by importing database.sql
|
||||
3. Setup sphinx server if you want search.
|
||||
4. Fix all /path/to/smf/ links (there are 3).
|
||||
5. If you want clean URLs to work with the dynamic status images,
|
||||
you must create the relevant URL rewrite.
|
||||
6. Compile and set up the (extremely poorley written) ServerChecker.java
|
||||
4. If you want clean URLs to work with the dynamic status images,
|
||||
you must create the relevant URL rewrite. In lighttpd, it looks like this:
|
||||
url.rewrite-once = (
|
||||
"^/serverstatus/([^/]*)\.png$" => "/serverstatus.php?action=image&server=$1",
|
||||
"^/serverstatus/([^/]*)/([^/]*)\.png$" => "/serverstatus.php?action=image&scale=$1&server=$2",
|
||||
)
|
||||
5. Compile and set up the (extremely poorly written) ServerChecker.java
|
||||
to automatically approve and check the status of servers as a cronjob.
|
||||
7. Run it, I suggest Lighttpd+FastCGI.
|
||||
6. Run it, I suggest Lighttpd+FastCGI.
|
||||
|
||||
How to comply with License:
|
||||
----------------------
|
||||
|
@ -64,11 +70,13 @@ GNU Affero General Public License for more details.
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Files not written by me with their own license, and download links:
|
||||
recaptchalib.php: (MIT) http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest
|
||||
sphinxapi.php : (GPL) http://code.google.com/p/sphinxsearch/source/browse/trunk/api/sphinxapi.php
|
||||
tbszip.php : (LGPL) http://www.tinybutstrong.com/dl.php?f=tbszip.zip&s=2
|
||||
|
||||
TODO:
|
||||
----------------------
|
||||
1. Split configuration options off into seperate non-tracked file.
|
||||
2. Re-write ServerChecker.java completely.
|
||||
3. Embedded youtube support?
|
||||
4. You suggest it! Or better yet send me a pull request or patch!
|
||||
|
||||
|
||||
1. Re-write ServerChecker.java completely. (partially complete, calls for re-factor of database structure)
|
||||
2. Embedded youtube support?
|
||||
3. You suggest it! Or better yet send me a pull request or patch!
|
||||
|
|
661
agpl-3.0.txt
|
@ -1,661 +0,0 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
12
database.sql
|
@ -93,3 +93,15 @@ CREATE TABLE IF NOT EXISTS `toadd` (
|
|||
KEY `uid` (`uid`),
|
||||
KEY `online` (`online`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `log_voted`;
|
||||
CREATE TABLE IF NOT EXISTS `log_voted` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`uid` mediumint(8) unsigned NOT NULL,
|
||||
`uname` varchar(80) NOT NULL,
|
||||
`server_id` int(11) unsigned NOT NULL,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`ip` varchar(15) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
|
|
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 55 B |
After Width: | Height: | Size: 55 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 334 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 72 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 56 B |
After Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 311 B |
After Width: | Height: | Size: 191 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 85 B |
After Width: | Height: | Size: 785 B |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 225 B |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 171 B |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 94 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 83 B |
After Width: | Height: | Size: 118 B |
After Width: | Height: | Size: 116 B |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 121 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 288 B |
After Width: | Height: | Size: 932 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 73 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
/*
|
||||
MoparScape.org server status page
|
||||
Copyright (C) 2011 Travis Burtrum (moparisthebest)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
# remove these next two lines
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
# uncomment these to show all errors
|
||||
//ini_set('display_errors', 0);
|
||||
//error_reporting(E_ALL);
|
||||
|
||||
# you need to set these regardless
|
||||
global $g_source_dir, $g_sql_host, $g_sql_user, $g_sql_pass, $g_sql_db, $g_versions, $g_theme, $g_img_dir, $g_admin_contact;
|
||||
# path to ss_sources
|
||||
$g_source_dir = './ss_sources';
|
||||
$g_img_dir = './images';
|
||||
# MySQL details
|
||||
$g_sql_host = 'localhost';
|
||||
$g_sql_user = 'user';
|
||||
$g_sql_pass = 'pass';
|
||||
$g_sql_db = 'serverstat';
|
||||
# versions you support
|
||||
$g_versions = array(317, 508);
|
||||
$g_admin_contact = '<a href="/smf/index.php?action=profile;u=youruid">yourname</a>';
|
||||
|
||||
define('SS_PAGE', 1);
|
||||
|
||||
# include forum connector
|
||||
require_once($g_source_dir.'/forums/smf.php');
|
||||
# do custom setup for above forum connector
|
||||
global $path_to_smf, $smf_admin_groups, $g_forum_url;
|
||||
$path_to_smf = '/path/to/smf';
|
||||
$smf_admin_groups = array(2, 63, 70);
|
||||
$g_forum_url = '/smf/index.php';
|
||||
|
||||
# include theme
|
||||
require_once($g_source_dir.'/themes/default.php');
|
||||
# do custom setup for above theme
|
||||
$g_theme = array();
|
||||
$g_theme['title'] = "Server Status Checker";
|
||||
$g_theme['left_link'] = '/smf/index.php';
|
||||
$g_theme['left_link_alt'] = 'Visit Forums';
|
||||
$g_theme['right_link'] = '/download.html';
|
||||
$g_theme['right_link_alt'] = 'Download Here!';
|
||||
$g_theme['center_link'] = '/serverstatus.php';
|
||||
$g_theme['center_link_alt'] = 'Server Status';
|
||||
$g_theme['header'] = 'Welcome visitor!';
|
||||
|
||||
# recaptcha setup for votes, if empty, recaptcha won't be used
|
||||
# get keys here: https://www.google.com/recaptcha/admin/create?app=php
|
||||
//global $recaptcha_pubkey, $recaptcha_privkey;
|
||||
//$recaptcha_pubkey = "";
|
||||
//$recaptcha_privkey = "";
|
||||
|
||||
function echoPlay($online, $ip, $port, $version){
|
||||
if ($online == 1) {
|
||||
$link = "http://www.moparscape.org/index.php?server=%s&port=%s&version=%s&detail=";
|
||||
$link = sprintf($link, $ip, $port, $version);
|
||||
$play = '<a href="%s0">High</a> / <a href="%s1">Low</a>';
|
||||
$play = sprintf($play, $link, $link);
|
||||
return $play;
|
||||
} else {
|
||||
$play = '<div class="offline">Server Offline!</div>';
|
||||
return $play;
|
||||
}
|
||||
}
|
||||
|
||||
// ads and such
|
||||
function echoAd(){
|
||||
|
||||
}
|
||||
|
||||
function echoAnalytics(){
|
||||
|
||||
}
|
||||
|
||||
# end configuration, kick off the application
|
||||
require_once($g_source_dir.'/main.php');
|
||||
?>
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function display(){
|
||||
//echo 'this is display';
|
||||
|
@ -62,8 +62,6 @@ function display_table($online, $where, $num_servers = null){
|
|||
if($start == 0 && $online == 1 && !isset($_GET['sort']))
|
||||
echoTable('Spons', "`sponsored` != '0'", "ORDER BY `sponsored` DESC, RAND() LIMIT 10");
|
||||
|
||||
|
||||
|
||||
echoTable('Other', $where, $order_by, $online, $start, $num_per_page, $num_servers);
|
||||
close_mysql();
|
||||
}
|
||||
|
@ -105,30 +103,23 @@ function echoTable($class, $where, $order_by, $online = 1, $start = 0, $num_per_
|
|||
}
|
||||
|
||||
function echoTableRow($class, $name, $pic_url, $uid, $uname, $ip, $port, $version, $uptime, $time, $votes, $online = 1, $odd = False){
|
||||
global $thispage;
|
||||
global $thispage, $g_img_dir;
|
||||
|
||||
if($pic_url != '')
|
||||
if($pic_url != '' && $class == "Spons")
|
||||
$name = '<img src="'.$pic_url.'" alt="'.$name.'" width="185" height="25" />';
|
||||
|
||||
if($online == 1){
|
||||
$link = "http://www.moparscape.org/index.php?server=%s&port=%s&version=%s&detail=";
|
||||
$link = sprintf($link, $ip, $port, $version);
|
||||
$play = '<a href="%s0">High</a> / <a href="%s1">Low</a>';
|
||||
$play = sprintf($play, $link, $link);
|
||||
}else{
|
||||
$play = '<div class="offline">Server Offline!</div>';
|
||||
}
|
||||
// date("m-d-y", $time)
|
||||
$play = echoPlay($online, $ip, $port, $version);
|
||||
// date("m-d-y", $time)
|
||||
// strftime($time_format, $time+$time_offset)
|
||||
?>
|
||||
<tr<?php if($odd) echo ' class="odd"'; ?>>
|
||||
<td><a href="?server=<?php echo $ip; ?>"><?php echo $name; ?></a></td>
|
||||
<td><?php echo $version; ?></td>
|
||||
<td><a href="http://www.moparscape.org/smf/index.php?action=profile;u=<?php echo $uid; ?>"><?php echo $uname; ?></a></td>
|
||||
<td><a href="<?php echo urlForUid($uid); ?>"><?php echo $uname; ?></a></td>
|
||||
<td><?php echo $uptime; ?>%</td>
|
||||
<td><?php echo date("m-d-y", $time); ?></td>
|
||||
<td><?php echo ($votes > 0) ? '+'.$votes: $votes; ?></td>
|
||||
<td><a href="<?php echo $thispage ?>?action=up&server=<?php echo $ip ?>"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/images/up.png" alt="Up" /></a><a href="<?php echo $thispage ?>?action=down&server=<?php echo $ip ?>"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/images/down.png" alt="Down" /></a></td>
|
||||
<td><a href="<?php echo $thispage ?>?action=up&server=<?php echo $ip ?>"><img src="<?php echo $g_img_dir; ?>/up.png" alt="Up" /></a><a href="<?php echo $thispage ?>?action=down&server=<?php echo $ip ?>"><img src="<?php echo $g_img_dir; ?>/down.png" alt="Down" /></a></td>
|
||||
<?php
|
||||
if(!can_mod() || $class == "Spons"){
|
||||
?>
|
||||
|
@ -145,7 +136,7 @@ function echoTableRow($class, $name, $pic_url, $uid, $uname, $ip, $port, $versio
|
|||
}
|
||||
|
||||
function echoTableHeader($class, $num, $pageindex = null, $online = 1){
|
||||
global $g_headers, $thispage;
|
||||
global $g_headers, $thispage, $g_img_dir;
|
||||
|
||||
if($class == "Spons")
|
||||
$caption = 'Sponsored Servers';
|
||||
|
@ -175,10 +166,10 @@ function echoTableHeader($class, $num, $pageindex = null, $online = 1){
|
|||
$pic = '';
|
||||
if((!isset($_GET['sort']) && $sort == 'uptime') || $sort == $_GET['sort']){
|
||||
if(!isset($_GET['sort']) || isset($_GET['desc'])){
|
||||
$name .= ' <img src="http://'.$_SERVER['SERVER_NAME'].'/images/sort_down.gif" alt="" />';
|
||||
$name .= ' <img src="'.$g_img_dir.'/sort_down.gif" alt="" />';
|
||||
}else{
|
||||
$sort .= '&desc';
|
||||
$name .= ' <img src="http://'.$_SERVER['SERVER_NAME'].'/images/sort_up.gif" alt="" />';
|
||||
$name .= ' <img src="'.$g_img_dir.'/sort_up.gif" alt="" />';
|
||||
}
|
||||
}
|
||||
printf($link, $sort, $name);
|
||||
|
@ -212,7 +203,7 @@ function echoTableHeader($class, $num, $pageindex = null, $online = 1){
|
|||
?>
|
||||
<tr>
|
||||
<th scope="row">Info</th>
|
||||
<th scope="row" colspan="7"><a href="http://www.moparscape.org/sponsbid.php">How to get Sponsored</a>.</th>
|
||||
<th scope="row" colspan="7"><a href="/sponsbid.php">How to get Sponsored</a>.</th>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 23 KiB |
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/*
|
||||
MoparScape.org server status page
|
||||
Copyright (C) 2011 Travis Burtrum (moparisthebest)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
# globals that must be defined for this to function
|
||||
# global $path_to_smf, $smf_admin_groups, $g_forum_url;
|
||||
|
||||
function doUserSetup(){
|
||||
global $user_info, $path_to_smf, $smf_admin_groups;
|
||||
require_once($path_to_smf.'/SSI.php');
|
||||
$user = ssi_welcome('array');
|
||||
|
||||
// vars from SMF that we use, for easy compatibility for future versions
|
||||
global $groups, $time_format, $time_offset, $is_admin, $is_guest, $uname, $uid;
|
||||
$groups = $user_info['groups'];
|
||||
$time_format = $user_info['time_format'];
|
||||
# this is the number of seconds to add to time()
|
||||
$time_offset = $user_info['time_offset']*3600;
|
||||
$is_admin = $user['is_admin'];
|
||||
foreach ($smf_admin_groups as $admin_group)
|
||||
if(in_array($admin_group, $groups))
|
||||
$is_admin = true;
|
||||
$is_guest = $user['is_guest'];
|
||||
$uname = $user['name'];
|
||||
$uid = $user['id'];
|
||||
}
|
||||
|
||||
function &censor(&$text){
|
||||
global $path_to_smf;
|
||||
require_once($path_to_smf.'/Sources/Subs-Post.php');
|
||||
censorText($text);
|
||||
}
|
||||
|
||||
function bb2html($bb_code, $previewing = false){
|
||||
$bb_code = html_special($bb_code);
|
||||
|
||||
global $path_to_smf;
|
||||
require_once($path_to_smf.'/Sources/Subs-Post.php');
|
||||
|
||||
preparsecode($bb_code, $previewing);
|
||||
censorText($bb_code);
|
||||
$bb_code = parse_bbc($bb_code);
|
||||
|
||||
return $bb_code;
|
||||
}
|
||||
|
||||
function echoLogin($returnto){
|
||||
ssi_login($returnto);
|
||||
}
|
||||
|
||||
function echoLogoutLink($returnto){
|
||||
ssi_logout($returnto);
|
||||
}
|
||||
|
||||
function urlForUid($uid){
|
||||
global $g_forum_url;
|
||||
return $g_forum_url.'?action=profile;u='.$uid;
|
||||
}
|
||||
?>
|
|
@ -17,22 +17,8 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
$script_name = '/serverstatus/';
|
||||
$script_name_len = strlen($script_name);
|
||||
/*
|
||||
function echoImage($online = -1){
|
||||
if($online == 1)
|
||||
$url = 'http://mopar.moparscape.org/images/online.gif';
|
||||
elseif($online == 0)
|
||||
$url = 'http://mopar.moparscape.org/images/offline.gif';
|
||||
else
|
||||
$url = 'http://mopar.moparscape.org/images/error.gif';
|
||||
close_mysql();
|
||||
header("Location: $url");
|
||||
//echo("Location: $url"); debug_print_backtrace();
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function scale(&$img, $scale) {
|
||||
$width = imagesx($img) * $scale/100;
|
||||
|
@ -58,9 +44,14 @@ function centerImageString($image, $string, $font_size, $y){
|
|||
imagestring($image, $font_size, $x, $y, $string, $color);
|
||||
}
|
||||
*/
|
||||
function centerTtfString($image, $string, $font_size, $y, $font='./fonts/arial_bold.ttf'){
|
||||
function centerTtfString($image, $string, $font_size, $y, $font=null){
|
||||
$color = imagecolorallocate($image, 199, 208, 227);
|
||||
|
||||
if($font == null){
|
||||
global $g_source_dir;
|
||||
$font=$g_source_dir.'/fonts/arial_bold.ttf';
|
||||
}
|
||||
|
||||
$tb = imagettfbbox($font_size, 0, $font, $string);
|
||||
|
||||
$x = ceil((imagesx($image) - $tb[2]) / 2); // lower left X coordinate for text
|
||||
|
@ -69,13 +60,14 @@ function centerTtfString($image, $string, $font_size, $y, $font='./fonts/arial_b
|
|||
|
||||
function echoImage($online = -1, $text = 'Error!', $size_req = ''){
|
||||
close_mysql();
|
||||
global $g_source_dir;
|
||||
|
||||
if($online == 1)
|
||||
$file = '../images/online.png';
|
||||
$file = $g_source_dir.'/fonts/online.png';
|
||||
elseif($online == 0)
|
||||
$file = '../images/offline.png';
|
||||
$file = $g_source_dir.'/fonts/offline.png';
|
||||
else
|
||||
$file = '../images/error.png';
|
||||
$file = $g_source_dir.'/fonts/error.png';
|
||||
|
||||
$im = imagecreatefrompng($file);
|
||||
// the following not needed, since there is no more transparency in image
|
||||
|
@ -132,41 +124,30 @@ function echoImage($online = -1, $text = 'Error!', $size_req = ''){
|
|||
exit;
|
||||
}
|
||||
|
||||
define('SS_PAGE', 1);
|
||||
require_once('./util.php');
|
||||
function gen_image(){
|
||||
|
||||
// if there is no URI, some error, so forward to error
|
||||
if (empty($_SERVER['REQUEST_URI']))
|
||||
echoImage();
|
||||
// if there is no server, some error, so forward to error
|
||||
if (empty($_REQUEST['server']))
|
||||
echoImage();
|
||||
|
||||
// get the server, if there isn't one, forward to error
|
||||
if ( (substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['REQUEST_URI'], '.'), 4) == '.png') && (substr($_SERVER['REQUEST_URI'], 0, $script_name_len) == $script_name) )
|
||||
$server = substr($_SERVER['REQUEST_URI'], $script_name_len, strrpos($_SERVER['REQUEST_URI'], '.')-$script_name_len);
|
||||
else
|
||||
echoImage();
|
||||
$server = $_REQUEST['server'];
|
||||
$size_req = $_REQUEST['scale'];
|
||||
|
||||
// check if $server contains a size request, it would be before the /, the real ip after.
|
||||
$slash_pos = strpos($server, '/');
|
||||
if($slash_pos !== false){
|
||||
$size_req = substr($server, 0, $slash_pos);
|
||||
$server = substr($server, ++$slash_pos, strlen($server));
|
||||
}else
|
||||
$size_req = '';
|
||||
mysql_con();
|
||||
global $g_mysqli;
|
||||
$stmt = $g_mysqli->prepare('SELECT `online` FROM `servers` WHERE `ip` = ? LIMIT 1') or debug($g_mysqli->error);
|
||||
$stmt->bind_param("s", $server);
|
||||
$stmt->execute() or debug($g_mysqli->error);
|
||||
// bind result variables
|
||||
$stmt->bind_result($online);
|
||||
|
||||
mysql_con();
|
||||
global $g_mysqli;
|
||||
$stmt = $g_mysqli->prepare('SELECT `online` FROM `servers` WHERE `ip` = ? LIMIT 1') or debug($g_mysqli->error);
|
||||
$stmt->bind_param("s", $server);
|
||||
$stmt->execute() or debug($g_mysqli->error);
|
||||
// bind result variables
|
||||
$stmt->bind_result($online);
|
||||
// if there is no server in the database, forward to error
|
||||
if(!$stmt->fetch())
|
||||
echoImage(-1, $server, $size_req);
|
||||
|
||||
// if there is no server in the database, forward to error
|
||||
if(!$stmt->fetch())
|
||||
echoImage(-1, $server, $size_req);
|
||||
$stmt->close();
|
||||
|
||||
$stmt->close();
|
||||
|
||||
// forward to the right page
|
||||
echoImage($online, $server, $size_req);
|
||||
// forward to the right page
|
||||
echoImage($online, $server, $size_req);
|
||||
}
|
||||
?>
|
|
@ -16,18 +16,19 @@ GNU Affero General Public License for more details.
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if($_REQUEST['action'] != 'verify')
|
||||
require_once('/path/to/agreed.php');
|
||||
|
||||
//ini_set('display_errors', 0);
|
||||
//error_reporting(E_ALL);
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
define('SS_PAGE', 1);
|
||||
global $g_source_dir, $thispage, $g_allowed_url, $g_allowed_alpha, $g_allowed_key, $g_allowed_dns, $g_ss_version;
|
||||
$g_ss_version = '0.5';
|
||||
$thispage = 'http'.(isset($_SERVER['HTTPS']) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
|
||||
$g_allowed_key = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
$g_allowed_alpha = $g_allowed_key."- ";
|
||||
$g_allowed_dns = $g_allowed_key."-.";
|
||||
$g_allowed_url = $g_allowed_key." /-:.%";
|
||||
|
||||
global $ss_sourcedir;
|
||||
$ss_sourcedir = './ss_sources';
|
||||
|
||||
require_once($ss_sourcedir.'/util.php');
|
||||
require_once($g_source_dir.'/util.php');
|
||||
|
||||
// What function shall we execute? (done like this for memory's sake.)
|
||||
// defaults
|
||||
|
@ -36,7 +37,7 @@ $do_setup = true;
|
|||
$action = ss_main($header, $do_setup);
|
||||
|
||||
if($do_setup)
|
||||
doSetup();
|
||||
doUserSetup();
|
||||
|
||||
if($header)
|
||||
echoHeader($action);
|
||||
|
@ -49,14 +50,14 @@ if($header)
|
|||
// The main controlling function.
|
||||
function ss_main(&$header, &$do_setup)
|
||||
{
|
||||
global $ss_sourcedir;
|
||||
global $g_source_dir;
|
||||
|
||||
if (empty($_REQUEST['action'])){
|
||||
if(!empty($_REQUEST['server'])){
|
||||
require_once($ss_sourcedir . '/view.php');
|
||||
require_once($g_source_dir . '/view.php');
|
||||
return 'view';
|
||||
}
|
||||
require_once($ss_sourcedir . '/display.php');
|
||||
require_once($g_source_dir . '/display.php');
|
||||
return 'display';
|
||||
}
|
||||
|
||||
|
@ -68,6 +69,8 @@ function ss_main(&$header, &$do_setup)
|
|||
'register2' => array('register.php', 'register2'),
|
||||
'verify' => array('verify.php', 'verify', false, false),
|
||||
'random' => array('random.php', 'random_page', false, false),
|
||||
'image' => array('image_server.php', 'gen_image', false, false),
|
||||
'zip' => array('tbszip.php', 'zip_sources', false, false),
|
||||
'up' => array('vote.php', 'vote'),
|
||||
'down' => array('vote.php', 'vote'),
|
||||
'vote' => array('vote.php', 'vote2'),
|
||||
|
@ -86,12 +89,12 @@ function ss_main(&$header, &$do_setup)
|
|||
//die('No action found, try '.$thispage);
|
||||
|
||||
// Fall through to the display then...
|
||||
require_once($ss_sourcedir . '/display.php');
|
||||
require_once($g_source_dir . '/display.php');
|
||||
return 'display';
|
||||
}
|
||||
|
||||
// Otherwise, it was set - so let's go to that action.
|
||||
require_once($ss_sourcedir . '/' . $actionArray[$_REQUEST['action']][0]);
|
||||
require_once($g_source_dir . '/' . $actionArray[$_REQUEST['action']][0]);
|
||||
// here is the only place we NEED to set $header and $do_setup
|
||||
$header = (isset($actionArray[$_REQUEST['action']][2]) ? $actionArray[$_REQUEST['action']][2] : true);
|
||||
$do_setup = (isset($actionArray[$_REQUEST['action']][3]) ? $actionArray[$_REQUEST['action']][3] : true);
|
|
@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function banServ(){
|
||||
forceAdmin();
|
||||
|
||||
global $g_mysqli;
|
||||
global $g_mysqli, $g_admin_contact;
|
||||
|
||||
mysql_con();
|
||||
|
||||
|
@ -34,7 +34,7 @@ function banServ(){
|
|||
// execute the query
|
||||
$stmt->execute() or debug($g_mysqli->error);
|
||||
if ($stmt->affected_rows != 1) {
|
||||
echo 'Ban failed, is it a sponsored server?, PM <a href="http://www.moparscape.org/smf/index.php?action=profile;u=1">Moparisthebest</a> on the forums to with details so he can fix it.';
|
||||
echo 'Ban failed, is it a sponsored server?, PM '.$g_admin_contact.' on the forums to with details so he can fix it.';
|
||||
return;
|
||||
}
|
||||
$stmt->close();
|
||||
|
@ -45,7 +45,7 @@ function banServ(){
|
|||
function deleteServ(){
|
||||
forceAdmin();
|
||||
|
||||
global $g_mysqli;
|
||||
global $g_mysqli, $g_admin_contact;
|
||||
|
||||
mysql_con();
|
||||
|
||||
|
@ -56,7 +56,7 @@ function deleteServ(){
|
|||
// execute the query
|
||||
$stmt->execute() or debug($g_mysqli->error);
|
||||
if ($stmt->affected_rows != 1) {
|
||||
echo 'Delete failed, is it a sponsored server?, PM <a href="http://www.moparscape.org/smf/index.php?action=profile;u=1">Moparisthebest</a> on the forums to with details so he can fix it.';
|
||||
echo 'Delete failed, is it a sponsored server?, PM '.$g_admin_contact.' on the forums to with details so he can fix it.';
|
||||
return;
|
||||
}
|
||||
$stmt->close();
|
||||
|
|
|
@ -1,364 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
MoparScape.org server status page
|
||||
Copyright (C) 2011 Travis Burtrum (moparisthebest)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
die('hacking attempt...');
|
||||
|
||||
// Parses some bbc before sending into the database...
|
||||
function preparsecode(&$message, $previewing = false)
|
||||
{
|
||||
global $user_info, $modSettings, $context;
|
||||
|
||||
// This line makes all languages *theoretically* work even with the wrong charset ;).
|
||||
//$message = preg_replace('~&#(\d{4,5}|[2-9]\d{2,4}|1[2-9]\d);~', '&#$1;', $message);
|
||||
|
||||
// Clean up after nobbc ;).
|
||||
$message = preg_replace('~\[nobbc\](.+?)\[/nobbc\]~ie', '\'[nobbc]\' . strtr(\'$1\', array(\'[\' => \'[\', \']\' => \']\', \':\' => \':\', \'@\' => \'@\')) . \'[/nobbc]\'', $message);
|
||||
|
||||
// Remove \r's... they're evil!
|
||||
$message = strtr($message, array("\r" => ''));
|
||||
|
||||
// You won't believe this - but too many periods upsets apache it seems!
|
||||
$message = preg_replace('~\.{100,}~', '...', $message);
|
||||
|
||||
// Trim off trailing quotes - these often happen by accident.
|
||||
while (substr($message, -7) == '[quote]')
|
||||
$message = substr($message, 0, -7);
|
||||
while (substr($message, 0, 8) == '[/quote]')
|
||||
$message = substr($message, 8);
|
||||
|
||||
// Check if all code tags are closed.
|
||||
$codeopen = preg_match_all('~(\[code(?:=[^\]]+)?\])~is', $message, $dummy);
|
||||
$codeclose = preg_match_all('~(\[/code\])~is', $message, $dummy);
|
||||
|
||||
// Close/open all code tags...
|
||||
if ($codeopen > $codeclose)
|
||||
$message .= str_repeat('[/code]', $codeopen - $codeclose);
|
||||
elseif ($codeclose > $codeopen)
|
||||
$message = str_repeat('[code]', $codeclose - $codeopen) . $message;
|
||||
|
||||
// Now that we've fixed all the code tags, let's fix the img and url tags...
|
||||
$parts = preg_split('~(\[/code\]|\[code(?:=[^\]]+)?\])~i', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
// The regular expression non breaking space has many versions.
|
||||
$non_breaking_space = $context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}' : pack('C*', 0xC2, 0xA0)) : '\xA0';
|
||||
|
||||
// Only mess with stuff outside [code] tags.
|
||||
for ($i = 0, $n = count($parts); $i < $n; $i++)
|
||||
{
|
||||
// It goes 0 = outside, 1 = begin tag, 2 = inside, 3 = close tag, repeat.
|
||||
if ($i % 4 == 0)
|
||||
{
|
||||
fixTags($parts[$i]);
|
||||
|
||||
// Replace /me.+?\n with [me=name]dsf[/me]\n.
|
||||
if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
|
||||
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
|
||||
else
|
||||
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
|
||||
|
||||
if (!$previewing && strpos($parts[$i], '[html]') !== false)
|
||||
{
|
||||
if (allowedTo('admin_forum'))
|
||||
$parts[$i] = preg_replace('~\[html\](.+?)\[/html\]~ise', '\'[html]\' . strtr(un_htmlspecialchars(\'$1\'), array("\n" => \' \', \' \' => \'  \')) . \'[/html]\'', $parts[$i]);
|
||||
// We should edit them out, or else if an admin edits the message they will get shown...
|
||||
else
|
||||
{
|
||||
while (strpos($parts[$i], '[html]') !== false)
|
||||
$parts[$i] = preg_replace('~\[[/]?html\]~i', '', $parts[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Let's look at the time tags...
|
||||
$parts[$i] = preg_replace('~\[time(=(absolute))*\](.+?)\[/time\]~ie', '\'[time]\' . (is_numeric(\'$3\') || @strtotime(\'$3\') == 0 ? \'$3\' : strtotime(\'$3\') - (\'$2\' == \'absolute\' ? 0 : (($modSettings[\'time_offset\'] + $user_info[\'time_offset\']) * 3600))) . \'[/time]\'', $parts[$i]);
|
||||
|
||||
$list_open = substr_count($parts[$i], '[list]') + substr_count($parts[$i], '[list ');
|
||||
$list_close = substr_count($parts[$i], '[/list]');
|
||||
if ($list_close - $list_open > 0)
|
||||
$parts[$i] = str_repeat('[list]', $list_close - $list_open) . $parts[$i];
|
||||
if ($list_open - $list_close > 0)
|
||||
$parts[$i] = $parts[$i] . str_repeat('[/list]', $list_open - $list_close);
|
||||
|
||||
// Make sure all tags are lowercase.
|
||||
$parts[$i] = preg_replace('~\[([/]?)(list|li|table|tr|td)([^\]]*)\]~ie', '\'[$1\' . strtolower(\'$2\') . \'$3]\'', $parts[$i]);
|
||||
|
||||
$mistake_fixes = array(
|
||||
// Find [table]s not followed by [tr].
|
||||
'~\[table\](?![\s' . $non_breaking_space . ']*\[tr\])~s' . ($context['utf8'] ? 'u' : '') => '[table][tr]',
|
||||
// Find [tr]s not followed by [td].
|
||||
'~\[tr\](?![\s' . $non_breaking_space . ']*\[td\])~s' . ($context['utf8'] ? 'u' : '') => '[tr][td]',
|
||||
// Find [/td]s not followed by something valid.
|
||||
'~\[/td\](?![\s' . $non_breaking_space . ']*(?:\[td\]|\[/tr\]|\[/table\]))~s' . ($context['utf8'] ? 'u' : '') => '[/td][/tr]',
|
||||
// Find [/tr]s not followed by something valid.
|
||||
'~\[/tr\](?![\s' . $non_breaking_space . ']*(?:\[tr\]|\[/table\]))~s' . ($context['utf8'] ? 'u' : '') => '[/tr][/table]',
|
||||
// Find [/td]s incorrectly followed by [/table].
|
||||
'~\[/td\][\s' . $non_breaking_space . ']*\[/table\]~s' . ($context['utf8'] ? 'u' : '') => '[/td][/tr][/table]',
|
||||
// Find [table]s, [tr]s, and [/td]s (possibly correctly) followed by [td].
|
||||
'~\[(table|tr|/td)\]([\s' . $non_breaking_space . ']*)\[td\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_td_]',
|
||||
// Now, any [td]s left should have a [tr] before them.
|
||||
'~\[td\]~s' => '[tr][td]',
|
||||
// Look for [tr]s which are correctly placed.
|
||||
'~\[(table|/tr)\]([\s' . $non_breaking_space . ']*)\[tr\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_tr_]',
|
||||
// Any remaining [tr]s should have a [table] before them.
|
||||
'~\[tr\]~s' => '[table][tr]',
|
||||
// Look for [/td]s followed by [/tr].
|
||||
'~\[/td\]([\s' . $non_breaking_space . ']*)\[/tr\]~s' . ($context['utf8'] ? 'u' : '') => '[/td]$1[_/tr_]',
|
||||
// Any remaining [/tr]s should have a [/td].
|
||||
'~\[/tr\]~s' => '[/td][/tr]',
|
||||
// Look for properly opened [li]s which aren't closed.
|
||||
'~\[li\]([^\[\]]+?)\[li\]~s' => '[li]$1[_/li_][_li_]',
|
||||
'~\[li\]([^\[\]]+?)$~s' => '[li]$1[/li]',
|
||||
// Lists - find correctly closed items/lists.
|
||||
'~\[/li\]([\s' . $non_breaking_space . ']*)\[/list\]~s' . ($context['utf8'] ? 'u' : '') => '[_/li_]$1[/list]',
|
||||
// Find list items closed and then opened.
|
||||
'~\[/li\]([\s' . $non_breaking_space . ']*)\[li\]~s' . ($context['utf8'] ? 'u' : '') => '[_/li_]$1[_li_]',
|
||||
// Now, find any [list]s or [/li]s followed by [li].
|
||||
'~\[(list(?: [^\]]*?)?|/li)\]([\s' . $non_breaking_space . ']*)\[li\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_li_]',
|
||||
// Any remaining [li]s weren't inside a [list].
|
||||
'~\[li\]~' => '[list][li]',
|
||||
// Any remaining [/li]s weren't before a [/list].
|
||||
'~\[/li\]~' => '[/li][/list]',
|
||||
// Put the correct ones back how we found them.
|
||||
'~\[_(li|/li|td|tr|/tr)_\]~' => '[$1]',
|
||||
);
|
||||
|
||||
// Fix up some use of tables without [tr]s, etc. (it has to be done more than once to catch it all.)
|
||||
for ($j = 0; $j < 3; $j++)
|
||||
$parts[$i] = preg_replace(array_keys($mistake_fixes), $mistake_fixes, $parts[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Put it back together!
|
||||
if (!$previewing)
|
||||
$message = strtr(implode('', $parts), array(' ' => ' ', "\n" => '<br />', $context['utf8'] ? "\xC2\xA0" : "\xA0" => ' '));
|
||||
else
|
||||
$message = strtr(implode('', $parts), array(' ' => ' ', $context['utf8'] ? "\xC2\xA0" : "\xA0" => ' '));
|
||||
|
||||
// Now let's quickly clean up things that will slow our parser (which are common in posted code.)
|
||||
$message = strtr($message, array('[]' => '[]', '['' => '[''));
|
||||
}
|
||||
|
||||
// Fix any URLs posted - ie. remove 'javascript:'.
|
||||
function fixTags(&$message)
|
||||
{
|
||||
global $modSettings;
|
||||
|
||||
// WARNING: Editing the below can cause large security holes in your forum.
|
||||
// Edit only if you are sure you know what you are doing.
|
||||
|
||||
$fixArray = array(
|
||||
// [img]http://...[/img] or [img width=1]http://...[/img]
|
||||
array(
|
||||
'tag' => 'img',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => false,
|
||||
'hasEqualSign' => false,
|
||||
'hasExtra' => true,
|
||||
),
|
||||
// [url]http://...[/url]
|
||||
array(
|
||||
'tag' => 'url',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => false,
|
||||
),
|
||||
// [url=http://...]name[/url]
|
||||
array(
|
||||
'tag' => 'url',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => true,
|
||||
),
|
||||
// [iurl]http://...[/iurl]
|
||||
array(
|
||||
'tag' => 'iurl',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => false,
|
||||
),
|
||||
// [iurl=http://...]name[/iurl]
|
||||
array(
|
||||
'tag' => 'iurl',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => true,
|
||||
),
|
||||
// [ftp]ftp://...[/ftp]
|
||||
array(
|
||||
'tag' => 'ftp',
|
||||
'protocols' => array('ftp', 'ftps'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => false,
|
||||
),
|
||||
// [ftp=ftp://...]name[/ftp]
|
||||
array(
|
||||
'tag' => 'ftp',
|
||||
'protocols' => array('ftp', 'ftps'),
|
||||
'embeddedUrl' => true,
|
||||
'hasEqualSign' => true,
|
||||
),
|
||||
// [flash]http://...[/flash]
|
||||
array(
|
||||
'tag' => 'flash',
|
||||
'protocols' => array('http', 'https'),
|
||||
'embeddedUrl' => false,
|
||||
'hasEqualSign' => false,
|
||||
'hasExtra' => true,
|
||||
),
|
||||
);
|
||||
|
||||
// Fix each type of tag.
|
||||
foreach ($fixArray as $param)
|
||||
fixTag($message, $param['tag'], $param['protocols'], $param['embeddedUrl'], $param['hasEqualSign'], !empty($param['hasExtra']));
|
||||
|
||||
// Now fix possible security problems with images loading links automatically...
|
||||
$message = preg_replace('~(\[img.*?\])(.+?)\[/img\]~eis', '\'$1\' . preg_replace(\'~action(=|%3d)(?!dlattach)~i\', \'action-\', \'$2\') . \'[/img]\'', $message);
|
||||
|
||||
// Limit the size of images posted?
|
||||
if (!empty($modSettings['max_image_width']) || !empty($modSettings['max_image_height']))
|
||||
{
|
||||
// Find all the img tags - with or without width and height.
|
||||
preg_match_all('~\[img(\s+width=\d+)?(\s+height=\d+)?(\s+width=\d+)?\](.+?)\[/img\]~is', $message, $matches, PREG_PATTERN_ORDER);
|
||||
|
||||
$replaces = array();
|
||||
foreach ($matches[0] as $match => $dummy)
|
||||
{
|
||||
// If the width was after the height, handle it.
|
||||
$matches[1][$match] = !empty($matches[3][$match]) ? $matches[3][$match] : $matches[1][$match];
|
||||
|
||||
// Now figure out if they had a desired height or width...
|
||||
$desired_width = !empty($matches[1][$match]) ? (int) substr(trim($matches[1][$match]), 6) : 0;
|
||||
$desired_height = !empty($matches[2][$match]) ? (int) substr(trim($matches[2][$match]), 7) : 0;
|
||||
|
||||
// One was omitted, or both. We'll have to find its real size...
|
||||
if (empty($desired_width) || empty($desired_height))
|
||||
{
|
||||
list ($width, $height) = url_image_size(un_htmlspecialchars($matches[4][$match]));
|
||||
|
||||
// They don't have any desired width or height!
|
||||
if (empty($desired_width) && empty($desired_height))
|
||||
{
|
||||
$desired_width = $width;
|
||||
$desired_height = $height;
|
||||
}
|
||||
// Scale it to the width...
|
||||
elseif (empty($desired_width) && !empty($height))
|
||||
$desired_width = (int) (($desired_height * $width) / $height);
|
||||
// Scale if to the height.
|
||||
elseif (!empty($width))
|
||||
$desired_height = (int) (($desired_width * $height) / $width);
|
||||
}
|
||||
|
||||
// If the width and height are fine, just continue along...
|
||||
if ($desired_width <= $modSettings['max_image_width'] && $desired_height <= $modSettings['max_image_height'])
|
||||
continue;
|
||||
|
||||
// Too bad, it's too wide. Make it as wide as the maximum.
|
||||
if ($desired_width > $modSettings['max_image_width'] && !empty($modSettings['max_image_width']))
|
||||
{
|
||||
$desired_height = (int) (($modSettings['max_image_width'] * $desired_height) / $desired_width);
|
||||
$desired_width = $modSettings['max_image_width'];
|
||||
}
|
||||
|
||||
// Now check the height, as well. Might have to scale twice, even...
|
||||
if ($desired_height > $modSettings['max_image_height'] && !empty($modSettings['max_image_height']))
|
||||
{
|
||||
$desired_width = (int) (($modSettings['max_image_height'] * $desired_width) / $desired_height);
|
||||
$desired_height = $modSettings['max_image_height'];
|
||||
}
|
||||
|
||||
$replaces[$matches[0][$match]] = '[img' . (!empty($desired_width) ? ' width=' . $desired_width : '') . (!empty($desired_height) ? ' height=' . $desired_height : '') . ']' . $matches[4][$match] . '[/img]';
|
||||
}
|
||||
|
||||
// If any img tags were actually changed...
|
||||
if (!empty($replaces))
|
||||
$message = strtr($message, $replaces);
|
||||
}
|
||||
}
|
||||
|
||||
// Fix a specific class of tag - ie. url with =.
|
||||
function fixTag(&$message, $myTag, $protocols, $embeddedUrl = false, $hasEqualSign = false, $hasExtra = false)
|
||||
{
|
||||
global $boardurl, $scripturl;
|
||||
|
||||
if (preg_match('~^([^:]+://[^/]+)~', $boardurl, $match) != 0)
|
||||
$domain_url = $match[1];
|
||||
else
|
||||
$domain_url = $boardurl . '/';
|
||||
|
||||
$replaces = array();
|
||||
|
||||
if ($hasEqualSign)
|
||||
preg_match_all('~\[(' . $myTag . ')=([^\]]*?)\](?:(.+?)\[/(' . $myTag . ')\])?~is', $message, $matches);
|
||||
else
|
||||
preg_match_all('~\[(' . $myTag . ($hasExtra ? '(?:[^\]]*?)' : '') . ')\](.+?)\[/(' . $myTag . ')\]~is', $message, $matches);
|
||||
|
||||
foreach ($matches[0] as $k => $dummy)
|
||||
{
|
||||
// Remove all leading and trailing whitespace.
|
||||
$replace = trim($matches[2][$k]);
|
||||
$this_tag = $matches[1][$k];
|
||||
$this_close = $hasEqualSign ? (empty($matches[4][$k]) ? '' : $matches[4][$k]) : $matches[3][$k];
|
||||
|
||||
$found = false;
|
||||
foreach ($protocols as $protocol)
|
||||
{
|
||||
$found = strncasecmp($replace, $protocol . '://', strlen($protocol) + 3) === 0;
|
||||
if ($found)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$found && $protocols[0] == 'http')
|
||||
{
|
||||
if (substr($replace, 0, 1) == '/')
|
||||
$replace = $domain_url . $replace;
|
||||
elseif (substr($replace, 0, 1) == '?')
|
||||
$replace = $scripturl . $replace;
|
||||
elseif (substr($replace, 0, 1) == '#' && $embeddedUrl)
|
||||
{
|
||||
$replace = '#' . preg_replace('~[^A-Za-z0-9_\-#]~', '', substr($replace, 1));
|
||||
$this_tag = 'iurl';
|
||||
$this_close = 'iurl';
|
||||
}
|
||||
else
|
||||
$replace = $protocols[0] . '://' . $replace;
|
||||
}
|
||||
elseif (!$found)
|
||||
$replace = $protocols[0] . '://' . $replace;
|
||||
|
||||
if ($hasEqualSign && $embeddedUrl)
|
||||
$replaces[$matches[0][$k]] = '[' . $this_tag . '=' . $replace . ']' . (empty($matches[4][$k]) ? '' : $matches[3][$k] . '[/' . $this_close . ']');
|
||||
elseif ($hasEqualSign)
|
||||
$replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']';
|
||||
elseif ($embeddedUrl)
|
||||
$replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']' . $matches[2][$k] . '[/' . $this_close . ']';
|
||||
else
|
||||
$replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . ']' . $replace . '[/' . $this_close . ']';
|
||||
|
||||
}
|
||||
|
||||
foreach ($replaces as $k => $v)
|
||||
{
|
||||
if ($k == $v)
|
||||
unset($replaces[$k]);
|
||||
}
|
||||
|
||||
if (!empty($replaces))
|
||||
$message = strtr($message, $replaces);
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<?php
|
||||
/*
|
||||
MoparScape.org server status page
|
||||
|
@ -19,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function random_page(){
|
||||
mysql_con();
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
/**
|
||||
* The reCAPTCHA server URL's
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function register2(){
|
||||
forceLogin('register');
|
||||
|
@ -99,7 +99,8 @@ function register2(){
|
|||
}
|
||||
// make sure user and IP is not banned
|
||||
if (checkRows("SELECT `id` FROM `banned` WHERE `ip` = ? OR `uid` = ?", 'si', $ip, $uid)) {
|
||||
error("This server has been banned, contact moparisthebest on the forums for assistance.");
|
||||
global $g_admin_contact;
|
||||
error("This server has been banned, contact $g_admin_contact on the forums for assistance.");
|
||||
return;
|
||||
}
|
||||
// we know another server hasn't been posted by this user, because we would be in edit
|
||||
|
@ -118,7 +119,7 @@ function register2(){
|
|||
$verified = 1;
|
||||
if(!verifyIP($ip, &$resolved_ip, &$remote_ip)){
|
||||
$verified = 0;
|
||||
global $thispage;
|
||||
global $thispage, $g_admin_contact;
|
||||
$verify_url = $thispage."?action=verify&server=$ip&key=$key";
|
||||
$verify_msg = "<br />The server you posted, $ip, resolves to $resolved_ip, which does not match your ip, $remote_ip.\n<br />
|
||||
This means that you must verify that you own this IP by visiting this URL from the IP that you posted.<br />
|
||||
|
@ -127,10 +128,10 @@ function register2(){
|
|||
If you only have a command line, visit the URL with wget, curl, or an equivalent command to this:<br />
|
||||
<div class=\"codeheader\">Code:</div><div class=\"code\"><pre style=\"margin-top: 0; display: inline;\">wget -O- -q \"$verify_url\"</pre></div><br />
|
||||
The message you recieve will tell you if verification was successful.<br />
|
||||
If you have problems with this, PM Moparisthebest on the forums.";
|
||||
If you have problems with this, PM $g_admin_contact on the forums.";
|
||||
}
|
||||
|
||||
global $uname;
|
||||
global $uname, $g_admin_contact;
|
||||
// don't bother with pic_url, they can edit it if they are sponsored
|
||||
$sql = 'INSERT INTO `toadd` (`uid`, `uname`, `name`, `ip`, `port`, `version`, `time`, `info`, `ipaddress`, `rs_name`, `rs_pass`, `key`, `verified`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
|
||||
$stmt = $g_mysqli->prepare($sql) or debug($g_mysqli->error);
|
||||
|
@ -141,7 +142,7 @@ Password: <strong class=\"highlight\">$rs_pass</strong>\n<br />
|
|||
to make sure it is online, and if successful, it will be posted. <br />
|
||||
You must register this username and password for me on your server and allow it to be logged into from the IP 69.39.224.55<br />
|
||||
The server will be deleted from the queue if not verified and logged into within 24 hours of posting.<br />".$verify_msg;
|
||||
$fail_msg = 'Registration failed, PM <a href="http://www.moparscape.org/smf/index.php?action=profile;u=1">Moparisthebest</a> on the forums to with details so he can fix it.';
|
||||
$fail_msg = 'Registration failed, PM '.$g_admin_contact.' on the forums to with details so he can fix it.';
|
||||
}
|
||||
|
||||
// execute the query
|
||||
|
@ -279,9 +280,9 @@ function echoPostForm($edit = null){
|
|||
}
|
||||
|
||||
function echoForm($name, $ip, $port, $version, $message, $pic_url, $edit = false){
|
||||
global $g_versions;
|
||||
global $g_versions, $g_img_dir;
|
||||
if(isset($name))
|
||||
censorText($name);
|
||||
censor($name);
|
||||
$preview_message = $message;
|
||||
if(isset($preview_message)){
|
||||
// Do all bulletin board code tags, with smileys.
|
||||
|
@ -293,7 +294,7 @@ function echoForm($name, $ip, $port, $version, $message, $pic_url, $edit = false
|
|||
<?php echo $preview_message; ?>
|
||||
</div>
|
||||
|
||||
<form action="<?php echo actionURL('register2'); ?>" method="post" id="postmodify" onsubmit="submitonce(this);saveEntities();" enctype="multipart/form-data" style="margin: 0;">
|
||||
<form action="<?php echo actionURL('register2'); ?>" method="post" id="postmodify" onsubmit="submitonce(this);saveEntities();" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<table class="other" summary="Register your Server">
|
||||
<caption>
|
||||
|
@ -376,68 +377,68 @@ foreach($g_versions as $v)
|
|||
<a href="javascript:void(0);" onclick=
|
||||
"surroundText('[b]', '[/b]', document.forms.postmodify.message); return false;"><img onmouseover="bbc_highlight(this, true);"
|
||||
onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/bold.gif" width="23" height="22" alt="Bold" title=
|
||||
"<?php echo $g_img_dir; ?>/bbc/bold.gif" width="23" height="22" alt="Bold" title=
|
||||
"Bold" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[i]', '[/i]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/italicize.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/italicize.gif" width="23" height="22" alt=
|
||||
"Italicized" title="Italicized" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[u]', '[/u]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/underline.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/underline.gif" width="23" height="22" alt=
|
||||
"Underline" title="Underline" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[s]', '[/s]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/strike.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/strike.gif" width="23" height="22" alt=
|
||||
"Strikethrough" title="Strikethrough" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[shadow=red,left]', '[/shadow]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/shadow.gif" width="23" height="22" alt="Shadow"
|
||||
"<?php echo $g_img_dir; ?>/bbc/shadow.gif" width="23" height="22" alt="Shadow"
|
||||
title="Shadow" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[pre]', '[/pre]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/pre.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/pre.gif" width="23" height="22" alt=
|
||||
"Preformatted Text" title="Preformatted Text" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[left]', '[/left]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/left.gif" width="23" height="22" alt="Left Align"
|
||||
"<?php echo $g_img_dir; ?>/bbc/left.gif" width="23" height="22" alt="Left Align"
|
||||
title="Left Align" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[center]', '[/center]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/center.gif" width="23" height="22" alt="Centered"
|
||||
"<?php echo $g_img_dir; ?>/bbc/center.gif" width="23" height="22" alt="Centered"
|
||||
title="Centered" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[right]', '[/right]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/right.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/right.gif" width="23" height="22" alt=
|
||||
"Right Align" title="Right Align" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"replaceText('[hr]', document.forms.postmodify.message); return false;"><img onmouseover="bbc_highlight(this, true);"
|
||||
onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/hr.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/hr.gif" width="23" height="22" alt=
|
||||
"Horizontal Rule" title="Horizontal Rule" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[size=10pt]', '[/size]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/size.gif" width="23" height="22" alt="Font Size"
|
||||
"<?php echo $g_img_dir; ?>/bbc/size.gif" width="23" height="22" alt="Font Size"
|
||||
title="Font Size" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[font=Verdana]', '[/font]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/face.gif" width="23" height="22" alt="Font Face"
|
||||
"<?php echo $g_img_dir; ?>/bbc/face.gif" width="23" height="22" alt="Font Face"
|
||||
title="Font Face" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>
|
||||
<select onchange=
|
||||
"surroundText('[color=' + this.options[this.selectedIndex].value.toLowerCase() + ']', '[/color]', document.forms.postmodify.message); this.selectedIndex = 0; document.forms.postmodify.message.focus(document.forms.postmodify.message.caretPos);"
|
||||
style="margin-bottom: 1ex;">
|
||||
|
@ -490,73 +491,73 @@ foreach($g_versions as $v)
|
|||
<a href="javascript:void(0);" onclick=
|
||||
"surroundText('[img]', '[/img]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/img.gif" width="23" height="22" alt="Insert Image"
|
||||
"<?php echo $g_img_dir; ?>/bbc/img.gif" width="23" height="22" alt="Insert Image"
|
||||
title="Insert Image" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[url]', '[/url]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/url.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/url.gif" width="23" height="22" alt=
|
||||
"Insert Hyperlink" title="Insert Hyperlink" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[email]', '[/email]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/email.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/email.gif" width="23" height="22" alt=
|
||||
"Insert Email" title="Insert Email" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[ftp]', '[/ftp]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/ftp.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/ftp.gif" width="23" height="22" alt=
|
||||
"Insert FTP Link" title="Insert FTP Link" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[table]', '[/table]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/table.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/table.gif" width="23" height="22" alt=
|
||||
"Insert Table" title="Insert Table" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[tr]', '[/tr]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/tr.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/tr.gif" width="23" height="22" alt=
|
||||
"Insert Table Row" title="Insert Table Row" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[td]', '[/td]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/td.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/td.gif" width="23" height="22" alt=
|
||||
"Insert Table Column" title="Insert Table Column" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[sup]', '[/sup]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/sup.gif" width="23" height="22" alt="Superscript"
|
||||
"<?php echo $g_img_dir; ?>/bbc/sup.gif" width="23" height="22" alt="Superscript"
|
||||
title="Superscript" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[sub]', '[/sub]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/sub.gif" width="23" height="22" alt="Subscript"
|
||||
"<?php echo $g_img_dir; ?>/bbc/sub.gif" width="23" height="22" alt="Subscript"
|
||||
title="Subscript" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[tt]', '[/tt]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/tele.gif" width="23" height="22" alt="Teletype"
|
||||
"<?php echo $g_img_dir; ?>/bbc/tele.gif" width="23" height="22" alt="Teletype"
|
||||
title="Teletype" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[code]', '[/code]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/code.gif" width="23" height="22" alt="Insert Code"
|
||||
"<?php echo $g_img_dir; ?>/bbc/code.gif" width="23" height="22" alt="Insert Code"
|
||||
title="Insert Code" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><a href="javascript:void(0);"
|
||||
onclick="surroundText('[quote]', '[/quote]', document.forms.postmodify.message); return false;"><img onmouseover=
|
||||
"bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/quote.gif" width="23" height="22" alt=
|
||||
"<?php echo $g_img_dir; ?>/bbc/quote.gif" width="23" height="22" alt=
|
||||
"Insert Quote" title="Insert Quote" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="http://www.moparscape.org/images/bbc/divider.gif"
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a><img src="<?php echo $g_img_dir; ?>/bbc/divider.gif"
|
||||
alt="|" style="margin: 0 3px 0 3px;" /><a href="javascript:void(0);" onclick=
|
||||
"surroundText('[list]\n[li]', '[/li]\n[li][/li]\n[/list]', document.forms.postmodify.message); return false;"><img onmouseover="bbc_highlight(this, true);"
|
||||
onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src=
|
||||
"http://www.moparscape.org/images/bbc/list.gif" width="23" height="22" alt="Insert List"
|
||||
"<?php echo $g_img_dir; ?>/bbc/list.gif" width="23" height="22" alt="Insert List"
|
||||
title="Insert List" style=
|
||||
"background-image: url(http://www.moparscape.org/images/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>
|
||||
"background-image: url(<?php echo $g_img_dir; ?>/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -565,31 +566,31 @@ foreach($g_versions as $v)
|
|||
|
||||
<td valign="middle"><a href="javascript:void(0);" onclick=
|
||||
"replaceText(' :)', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/smile.gif" alt="Smiley" title="Smiley" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/smile.gif" alt="Smiley" title="Smiley" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' ;)', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/wink.gif" alt="Wink" title="Wink" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/wink.gif" alt="Wink" title="Wink" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :D', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/biggrin.gif" alt="Big Grin" title="Big Grin" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/biggrin.gif" alt="Big Grin" title="Big Grin" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :mad:', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/mad.gif" alt="Mad" title="Mad" /></a> <a href="javascript:void(0);"
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/mad.gif" alt="Mad" title="Mad" /></a> <a href="javascript:void(0);"
|
||||
onclick="replaceText(' :(', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/frown.gif" alt="Sad" title="Sad" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/frown.gif" alt="Sad" title="Sad" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :eek:', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/eek.gif" alt="Shocked" title="Shocked" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/eek.gif" alt="Shocked" title="Shocked" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :cool:', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/cool.gif" alt="Cool" title="Cool" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/cool.gif" alt="Cool" title="Cool" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :rolleyes:', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/rolleyes.gif" alt="Roll Eyes" title="Roll Eyes" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/rolleyes.gif" alt="Roll Eyes" title="Roll Eyes" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :P', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/tongue.gif" alt="Tongue" title="Tongue" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/tongue.gif" alt="Tongue" title="Tongue" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :o', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/redface.gif" alt="Embarrassed" title="Embarrassed" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/redface.gif" alt="Embarrassed" title="Embarrassed" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :confused:', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/confused.gif" alt="Confused" title="Confused" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/confused.gif" alt="Confused" title="Confused" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' :|', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/shifty.gif" alt="shifty" title="shifty" /></a> <a href=
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/shifty.gif" alt="shifty" title="shifty" /></a> <a href=
|
||||
"javascript:void(0);" onclick="replaceText(' ;D', document.forms.postmodify.message); return false;"><img src=
|
||||
"http://www.moparisthebest.com/smf/Smileys/vb/winkgrin.gif" alt="winksmile" title="winksmile" /></a></td>
|
||||
"<?php echo $g_img_dir; ?>/bbc/smileys/winkgrin.gif" alt="winksmile" title="winksmile" /></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function search(){
|
||||
forceLogin();
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
//
|
||||
// $Id: sphinxapi.php 2055 2009-11-06 23:09:58Z shodan $
|
||||
//
|
||||
|
|
|
@ -0,0 +1,917 @@
|
|||
<?php
|
||||
/*
|
||||
TbsZip version 2.11 (2012-02-14)
|
||||
Author : Skrol29 (email: http://www.tinybutstrong.com/onlyyou.html)
|
||||
Licence : LGPL
|
||||
This class is independent from any other classes and has been originally created for the OpenTbs plug-in
|
||||
for TinyButStrong Template Engine (TBS). OpenTbs makes TBS able to merge OpenOffice and Ms Office documents.
|
||||
Visit http://www.tinybutstrong.com
|
||||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
|
||||
function zipDir(clsTbsZip $zip, $folder_name, $path){
|
||||
zipDirLen($zip, $folder_name, strlen($path), $path);
|
||||
}
|
||||
|
||||
function zipDirLen(clsTbsZip $zip, $folder_name, $striplen, $path){
|
||||
$ignore = array( 'cgi-bin', '.', '..' );
|
||||
$dh = @opendir( $path );
|
||||
while(false !== ($file = readdir($dh)))
|
||||
if( !in_array( $file, $ignore ) ){
|
||||
$full_file = "$path/$file";
|
||||
if(is_dir($full_file))
|
||||
zipDirLen($zip, $folder_name, $striplen, $full_file);
|
||||
else
|
||||
$zip->FileAdd($folder_name.substr($path, $striplen).'/'.$file, $full_file, TBSZIP_FILE);
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
function zip_sources(){
|
||||
$zip = new clsTbsZip(); // create a new instance of the TbsZip class
|
||||
|
||||
$zip->CreateNew(); // start a new empty archive for adding files
|
||||
zipDir($zip, 'ss_sources', __DIR__);
|
||||
global $g_img_dir;
|
||||
zipDir($zip, 'images', $g_img_dir);
|
||||
|
||||
$zip->Flush(TBSZIP_DOWNLOAD, 'serverstatus.zip');
|
||||
|
||||
$zip->Close(); // stop to work with the opened archive. Modifications are not applied to the opened archive, use Flush() to commit
|
||||
}
|
||||
|
||||
define('TBSZIP_DOWNLOAD',1); // download (default)
|
||||
define('TBSZIP_NOHEADER',4); // option to use with DOWNLOAD: no header is sent
|
||||
define('TBSZIP_FILE',8); // output to file , or add from file
|
||||
define('TBSZIP_STRING',32); // output to string, or add from string
|
||||
|
||||
class clsTbsZip {
|
||||
|
||||
function __construct() {
|
||||
$this->Meth8Ok = extension_loaded('zlib'); // check if Zlib extension is available. This is need for compress and uncompress with method 8.
|
||||
$this->DisplayError = true;
|
||||
$this->ArchFile = '';
|
||||
$this->Error = false;
|
||||
}
|
||||
|
||||
function CreateNew($ArchName='new.zip') {
|
||||
// Create a new virtual empty archive, the name will be the default name when the archive is flushed.
|
||||
if (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility
|
||||
$this->Close(); // note that $this->ArchHnd is set to false here
|
||||
$this->Error = false;
|
||||
$this->ArchFile = $ArchName;
|
||||
$this->ArchIsNew = true;
|
||||
$bin = 'PK'.chr(05).chr(06).str_repeat(chr(0), 18);
|
||||
$this->CdEndPos = strlen($bin) - 4;
|
||||
$this->CdInfo = array('disk_num_curr'=>0, 'disk_num_cd'=>0, 'file_nbr_curr'=>0, 'file_nbr_tot'=>0, 'l_cd'=>0, 'p_cd'=>0, 'l_comm'=>0, 'v_comm'=>'', 'bin'=>$bin);
|
||||
$this->CdPos = $this->CdInfo['p_cd'];
|
||||
}
|
||||
|
||||
function Open($ArchFile) {
|
||||
// Open the zip archive
|
||||
if (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility
|
||||
$this->Close(); // close handle and init info
|
||||
$this->Error = false;
|
||||
$this->ArchFile = $ArchFile;
|
||||
$this->ArchIsNew = false;
|
||||
// open the file
|
||||
$this->ArchHnd = fopen($ArchFile, 'rb');
|
||||
$ok = !($this->ArchHnd===false);
|
||||
if ($ok) $ok = $this->CentralDirRead();
|
||||
return $ok;
|
||||
}
|
||||
|
||||
function Close() {
|
||||
if (isset($this->ArchHnd) and ($this->ArchHnd!==false)) fclose($this->ArchHnd);
|
||||
$this->ArchFile = '';
|
||||
$this->ArchHnd = false;
|
||||
$this->CdInfo = array();
|
||||
$this->CdFileLst = array();
|
||||
$this->CdFileNbr = 0;
|
||||
$this->CdFileByName = array();
|
||||
$this->VisFileLst = array();
|
||||
$this->ArchCancelModif();
|
||||
}
|
||||
|
||||
function ArchCancelModif() {
|
||||
$this->LastReadComp = false; // compression of the last read file (1=compressed, 0=stored not compressed, -1= stored compressed but read uncompressed)
|
||||
$this->LastReadIdx = false; // index of the last file read
|
||||
$this->ReplInfo = array();
|
||||
$this->ReplByPos = array();
|
||||
$this->AddInfo = array();
|
||||
}
|
||||
|
||||
function FileAdd($Name, $Data, $DataType=TBSZIP_STRING, $Compress=true) {
|
||||
|
||||
if ($Data===false) return $this->FileCancelModif($Name, false); // Cancel a previously added file
|
||||
|
||||
// Save information for adding a new file into the archive
|
||||
$Diff = 30 + 46 + 2*strlen($Name); // size of the header + cd info
|
||||
$Ref = $this->_DataCreateNewRef($Data, $DataType, $Compress, $Diff, $Name);
|
||||
if ($Ref===false) return false;
|
||||
$Ref['name'] = $Name;
|
||||
$this->AddInfo[] = $Ref;
|
||||
return $Ref['res'];
|
||||
|
||||
}
|
||||
|
||||
function CentralDirRead() {
|
||||
$cd_info = 'PK'.chr(05).chr(06); // signature of the Central Directory
|
||||
$cd_pos = -22;
|
||||
$this->_MoveTo($cd_pos, SEEK_END);
|
||||
$b = $this->_ReadData(4);
|
||||
if ($b!==$cd_info) return $this->RaiseError('The footer of the Central Directory is not found.');
|
||||
|
||||
$this->CdEndPos = ftell($this->ArchHnd) - 4;
|
||||
$this->CdInfo = $this->CentralDirRead_End($cd_info);
|
||||
$this->CdFileLst = array();
|
||||
$this->CdFileNbr = $this->CdInfo['file_nbr_curr'];
|
||||
$this->CdPos = $this->CdInfo['p_cd'];
|
||||
|
||||
if ($this->CdFileNbr<=0) return $this->RaiseError('No file found in the Central Directory.');
|
||||
if ($this->CdPos<=0) return $this->RaiseError('No position found for the Central Directory listing.');
|
||||
|
||||
$this->_MoveTo($this->CdPos);
|
||||
for ($i=0;$i<$this->CdFileNbr;$i++) {
|
||||
$x = $this->CentralDirRead_File($i);
|
||||
if ($x!==false) {
|
||||
$this->CdFileLst[$i] = $x;
|
||||
$this->CdFileByName[$x['v_name']] = $i;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function CentralDirRead_End($cd_info) {
|
||||
$b = $cd_info.$this->_ReadData(18);
|
||||
$x = array();
|
||||
$x['disk_num_curr'] = $this->_GetDec($b,4,2); // number of this disk
|
||||
$x['disk_num_cd'] = $this->_GetDec($b,6,2); // number of the disk with the start of the central directory
|
||||
$x['file_nbr_curr'] = $this->_GetDec($b,8,2); // total number of entries in the central directory on this disk
|
||||
$x['file_nbr_tot'] = $this->_GetDec($b,10,2); // total number of entries in the central directory
|
||||
$x['l_cd'] = $this->_GetDec($b,12,4); // size of the central directory
|
||||
$x['p_cd'] = $this->_GetDec($b,16,4); // offset of start of central directory with respect to the starting disk number
|
||||
$x['l_comm'] = $this->_GetDec($b,20,2); // .ZIP file comment length
|
||||
$x['v_comm'] = $this->_ReadData($x['l_comm']); // .ZIP file comment
|
||||
$x['bin'] = $b.$x['v_comm'];
|
||||
return $x;
|
||||
}
|
||||
|
||||
function CentralDirRead_File($idx) {
|
||||
|
||||
$b = $this->_ReadData(46);
|
||||
|
||||
$x = $this->_GetHex($b,0,4);
|
||||
if ($x!=='h:02014b50') return $this->RaiseError('Signature of file information not found in the Central Directory in position '.(ftell($this->ArchHnd)-46).' for file #'.$idx.'.');
|
||||
|
||||
$x = array();
|
||||
$x['vers_used'] = $this->_GetDec($b,4,2);
|
||||
$x['vers_necess'] = $this->_GetDec($b,6,2);
|
||||
$x['purp'] = $this->_GetBin($b,8,2);
|
||||
$x['meth'] = $this->_GetDec($b,10,2);
|
||||
$x['time'] = $this->_GetDec($b,12,2);
|
||||
$x['date'] = $this->_GetDec($b,14,2);
|
||||
$x['crc32'] = $this->_GetDec($b,16,4);
|
||||
$x['l_data_c'] = $this->_GetDec($b,20,4);
|
||||
$x['l_data_u'] = $this->_GetDec($b,24,4);
|
||||
$x['l_name'] = $this->_GetDec($b,28,2);
|
||||
$x['l_fields'] = $this->_GetDec($b,30,2);
|
||||
$x['l_comm'] = $this->_GetDec($b,32,2);
|
||||
$x['disk_num'] = $this->_GetDec($b,34,2);
|
||||
$x['int_file_att'] = $this->_GetDec($b,36,2);
|
||||
$x['ext_file_att'] = $this->_GetDec($b,38,4);
|
||||
$x['p_loc'] = $this->_GetDec($b,42,4);
|
||||
$x['v_name'] = $this->_ReadData($x['l_name']);
|
||||
$x['v_fields'] = $this->_ReadData($x['l_fields']);
|
||||
$x['v_comm'] = $this->_ReadData($x['l_comm']);
|
||||
|
||||
$x['bin'] = $b.$x['v_name'].$x['v_fields'].$x['v_comm'];
|
||||
|
||||
return $x;
|
||||
}
|
||||
|
||||
function RaiseError($Msg) {
|
||||
if ($this->DisplayError) echo '<strong>'.get_class($this).' ERROR :</strong> '.$Msg.'<br>'."\r\n";
|
||||
$this->Error = $Msg;
|
||||
return false;
|
||||
}
|
||||
|
||||
function Debug($FileHeaders=false) {
|
||||
|
||||
$this->DisplayError = true;
|
||||
|
||||
echo "<br />\r\n";
|
||||
echo "------------------<br/>\r\n";
|
||||
echo "Central Directory:<br/>\r\n";
|
||||
echo "------------------<br/>\r\n";
|
||||
print_r($this->CdInfo);
|
||||
|
||||
echo "<br />\r\n";
|
||||
echo "-----------------------------------<br/>\r\n";
|
||||
echo "File List in the Central Directory:<br/>\r\n";
|
||||
echo "-----------------------------------<br/>\r\n";
|
||||
print_r($this->CdFileLst);
|
||||
|
||||
if ($FileHeaders) {
|
||||
echo "<br/>\r\n";
|
||||
echo "------------------------------<br/>\r\n";
|
||||
echo "File List in the Data Section:<br/>\r\n";
|
||||
echo "------------------------------<br/>\r\n";
|
||||
$idx = 0;
|
||||
$pos = 0;
|
||||
$this->_MoveTo($pos);
|
||||
while ($ok = $this->_ReadFile($idx,false)) {
|
||||
$this->VisFileLst[$idx]['debug_pos'] = $pos;
|
||||
$pos = ftell($this->ArchHnd);
|
||||
$idx++;
|
||||
}
|
||||
print_r($this->VisFileLst);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function FileExists($NameOrIdx) {
|
||||
return ($this->FileGetIdx($NameOrIdx)!==false);
|
||||
}
|
||||
|
||||
function FileGetIdx($NameOrIdx) {
|
||||
// Check if a file name, or a file index exists in the Central Directory, and return its index
|
||||
if (is_string($NameOrIdx)) {
|
||||
if (isset($this->CdFileByName[$NameOrIdx])) {
|
||||
return $this->CdFileByName[$NameOrIdx];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (isset($this->CdFileLst[$NameOrIdx])) {
|
||||
return $NameOrIdx;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function FileGetIdxAdd($Name) {
|
||||
// Check if a file name exists in the list of file to add, and return its index
|
||||
if (!is_string($Name)) return false;
|
||||
$idx_lst = array_keys($this->AddInfo);
|
||||
foreach ($idx_lst as $idx) {
|
||||
if ($this->AddInfo[$idx]['name']===$Name) return $idx;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function FileRead($NameOrIdx, $Uncompress=true) {
|
||||
|
||||
$this->LastReadComp = false; // means the file is not found
|
||||
$this->LastReadIdx = false;
|
||||
|
||||
$idx = $this->FileGetIdx($NameOrIdx);
|
||||
if ($idx===false) return $this->RaiseError('File "'.$NameOrIdx.'" is not found in the Central Directory.');
|
||||
|
||||
$pos = $this->CdFileLst[$idx]['p_loc'];
|
||||
$this->_MoveTo($pos);
|
||||
|
||||
$this->LastReadIdx = $idx; // Can be usefull to get the idx
|
||||
|
||||
$Data = $this->_ReadFile($idx, true);
|
||||
|
||||
// Manage uncompression
|
||||
$Comp = 1; // means the contents stays compressed
|
||||
$meth = $this->CdFileLst[$idx]['meth'];
|
||||
if ($meth==8) {
|
||||
if ($Uncompress) {
|
||||
if ($this->Meth8Ok) {
|
||||
$Data = gzinflate($Data);
|
||||
$Comp = -1; // means uncompressed
|
||||
} else {
|
||||
$this->RaiseError('Unable to uncompress file "'.$NameOrIdx.'" because extension Zlib is not installed.');
|
||||
}
|
||||
}
|
||||
} elseif($meth==0) {
|
||||
$Comp = 0; // means stored without compression
|
||||
} else {
|
||||
if ($Uncompress) $this->RaiseError('Unable to uncompress file "'.$NameOrIdx.'" because it is compressed with method '.$meth.'.');
|
||||
}
|
||||
$this->LastReadComp = $Comp;
|
||||
|
||||
return $Data;
|
||||
|
||||
}
|
||||
|
||||
function _ReadFile($idx, $ReadData) {
|
||||
// read the file header (and maybe the data ) in the archive, assuming the cursor in at a new file position
|
||||
|
||||
$b = $this->_ReadData(30);
|
||||
|
||||
$x = $this->_GetHex($b,0,4);
|
||||
if ($x!=='h:04034b50') return $this->RaiseError('Signature of file information not found in the Data Section in position '.(ftell($this->ArchHnd)-30).' for file #'.$idx.'.');
|
||||
|
||||
$x = array();
|
||||
$x['vers'] = $this->_GetDec($b,4,2);
|
||||
$x['purp'] = $this->_GetBin($b,6,2);
|
||||
$x['meth'] = $this->_GetDec($b,8,2);
|
||||
$x['time'] = $this->_GetDec($b,10,2);
|
||||
$x['date'] = $this->_GetDec($b,12,2);
|
||||
$x['crc32'] = $this->_GetDec($b,14,4);
|
||||
$x['l_data_c'] = $this->_GetDec($b,18,4);
|
||||
$x['l_data_u'] = $this->_GetDec($b,22,4);
|
||||
$x['l_name'] = $this->_GetDec($b,26,2);
|
||||
$x['l_fields'] = $this->_GetDec($b,28,2);
|
||||
$x['v_name'] = $this->_ReadData($x['l_name']);
|
||||
$x['v_fields'] = $this->_ReadData($x['l_fields']);
|
||||
|
||||
$x['bin'] = $b.$x['v_name'].$x['v_fields'];
|
||||
|
||||
// Read Data
|
||||
$len_cd = $this->CdFileLst[$idx]['l_data_c'];
|
||||
if ($x['l_data_c']==0) {
|
||||
// Sometimes, the size is not specified in the local information.
|
||||
$len = $len_cd;
|
||||
} else {
|
||||
$len = $x['l_data_c'];
|
||||
if ($len!=$len_cd) {
|
||||
//echo "TbsZip Warning: Local information for file #".$idx." says len=".$len.", while Central Directory says len=".$len_cd.".";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ReadData) {
|
||||
$Data = $this->_ReadData($len);
|
||||
} else {
|
||||
$this->_MoveTo($len, SEEK_CUR);
|
||||
}
|
||||
|
||||
// Description information
|
||||
$desc_ok = ($x['purp'][2+3]=='1');
|
||||
if ($desc_ok) {
|
||||
$b = $this->_ReadData(16);
|
||||
$x['desc_bin'] = $b;
|
||||
$x['desc_sign'] = $this->_GetHex($b,0,4); // not specified in the documentation sign=h:08074b50
|
||||
$x['desc_crc32'] = $this->_GetDec($b,4,4);
|
||||
$x['desc_l_data_c'] = $this->_GetDec($b,8,4);
|
||||
$x['desc_l_data_u'] = $this->_GetDec($b,12,4);
|
||||
}
|
||||
|
||||
// Save file info without the data
|
||||
$this->VisFileLst[$idx] = $x;
|
||||
|
||||
// Return the info
|
||||
if ($ReadData) {
|
||||
return $Data;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function FileReplace($NameOrIdx, $Data, $DataType=TBSZIP_STRING, $Compress=true) {
|
||||
// Store replacement information.
|
||||
|
||||
$idx = $this->FileGetIdx($NameOrIdx);
|
||||
if ($idx===false) return $this->RaiseError('File "'.$NameOrIdx.'" is not found in the Central Directory.');
|
||||
|
||||
$pos = $this->CdFileLst[$idx]['p_loc'];
|
||||
|
||||
if ($Data===false) {
|
||||
// file to delete
|
||||
$this->ReplInfo[$idx] = false;
|
||||
$Result = true;
|
||||
} else {
|
||||
// file to replace
|
||||
$Diff = - $this->CdFileLst[$idx]['l_data_c'];
|
||||
$Ref = $this->_DataCreateNewRef($Data, $DataType, $Compress, $Diff, $NameOrIdx);
|
||||
if ($Ref===false) return false;
|
||||
$this->ReplInfo[$idx] = $Ref;
|
||||
$Result = $Ref['res'];
|
||||
}
|
||||
|
||||
$this->ReplByPos[$pos] = $idx;
|
||||
|
||||
return $Result;
|
||||
|
||||
}
|
||||
|
||||
function FileCancelModif($NameOrIdx, $ReplacedAndDeleted=true) {
|
||||
// cancel added, modified or deleted modifications on a file in the archive
|
||||
// return the number of cancels
|
||||
|
||||
$nbr = 0;
|
||||
|
||||
if ($ReplacedAndDeleted) {
|
||||
// replaced or deleted files
|
||||
$idx = $this->FileGetIdx($NameOrIdx);
|
||||
if ($idx!==false) {
|
||||
if (isset($this->ReplInfo[$idx])) {
|
||||
$pos = $this->CdFileLst[$idx]['p_loc'];
|
||||
unset($this->ReplByPos[$pos]);
|
||||
unset($this->ReplInfo[$idx]);
|
||||
$nbr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// added files
|
||||
$idx = $this->FileGetIdxAdd($NameOrIdx);
|
||||
if ($idx!==false) {
|
||||
unset($this->AddInfo[$idx]);
|
||||
$nbr++;
|
||||
}
|
||||
|
||||
return $nbr;
|
||||
|
||||
}
|
||||
|
||||
function Flush($Render=TBSZIP_DOWNLOAD, $File='', $ContentType='') {
|
||||
|
||||
if ( ($File!=='') && ($this->ArchFile===$File)) {
|
||||
$this->RaiseError('Method Flush() cannot overwrite the current opened archive: \''.$File.'\''); // this makes corrupted zip archives without PHP error.
|
||||
return false;
|
||||
}
|
||||
|
||||
$ArchPos = 0;
|
||||
$Delta = 0;
|
||||
$FicNewPos = array();
|
||||
$DelLst = array(); // idx of deleted files
|
||||
$DeltaCdLen = 0; // delta of the CD's size
|
||||
|
||||
$now = time();
|
||||
$date = $this->_MsDos_Date($now);
|
||||
$time = $this->_MsDos_Time($now);
|
||||
|
||||
if (!$this->OutputOpen($Render, $File, $ContentType)) return false;
|
||||
|
||||
// output modified zipped files and unmodified zipped files that are beetween them
|
||||
ksort($this->ReplByPos);
|
||||
foreach ($this->ReplByPos as $ReplPos => $ReplIdx) {
|
||||
// output data from the zip archive which is before the data to replace
|
||||
$this->OutputFromArch($ArchPos, $ReplPos);
|
||||
// get current file information
|
||||
if (!isset($this->VisFileLst[$ReplIdx])) $this->_ReadFile($ReplIdx, false);
|
||||
$FileInfo =& $this->VisFileLst[$ReplIdx];
|
||||
$b1 = $FileInfo['bin'];
|
||||
if (isset($FileInfo['desc_bin'])) {
|
||||
$b2 = $FileInfo['desc_bin'];
|
||||
} else {
|
||||
$b2 = '';
|
||||
}
|
||||
$info_old_len = strlen($b1) + $this->CdFileLst[$ReplIdx]['l_data_c'] + strlen($b2); // $FileInfo['l_data_c'] may have a 0 value in some archives
|
||||
// get replacement information
|
||||
$ReplInfo =& $this->ReplInfo[$ReplIdx];
|
||||
if ($ReplInfo===false) {
|
||||
// The file is to be deleted
|
||||
$Delta = $Delta - $info_old_len; // headers and footers are also deleted
|
||||
$DelLst[$ReplIdx] = true;
|
||||
} else {
|
||||
// prepare the header of the current file
|
||||
$this->_DataPrepare($ReplInfo); // get data from external file if necessary
|
||||
$this->_PutDec($b1, $time, 10, 2); // time
|
||||
$this->_PutDec($b1, $date, 12, 2); // date
|
||||
$this->_PutDec($b1, $ReplInfo['crc32'], 14, 4); // crc32
|
||||
$this->_PutDec($b1, $ReplInfo['len_c'], 18, 4); // l_data_c
|
||||
$this->_PutDec($b1, $ReplInfo['len_u'], 22, 4); // l_data_u
|
||||
if ($ReplInfo['meth']!==false) $this->_PutDec($b1, $ReplInfo['meth'], 8, 2); // meth
|
||||
// prepare the bottom description if the zipped file, if any
|
||||
if ($b2!=='') {
|
||||
$this->_PutDec($b2, $ReplInfo['crc32'], 4, 4); // crc32
|
||||
$this->_PutDec($b2, $ReplInfo['len_c'], 8, 4); // l_data_c
|
||||
$this->_PutDec($b2, $ReplInfo['len_u'], 12, 4); // l_data_u
|
||||
}
|
||||
// output data
|
||||
$this->OutputFromString($b1.$ReplInfo['data'].$b2);
|
||||
unset($ReplInfo['data']); // save PHP memory
|
||||
$Delta = $Delta + $ReplInfo['diff'] + $ReplInfo['len_c'];
|
||||
}
|
||||
// Update the delta of positions for zipped files which are physically after the currently replaced one
|
||||
for ($i=0;$i<$this->CdFileNbr;$i++) {
|
||||
if ($this->CdFileLst[$i]['p_loc']>$ReplPos) {
|
||||
$FicNewPos[$i] = $this->CdFileLst[$i]['p_loc'] + $Delta;
|
||||
}
|
||||
}
|
||||
// Update the current pos in the archive
|
||||
$ArchPos = $ReplPos + $info_old_len;
|
||||
}
|
||||
|
||||
// Ouput all the zipped files that remain before the Central Directory listing
|
||||
if ($this->ArchHnd!==false) $this->OutputFromArch($ArchPos, $this->CdPos); // ArchHnd is false if CreateNew() has been called
|
||||
$ArchPos = $this->CdPos;
|
||||
|
||||
// Output file to add
|
||||
$AddNbr = count($this->AddInfo);
|
||||
$AddDataLen = 0; // total len of added data (inlcuding file headers)
|
||||
if ($AddNbr>0) {
|
||||
$AddPos = $ArchPos + $Delta; // position of the start
|
||||
$AddLst = array_keys($this->AddInfo);
|
||||
foreach ($AddLst as $idx) {
|
||||
$n = $this->_DataOuputAddedFile($idx, $AddPos);
|
||||
$AddPos += $n;
|
||||
$AddDataLen += $n;
|
||||
}
|
||||
}
|
||||
|
||||
// Modifiy file information in the Central Directory for replaced files
|
||||
$b2 = '';
|
||||
$old_cd_len = 0;
|
||||
for ($i=0;$i<$this->CdFileNbr;$i++) {
|
||||
$b1 = $this->CdFileLst[$i]['bin'];
|
||||
$old_cd_len += strlen($b1);
|
||||
if (!isset($DelLst[$i])) {
|
||||
if (isset($FicNewPos[$i])) $this->_PutDec($b1, $FicNewPos[$i], 42, 4); // p_loc
|
||||
if (isset($this->ReplInfo[$i])) {
|
||||
$ReplInfo =& $this->ReplInfo[$i];
|
||||
$this->_PutDec($b1, $time, 12, 2); // time
|
||||
$this->_PutDec($b1, $date, 14, 2); // date
|
||||
$this->_PutDec($b1, $ReplInfo['crc32'], 16, 4); // crc32
|
||||
$this->_PutDec($b1, $ReplInfo['len_c'], 20, 4); // l_data_c
|
||||
$this->_PutDec($b1, $ReplInfo['len_u'], 24, 4); // l_data_u
|
||||
if ($ReplInfo['meth']!==false) $this->_PutDec($b1, $ReplInfo['meth'], 10, 2); // meth
|
||||
}
|
||||
$b2 .= $b1;
|
||||
}
|
||||
}
|
||||
$this->OutputFromString($b2);
|
||||
$ArchPos += $old_cd_len;
|
||||
$DeltaCdLen = $DeltaCdLen + strlen($b2) - $old_cd_len;
|
||||
|
||||
// Output until Central Directory footer
|
||||
if ($this->ArchHnd!==false) $this->OutputFromArch($ArchPos, $this->CdEndPos); // ArchHnd is false if CreateNew() has been called
|
||||
|
||||
// Output file information of the Central Directory for added files
|
||||
if ($AddNbr>0) {
|
||||
$b2 = '';
|
||||
foreach ($AddLst as $idx) {
|
||||
$b2 .= $this->AddInfo[$idx]['bin'];
|
||||
}
|
||||
$this->OutputFromString($b2);
|
||||
$DeltaCdLen += strlen($b2);
|
||||
}
|
||||
|
||||
// Output Central Directory footer
|
||||
$b2 = $this->CdInfo['bin'];
|
||||
$DelNbr = count($DelLst);
|
||||
if ( ($AddNbr>0) or ($DelNbr>0) ) {
|
||||
// total number of entries in the central directory on this disk
|
||||
$n = $this->_GetDec($b2, 8, 2);
|
||||
$this->_PutDec($b2, $n + $AddNbr - $DelNbr, 8, 2);
|
||||
// total number of entries in the central directory
|
||||
$n = $this->_GetDec($b2, 10, 2);
|
||||
$this->_PutDec($b2, $n + $AddNbr - $DelNbr, 10, 2);
|
||||
// size of the central directory
|
||||
$n = $this->_GetDec($b2, 12, 4);
|
||||
$this->_PutDec($b2, $n + $DeltaCdLen, 12, 4);
|
||||
$Delta = $Delta + $AddDataLen;
|
||||
}
|
||||
$this->_PutDec($b2, $this->CdPos+$Delta , 16, 4); // p_cd (offset of start of central directory with respect to the starting disk number)
|
||||
$this->OutputFromString($b2);
|
||||
|
||||
$this->OutputClose();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// ----------------
|
||||
// output functions
|
||||
// ----------------
|
||||
|
||||
function OutputOpen($Render, $File, $ContentType) {
|
||||
|
||||
if (($Render & TBSZIP_FILE)==TBSZIP_FILE) {
|
||||
$this->OutputMode = TBSZIP_FILE;
|
||||
if (''.$File=='') $File = basename($this->ArchFile).'.zip';
|
||||
$this->OutputHandle = @fopen($File, 'w');
|
||||
if ($this->OutputHandle===false) {
|
||||
$this->RaiseError('Method Flush() cannot overwrite the target file \''.$File.'\'. This may not be a valid file path or the file may be locked by another process or because of a denied permission.');
|
||||
return false;
|
||||
}
|
||||
} elseif (($Render & TBSZIP_STRING)==TBSZIP_STRING) {
|
||||
$this->OutputMode = TBSZIP_STRING;
|
||||
$this->OutputSrc = '';
|
||||
} elseif (($Render & TBSZIP_DOWNLOAD)==TBSZIP_DOWNLOAD) {
|
||||
$this->OutputMode = TBSZIP_DOWNLOAD;
|
||||
// Output the file
|
||||
if (''.$File=='') $File = basename($this->ArchFile);
|
||||
if (($Render & TBSZIP_NOHEADER)==TBSZIP_NOHEADER) {
|
||||
} else {
|
||||
header ('Pragma: no-cache');
|
||||
if ($ContentType!='') header ('Content-Type: '.$ContentType);
|
||||
header('Content-Disposition: attachment; filename="'.$File.'"');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Cache-Control: public');
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
$Len = $this->_EstimateNewArchSize();
|
||||
if ($Len!==false) header('Content-Length: '.$Len);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function OutputFromArch($pos, $pos_stop) {
|
||||
$len = $pos_stop - $pos;
|
||||
if ($len<0) return;
|
||||
$this->_MoveTo($pos);
|
||||
$block = 1024;
|
||||
while ($len>0) {
|
||||
$l = min($len, $block);
|
||||
$x = $this->_ReadData($l);
|
||||
$this->OutputFromString($x);
|
||||
$len = $len - $l;
|
||||
}
|
||||
unset($x);
|
||||
}
|
||||
|
||||
function OutputFromString($data) {
|
||||
if ($this->OutputMode===TBSZIP_DOWNLOAD) {
|
||||
echo $data; // donwload
|
||||
} elseif ($this->OutputMode===TBSZIP_STRING) {
|
||||
$this->OutputSrc .= $data; // to string
|
||||
} elseif (TBSZIP_FILE) {
|
||||
fwrite($this->OutputHandle, $data); // to file
|
||||
}
|
||||
}
|
||||
|
||||
function OutputClose() {
|
||||
if ( ($this->OutputMode===TBSZIP_FILE) && ($this->OutputHandle!==false) ) {
|
||||
fclose($this->OutputHandle);
|
||||
$this->OutputHandle = false;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------
|
||||
// Reading functions
|
||||
// ----------------
|
||||
|
||||
function _MoveTo($pos, $relative = SEEK_SET) {
|
||||
fseek($this->ArchHnd, $pos, $relative);
|
||||
}
|
||||
|
||||
function _ReadData($len) {
|
||||
if ($len>0) {
|
||||
$x = fread($this->ArchHnd, $len);
|
||||
return $x;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------
|
||||
// Take info from binary data
|
||||
// ----------------
|
||||
|
||||
function _GetDec($txt, $pos, $len) {
|
||||
$x = substr($txt, $pos, $len);
|
||||
$z = 0;
|
||||
for ($i=0;$i<$len;$i++) {
|
||||
$asc = ord($x[$i]);
|
||||
if ($asc>0) $z = $z + $asc*pow(256,$i);
|
||||
}
|
||||
return $z;
|
||||
}
|
||||
|
||||
function _GetHex($txt, $pos, $len) {
|
||||
$x = substr($txt, $pos, $len);
|
||||
return 'h:'.bin2hex(strrev($x));
|
||||
}
|
||||
|
||||
function _GetBin($txt, $pos, $len) {
|
||||
$x = substr($txt, $pos, $len);
|
||||
$z = '';
|
||||
for ($i=0;$i<$len;$i++) {
|
||||
$asc = ord($x[$i]);
|
||||
if (isset($x[$i])) {
|
||||
for ($j=0;$j<8;$j++) {
|
||||
$z .= ($asc & pow(2,$j)) ? '1' : '0';
|
||||
}
|
||||
} else {
|
||||
$z .= '00000000';
|
||||
}
|
||||
}
|
||||
return 'b:'.$z;
|
||||
}
|
||||
|
||||
// ----------------
|
||||
// Put info into binary data
|
||||
// ----------------
|
||||
|
||||
function _PutDec(&$txt, $val, $pos, $len) {
|
||||
$x = '';
|
||||
for ($i=0;$i<$len;$i++) {
|
||||
if ($val==0) {
|
||||
$z = 0;
|
||||
} else {
|
||||
$z = intval($val % 256);
|
||||
if (($val<0) && ($z!=0)) { // ($z!=0) is very important, example: val=-420085702
|
||||
// special opration for negative value. If the number id too big, PHP stores it into a signed integer. For example: crc32('coucou') => -256185401 instead of 4038781895. NegVal = BigVal - (MaxVal+1) = BigVal - 256^4
|
||||
$val = ($val - $z)/256 -1;
|
||||
$z = 256 + $z;
|
||||
} else {
|
||||
$val = ($val - $z)/256;
|
||||
}
|
||||
}
|
||||
$x .= chr($z);
|
||||
}
|
||||
$txt = substr_replace($txt, $x, $pos, $len);
|
||||
}
|
||||
|
||||
function _MsDos_Date($Timestamp = false) {
|
||||
// convert a date-time timstamp into the MS-Dos format
|
||||
$d = ($Timestamp===false) ? getdate() : getdate($Timestamp);
|
||||
return (($d['year']-1980)*512) + ($d['mon']*32) + $d['mday'];
|
||||
}
|
||||
function _MsDos_Time($Timestamp = false) {
|
||||
// convert a date-time timstamp into the MS-Dos format
|
||||
$d = ($Timestamp===false) ? getdate() : getdate($Timestamp);
|
||||
return ($d['hours']*2048) + ($d['minutes']*32) + intval($d['seconds']/2); // seconds are rounded to an even number in order to save 1 bit
|
||||
}
|
||||
|
||||
function _MsDos_Debug($date, $time) {
|
||||
// Display the formated date and time. Just for debug purpose.
|
||||
// date end time are encoded on 16 bits (2 bytes) : date = yyyyyyymmmmddddd , time = hhhhhnnnnnssssss
|
||||
$y = ($date & 65024)/512 + 1980;
|
||||
$m = ($date & 480)/32;
|
||||
$d = ($date & 31);
|
||||
$h = ($time & 63488)/2048;
|
||||
$i = ($time & 1984)/32;
|
||||
$s = ($time & 31) * 2; // seconds have been rounded to an even number in order to save 1 bit
|
||||
return $y.'-'.str_pad($m,2,'0',STR_PAD_LEFT).'-'.str_pad($d,2,'0',STR_PAD_LEFT).' '.str_pad($h,2,'0',STR_PAD_LEFT).':'.str_pad($i,2,'0',STR_PAD_LEFT).':'.str_pad($s,2,'0',STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
function _DataOuputAddedFile($Idx, $PosLoc) {
|
||||
|
||||
$Ref =& $this->AddInfo[$Idx];
|
||||
$this->_DataPrepare($Ref); // get data from external file if necessary
|
||||
|
||||
// Other info
|
||||
$now = time();
|
||||
$date = $this->_MsDos_Date($now);
|
||||
$time = $this->_MsDos_Time($now);
|
||||
$len_n = strlen($Ref['name']);
|
||||
$purp = 2048 ; // purpose // +8 to indicates that there is an extended local header
|
||||
|
||||
// Header for file in the data section
|
||||
$b = 'PK'.chr(03).chr(04).str_repeat(' ',26); // signature
|
||||
$this->_PutDec($b,20,4,2); //vers = 20
|
||||
$this->_PutDec($b,$purp,6,2); // purp
|
||||
$this->_PutDec($b,$Ref['meth'],8,2); // meth
|
||||
$this->_PutDec($b,$time,10,2); // time
|
||||
$this->_PutDec($b,$date,12,2); // date
|
||||
$this->_PutDec($b,$Ref['crc32'],14,4); // crc32
|
||||
$this->_PutDec($b,$Ref['len_c'],18,4); // l_data_c
|
||||
$this->_PutDec($b,$Ref['len_u'],22,4); // l_data_u
|
||||
$this->_PutDec($b,$len_n,26,2); // l_name
|
||||
$this->_PutDec($b,0,28,2); // l_fields
|
||||
$b .= $Ref['name']; // name
|
||||
$b .= ''; // fields
|
||||
|
||||
// Output the data
|
||||
$this->OutputFromString($b.$Ref['data']);
|
||||
$OutputLen = strlen($b) + $Ref['len_c']; // new position of the cursor
|
||||
unset($Ref['data']); // save PHP memory
|
||||
|
||||
// Information for file in the Central Directory
|
||||
$b = 'PK'.chr(01).chr(02).str_repeat(' ',42); // signature
|
||||
$this->_PutDec($b,20,4,2); // vers_used = 20
|
||||
$this->_PutDec($b,20,6,2); // vers_necess = 20
|
||||
$this->_PutDec($b,$purp,8,2); // purp
|
||||
$this->_PutDec($b,$Ref['meth'],10,2); // meth
|
||||
$this->_PutDec($b,$time,12,2); // time
|
||||
$this->_PutDec($b,$date,14,2); // date
|
||||
$this->_PutDec($b,$Ref['crc32'],16,4); // crc32
|
||||
$this->_PutDec($b,$Ref['len_c'],20,4); // l_data_c
|
||||
$this->_PutDec($b,$Ref['len_u'],24,4); // l_data_u
|
||||
$this->_PutDec($b,$len_n,28,2); // l_name
|
||||
$this->_PutDec($b,0,30,2); // l_fields
|
||||
$this->_PutDec($b,0,32,2); // l_comm
|
||||
$this->_PutDec($b,0,34,2); // disk_num
|
||||
$this->_PutDec($b,0,36,2); // int_file_att
|
||||
$this->_PutDec($b,0,38,4); // ext_file_att
|
||||
$this->_PutDec($b,$PosLoc,42,4); // p_loc
|
||||
$b .= $Ref['name']; // v_name
|
||||
$b .= ''; // v_fields
|
||||
$b .= ''; // v_comm
|
||||
|
||||
$Ref['bin'] = $b;
|
||||
|
||||
return $OutputLen;
|
||||
|
||||
}
|
||||
|
||||
function _DataCreateNewRef($Data, $DataType, $Compress, $Diff, $NameOrIdx) {
|
||||
|
||||
if (is_array($Compress)) {
|
||||
$result = 2;
|
||||
$meth = $Compress['meth'];
|
||||
$len_u = $Compress['len_u'];
|
||||
$crc32 = $Compress['crc32'];
|
||||
$Compress = false;
|
||||
} elseif ($Compress and ($this->Meth8Ok)) {
|
||||
$result = 1;
|
||||
$meth = 8;
|
||||
$len_u = false; // means unknown
|
||||
$crc32 = false;
|
||||
} else {
|
||||
$result = ($Compress) ? -1 : 0;
|
||||
$meth = 0;
|
||||
$len_u = false;
|
||||
$crc32 = false;
|
||||
$Compress = false;
|
||||
}
|
||||
|
||||
if ($DataType==TBSZIP_STRING) {
|
||||
$path = false;
|
||||
if ($Compress) {
|
||||
// we compress now in order to save PHP memory
|
||||
$len_u = strlen($Data);
|
||||
$crc32 = crc32($Data);
|
||||
$Data = gzdeflate($Data);
|
||||
$len_c = strlen($Data);
|
||||
} else {
|
||||
$len_c = strlen($Data);
|
||||
if ($len_u===false) {
|
||||
$len_u = $len_c;
|
||||
$crc32 = crc32($Data);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$path = $Data;
|
||||
$Data = false;
|
||||
if (file_exists($path)) {
|
||||
$fz = filesize($path);
|
||||
if ($len_u===false) $len_u = $fz;
|
||||
$len_c = ($Compress) ? false : $fz;
|
||||
} else {
|
||||
return $this->RaiseError("Cannot add the file '".$path."' because it is not found.");
|
||||
}
|
||||
}
|
||||
|
||||
// at this step $Data and $crc32 can be false only in case of external file, and $len_c is false only in case of external file to compress
|
||||
return array('data'=>$Data, 'path'=>$path, 'meth'=>$meth, 'len_u'=>$len_u, 'len_c'=>$len_c, 'crc32'=>$crc32, 'diff'=>$Diff, 'res'=>$result);
|
||||
|
||||
}
|
||||
|
||||
function _DataPrepare(&$Ref) {
|
||||
// returns the real size of data
|
||||
if ($Ref['path']!==false) {
|
||||
$Ref['data'] = file_get_contents($Ref['path']);
|
||||
if ($Ref['crc32']===false) $Ref['crc32'] = crc32($Ref['data']);
|
||||
if ($Ref['len_c']===false) {
|
||||
// means the data must be compressed
|
||||
$Ref['data'] = gzdeflate($Ref['data']);
|
||||
$Ref['len_c'] = strlen($Ref['data']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _EstimateNewArchSize($Optim=true) {
|
||||
// Return the size of the new archive, or false if it cannot be calculated (because of external file that must be compressed before to be insered)
|
||||
|
||||
if ($this->ArchIsNew) {
|
||||
$Len = strlen($this->CdInfo['bin']);
|
||||
} else {
|
||||
$Len = filesize($this->ArchFile);
|
||||
}
|
||||
|
||||
// files to replace or delete
|
||||
foreach ($this->ReplByPos as $i) {
|
||||
$Ref =& $this->ReplInfo[$i];
|
||||
if ($Ref===false) {
|
||||
// file to delete
|
||||
$Info =& $this->CdFileLst[$i];
|
||||
if (!isset($this->VisFileLst[$i])) {
|
||||
if ($Optim) return false; // if $Optimization is set to true, then we d'ont rewind to read information
|
||||
$this->_MoveTo($Info['p_loc']);
|
||||
$this->_ReadFile($i, false);
|
||||
}
|
||||
$Vis =& $this->VisFileLst[$i];
|
||||
$Len += -strlen($Vis['bin']) -strlen($Info['bin']) - $Info['l_data_c'];
|
||||
if (isset($Vis['desc_bin'])) $Len += -strlen($Vis['desc_bin']);
|
||||
} elseif ($Ref['len_c']===false) {
|
||||
return false; // information not yet known
|
||||
} else {
|
||||
// file to replace
|
||||
$Len += $Ref['len_c'] + $Ref['diff'];
|
||||
}
|
||||
}
|
||||
|
||||
// files to add
|
||||
$i_lst = array_keys($this->AddInfo);
|
||||
foreach ($i_lst as $i) {
|
||||
$Ref =& $this->AddInfo[$i];
|
||||
if ($Ref['len_c']===false) {
|
||||
return false; // information not yet known
|
||||
} else {
|
||||
$Len += $Ref['len_c'] + $Ref['diff'];
|
||||
}
|
||||
}
|
||||
|
||||
return $Len;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
/*
|
||||
MoparScape.org server status page
|
||||
Copyright (C) 2011 Travis Burtrum (moparisthebest)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
// echos the header
|
||||
function echoHeader($action) {
|
||||
global $thispage, $g_img_dir, $g_theme;
|
||||
/*echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";*/
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title><?php echo $g_theme['title']; ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $g_img_dir; ?>/default.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<div id="lefthead"> <a href="<?php echo $g_theme['left_link']; ?>"><img src="<?php echo $g_img_dir; ?>/left.png" alt="<?php echo $g_theme['left_link_alt']; ?>" /></a> </div>
|
||||
<div id="righthead"> <a href="<?php echo $g_theme['right_link']; ?>"><img src="<?php echo $g_img_dir; ?>/right.png" alt="<?php echo $g_theme['right_link_alt']; ?>" /></a> </div>
|
||||
<div id="banner"> <a href="<?php echo $g_theme['center_link']; ?>"><img src="<?php echo $g_img_dir; ?>/center.png" alt="<?php echo $g_theme['center_link_alt']; ?>" /></a> </div>
|
||||
|
||||
<ul id="nav">
|
||||
<li><a href="?"<?php if($action == 'display' && !isset($_GET['offline'])) echo ' class="on"'; ?>>Online Servers</a></li>
|
||||
<li><a href="?offline"<?php if($action == 'display' && isset($_GET['offline'])) echo ' class="on"'; ?>>Offline Servers</a></li>
|
||||
<li><a href="?sort=vote&desc<?php if(isset($_GET['offline'])) echo '&offline'; ?>"<?php if($action == 'display' && isset($_GET['sort']) && $_GET['sort'] == 'vote' && isset($_GET['desc'])) echo ' class="on"'; ?>>Most Popular</a></li>
|
||||
<li><a href="?action=random<?php if(isset($_GET['offline'])) echo '&offline'; ?>">Random Server</a></li>
|
||||
<li><a href="?action=register"<?php if($action == 'register' && !isset($_GET['edit'])) echo ' class="on"'; ?>>Register Server</a></li>
|
||||
<li><a href="?action=register&edit"<?php if($action == 'register' && isset($_GET['edit'])) echo ' class="on"'; ?>>Edit my Server</a></li>
|
||||
<li><a href="?action=search"<?php if(strpos($action, 'search') !== false) echo ' class="on"'; ?>>Search</a></li>
|
||||
<li><?php echoLogoutLink($thispage.'?'.$_SERVER['QUERY_STRING']); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="leftcolumn">
|
||||
<?php echoAdIfExists(); ?>
|
||||
</div>
|
||||
<div id="centercolumn">
|
||||
<?php echo $g_theme['header']; ?>
|
||||
<?php
|
||||
}
|
||||
|
||||
// echos the footer
|
||||
function echoFooter($uri){
|
||||
global $g_img_dir, $g_ss_version;
|
||||
?>
|
||||
</div>
|
||||
<div id="rightcolumn">
|
||||
<?php echoAdIfExists(); ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>
|
||||
<a href="http://validator.w3.org/check?uri=<?php echo $uri; ?>"><img
|
||||
src="<?php echo $g_img_dir; ?>/valid-xhtml10-blue.png"
|
||||
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
|
||||
<a style="color: black;" class="black" href="https://github.com/moparisthebest/Server-Status-Page">ServerStatus <?php echo $g_ss_version; ?></a> |
|
||||
<a style="color: black;" class="black" href="http://www.gnu.org/licenses/agpl-3.0.html">Copyright © 2009-2012</a>,
|
||||
<a style="color: black;" class="black" href="http://www.moparscape.org/smf/">MoparScape.org</a> |
|
||||
<a style="color: black;" class="black" href="?action=zip">Download</a>
|
||||
<a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo $uri; ?>"><img
|
||||
src="<?php echo $g_img_dir; ?>/vcss-blue.gif"
|
||||
alt="Valid CSS 2.1!" height="31" width="88" /></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php echoAnalyticsIfExists(); ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
?>
|
|
@ -17,39 +17,8 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//die('disabled for a moment, upgrading the page...');
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
|
||||
$thispage = 'http'.(isset($_SERVER['HTTPS']) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
|
||||
|
||||
function doSetup(){
|
||||
global $g_mysqli, $g_allowed_url, $g_allowed_alpha, $g_allowed_key, $g_allowed_dns, $thispage, $g_versions, $g_login_check;
|
||||
$g_allowed_url = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ /-:.%0123456789";
|
||||
$g_allowed_alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ";
|
||||
$g_allowed_key = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
$g_allowed_dns = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.";
|
||||
$g_versions = array(317, 508);
|
||||
|
||||
define('MSCP', 1);
|
||||
global $forumid;
|
||||
$forumid = 1;
|
||||
require_once('/path/to/smf/SSI.php');
|
||||
|
||||
global $user_info;
|
||||
$user = ssi_welcome('array');
|
||||
|
||||
// vars from SMF that we use, for easy compatibility for future versions
|
||||
global $groups, $time_format, $time_offset, $is_admin, $is_guest, $uname, $uid;
|
||||
$groups = $user_info['groups'];
|
||||
$time_format = $user_info['time_format'];
|
||||
# this is the number of seconds to add to time()
|
||||
$time_offset = $user_info['time_offset']*3600;
|
||||
$is_admin = $user['is_admin'] || $groups[0] == 2 || $groups[0] == 63 || in_array(70, $groups);
|
||||
$is_guest = $user['is_guest'];
|
||||
$uname = $user['name'];
|
||||
$uid = $user['id'];
|
||||
}
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function error($s){
|
||||
info($s, 'Error');
|
||||
|
@ -113,7 +82,7 @@ function forceLogin($action = null){
|
|||
return;
|
||||
|
||||
$g_login_check = 1;
|
||||
|
||||
//return;
|
||||
global $is_guest;
|
||||
if ($is_guest){
|
||||
global $thispage;
|
||||
|
@ -123,7 +92,7 @@ function forceLogin($action = null){
|
|||
$thisurl = $thispage.'?'.$_SERVER['QUERY_STRING'];
|
||||
|
||||
echo 'Enter your forum username and password to login:<br />';
|
||||
ssi_login($thisurl);
|
||||
echoLogin($thisurl);
|
||||
echoFooterExit();
|
||||
}else{
|
||||
global $uname, $time_format, $time_offset;
|
||||
|
@ -225,18 +194,13 @@ function getTimeStamp(){
|
|||
}
|
||||
|
||||
function mysql_con(){
|
||||
global $g_mysqli;
|
||||
global $g_mysqli, $g_sql_host, $g_sql_user, $g_sql_pass, $g_sql_db;
|
||||
|
||||
// then we are already connected
|
||||
if(isset($g_mysqli))
|
||||
return;
|
||||
|
||||
$host = 'localhost';
|
||||
$user = 'user';
|
||||
$pass = 'pass';
|
||||
$db = 'serverstat';
|
||||
|
||||
$g_mysqli = new mysqli($host, $user, $pass, $db);
|
||||
$g_mysqli = new mysqli($g_sql_host, $g_sql_user, $g_sql_pass, $g_sql_db);
|
||||
|
||||
/* check connection */
|
||||
if (mysqli_connect_errno()) {
|
||||
|
@ -248,6 +212,11 @@ function mysql_con(){
|
|||
if (!$g_mysqli->set_charset("utf8")) {
|
||||
printf("Error loading character set utf8: %s\n", $g_mysqli->error);
|
||||
}
|
||||
|
||||
$g_sql_host = '';
|
||||
$g_sql_user = '';
|
||||
$g_sql_pass = '';
|
||||
$g_sql_db = '';
|
||||
}
|
||||
|
||||
function close_mysql(){
|
||||
|
@ -268,74 +237,19 @@ function html_special_decode(&$bb_code){
|
|||
return htmlspecialchars_decode($bb_code, ENT_QUOTES);
|
||||
}
|
||||
|
||||
function bb2html($bb_code, $previewing = false){
|
||||
$bb_code = html_special($bb_code);
|
||||
//old preparsecode($bb_code);
|
||||
require_once('/path/to/smf/Sources/Subs-Post.php');
|
||||
preparsecode($bb_code, $previewing);
|
||||
|
||||
// Do all bulletin board code tags, with or without smileys.
|
||||
//old $bb_code = parse_bbc($bb_code, 1);
|
||||
|
||||
// require_once('/home/mopar/htdocs/moparisthebest.com/smf/Sources/Subs-Post.php');
|
||||
censorText($bb_code);
|
||||
$bb_code = parse_bbc($bb_code);
|
||||
|
||||
return $bb_code;
|
||||
// echos ad code if it exists
|
||||
function echoAdIfExists(){
|
||||
if(function_exists('echoAd')) {
|
||||
echoAd();
|
||||
}
|
||||
}
|
||||
|
||||
// echos the header
|
||||
function echoHeader($action) {
|
||||
global $thispage;
|
||||
//$action = (empty($_REQUEST['action'])) ? 'display' : $_REQUEST['action'];
|
||||
//<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
/*echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";*/
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>Mopar's Server Status Checker - Beta 2</title>
|
||||
<link rel="stylesheet" type="text/css" href="newstyle.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<div id="lefthead"> <a href="http://www.moparscape.org/smf/index.php"><img src="images/visit.png" alt="Visit Forums" /></a> </div>
|
||||
<div id="righthead"> <a href="http://www.moparscape.org/moparscape.html"><img src="images/dlmoparscape.png" alt="Download MoparScape Here!" /></a> </div>
|
||||
<div id="banner"> <a href="http://www.moparscape.org/serverstatus.php"><img src="images/mscp_banner.png" alt="MoparScape Server Status" /></a> </div>
|
||||
|
||||
<ul id="nav">
|
||||
<li><a href="?"<?php if($action == 'display' && !isset($_GET['offline'])) echo ' class="on"'; ?>>Online Servers</a></li>
|
||||
<li><a href="?offline"<?php if($action == 'display' && isset($_GET['offline'])) echo ' class="on"'; ?>>Offline Servers</a></li>
|
||||
<li><a href="?sort=vote&desc<?php if(isset($_GET['offline'])) echo '&offline'; ?>"<?php if($action == 'display' && isset($_GET['sort']) && $_GET['sort'] == 'vote' && isset($_GET['desc'])) echo ' class="on"'; ?>>Most Popular</a></li>
|
||||
<li><a href="?action=random<?php if(isset($_GET['offline'])) echo '&offline'; ?>">Random Server</a></li>
|
||||
<li><a href="?action=register"<?php if($action == 'register' && !isset($_GET['edit'])) echo ' class="on"'; ?>>Register Server</a></li>
|
||||
<li><a href="?action=register&edit"<?php if($action == 'register' && isset($_GET['edit'])) echo ' class="on"'; ?>>Edit my Server</a></li>
|
||||
<li><a href="?action=search"<?php if(strpos($action, 'search') !== false) echo ' class="on"'; ?>>Search</a></li>
|
||||
<li><?php ssi_logout($thispage.'?'.$_SERVER['QUERY_STRING']); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="leftcolumn">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "ca-pub-3055920918910714";
|
||||
/* serverstatus */
|
||||
google_ad_slot = "0121476779";
|
||||
google_ad_width = 160;
|
||||
google_ad_height = 600;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</div>
|
||||
<div id="centercolumn">
|
||||
This new page is beta, servers may be added and deleted while I finish it. Thanks for being patient. Post
|
||||
comments about the new page <a href="http://www.moparscape.org/smf/index.php/topic,363862.0.html">here</a>.<br /><br />
|
||||
<?php
|
||||
}
|
||||
// echos ad code if it exists
|
||||
function echoAnalyticsIfExists(){
|
||||
if(function_exists('echoAnalytics')) {
|
||||
echoAnalytics();
|
||||
}
|
||||
}
|
||||
|
||||
// echos the footer and then exits
|
||||
function echoFooterExit($echo = ''){
|
||||
|
@ -344,138 +258,7 @@ function echoFooterExit($echo = ''){
|
|||
// can call this because it only closes it if it is set
|
||||
close_mysql();
|
||||
echo $echo;
|
||||
?>
|
||||
</div>
|
||||
<div id="rightcolumn">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "ca-pub-3055920918910714";
|
||||
/* serverstatus */
|
||||
google_ad_slot = "0121476779";
|
||||
google_ad_width = 160;
|
||||
google_ad_height = 600;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>
|
||||
<a href="http://validator.w3.org/check?uri=<?php echo $uri; ?>"><img
|
||||
src="images/valid-xhtml10-blue.png"
|
||||
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
|
||||
Copyright © 2009 MoparScape.org
|
||||
<a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo $uri; ?>"><img
|
||||
src="images/vcss-blue.gif"
|
||||
alt="Valid CSS 2.1!" height="31" width="88" /></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-6877554-1");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
echoFooter($uri);
|
||||
exit;
|
||||
}
|
||||
/*
|
||||
DROP TABLE IF EXISTS `toadd`;
|
||||
CREATE TABLE IF NOT EXISTS `toadd` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`uid` mediumint(8) unsigned NOT NULL,
|
||||
`uname` varchar(80) NOT NULL,
|
||||
`online` tinyint(1) unsigned NOT NULL default '1',
|
||||
`name` tinytext NOT NULL,
|
||||
`pic_url` tinytext NOT NULL default '',
|
||||
`ip` varchar(30) NOT NULL,
|
||||
`port` smallint(5) unsigned NOT NULL,
|
||||
`version` smallint(3) unsigned NOT NULL,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`info` text NOT NULL,
|
||||
`oncount` int(11) unsigned NOT NULL default '1',
|
||||
`totalcount` int(11) unsigned NOT NULL default '1',
|
||||
`uptime` tinyint(3) unsigned NOT NULL default '100',
|
||||
`ipaddress` varchar(15) NOT NULL,
|
||||
`sponsored` smallint(5) unsigned NOT NULL default '0',
|
||||
`rs_name` tinytext NOT NULL,
|
||||
`rs_pass` tinytext NOT NULL,
|
||||
`key` varchar(15) NOT NULL,
|
||||
`verified` tinyint(1) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`),
|
||||
KEY `online` (`online`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `banned`;
|
||||
CREATE TABLE IF NOT EXISTS `banned` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`uid` mediumint(8) unsigned NOT NULL,
|
||||
`uname` varchar(80) NOT NULL,
|
||||
`online` tinyint(1) unsigned NOT NULL default '1',
|
||||
`name` tinytext NOT NULL,
|
||||
`pic_url` tinytext NOT NULL default '',
|
||||
`ip` varchar(30) NOT NULL,
|
||||
`port` smallint(5) unsigned NOT NULL,
|
||||
`version` smallint(3) unsigned NOT NULL,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`info` text NOT NULL,
|
||||
`oncount` int(11) unsigned NOT NULL default '1',
|
||||
`totalcount` int(11) unsigned NOT NULL default '1',
|
||||
`uptime` tinyint(3) unsigned NOT NULL default '100',
|
||||
`ipaddress` varchar(15) NOT NULL,
|
||||
`sponsored` smallint(5) unsigned NOT NULL default '0',
|
||||
`rs_name` tinytext NOT NULL,
|
||||
`rs_pass` tinytext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`),
|
||||
KEY `online` (`online`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
|
||||
DROP TABLE IF EXISTS `servers`;
|
||||
CREATE TABLE IF NOT EXISTS `servers` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`uid` mediumint(8) unsigned NOT NULL,
|
||||
`uname` varchar(80) NOT NULL,
|
||||
`online` tinyint(1) unsigned NOT NULL default '1',
|
||||
`name` tinytext NOT NULL,
|
||||
`pic_url` tinytext NOT NULL,
|
||||
`ip` varchar(30) NOT NULL,
|
||||
`port` smallint(5) unsigned NOT NULL,
|
||||
`version` smallint(3) unsigned NOT NULL,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`info` text NOT NULL,
|
||||
`oncount` int(11) unsigned NOT NULL default '1',
|
||||
`totalcount` int(11) unsigned NOT NULL default '1',
|
||||
`uptime` tinyint(3) unsigned NOT NULL default '100',
|
||||
`ipaddress` varchar(15) NOT NULL,
|
||||
`sponsored` smallint(5) unsigned NOT NULL default '0',
|
||||
`rs_name` tinytext NOT NULL,
|
||||
`rs_pass` tinytext NOT NULL,
|
||||
`vote` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`),
|
||||
KEY `online` (`online`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
|
||||
DROP TABLE IF EXISTS `log_voted`;
|
||||
CREATE TABLE IF NOT EXISTS `log_voted` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`uid` mediumint(8) unsigned NOT NULL,
|
||||
`uname` varchar(80) NOT NULL,
|
||||
`server_id` int(11) unsigned NOT NULL,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`ip` varchar(15) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
*/
|
||||
?>
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function verify(){
|
||||
header("Content-type: text/plain");
|
||||
|
@ -92,7 +92,8 @@ Password: $rs_pass\n
|
|||
to make sure it is online, and if successful, it will be posted.";
|
||||
}else{
|
||||
writeToFile("strange failure");
|
||||
echo "Strange failure, PM Moparisthebest on the forums to with details so he can fix it.\n";
|
||||
global $g_admin_contact;
|
||||
echo "Strange failure, PM ".strip_tags($g_admin_contact)." on the forums to with details so he can fix it.\n";
|
||||
}
|
||||
$stmt->close();
|
||||
|
||||
|
|
|
@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function view(){
|
||||
//echo 'this is view';
|
||||
mysql_con();
|
||||
global $g_mysqli;
|
||||
global $g_mysqli, $g_img_dir;
|
||||
$stmt = $g_mysqli->prepare('SELECT `name`, `pic_url`, `uid`, `uname`, `ip`, `port`, `version`, `uptime`, `time`, `info`, `online`, `sponsored`, `vote` FROM `servers` WHERE `ip` = ? LIMIT 1') or debug($g_mysqli->error);
|
||||
$stmt->bind_param("s", $_GET['server']);
|
||||
$stmt->execute();
|
||||
|
@ -36,14 +36,8 @@ function view(){
|
|||
$stmt->close();
|
||||
close_mysql();
|
||||
|
||||
if($online == 1){
|
||||
$link = "http://www.moparscape.org/index.php?server=%s&port=%s&version=%s&detail=";
|
||||
$link = sprintf($link, $ip, $port, $version);
|
||||
$play = '<a href="%s0">High</a> / <a href="%s1">Low</a>';
|
||||
$play = sprintf($play, $link, $link);
|
||||
}else{
|
||||
$play = '<div class="offline">Server Offline!</div>';
|
||||
}
|
||||
// todo: common code to generate table here as in display.php
|
||||
$play = echoPlay($online, $ip, $port, $version);
|
||||
|
||||
$info = bb2html($info);
|
||||
|
||||
|
@ -98,7 +92,7 @@ function selectText()
|
|||
|
||||
<table class="<?php echo ($spons == 0) ? 'other' : 'spons'; ?>" summary="<?php echo $name; ?>">
|
||||
<caption>
|
||||
<?php echo ($pic_url != '') ? '<img src="'.$pic_url.'" alt="'.$name.'" width="185" height="25" />' : $name; ?>
|
||||
<?php echo ($pic_url != '' && $spons != 0) ? '<img src="'.$pic_url.'" alt="'.$name.'" width="185" height="25" />' : $name; ?>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -136,11 +130,11 @@ function selectText()
|
|||
<td><?php echo $ip; ?></td>
|
||||
<td><?php echo $port; ?></td>
|
||||
<td><?php echo $version; ?></td>
|
||||
<td><a href="http://www.moparscape.org/smf/index.php?action=profile;u=<?php echo $uid; ?>"><?php echo $uname; ?></a></td>
|
||||
<td><a href="<?php echo urlForUid($uid); ?>"><?php echo $uname; ?></a></td>
|
||||
<td><?php echo $uptime; ?>%</td>
|
||||
<td><?php echo date("m-d-y", $time); ?></td>
|
||||
<td><?php echo ($votes > 0) ? '+'.$votes: $votes; ?></td>
|
||||
<td><a href="<?php echo $thispage ?>?action=up&server=<?php echo $ip ?>"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/images/up.png" alt="Up" /></a><a href="<?php echo $thispage ?>?action=down&server=<?php echo $ip ?>"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/images/down.png" alt="Down" /></a></td>
|
||||
<td><a href="<?php echo $thispage ?>?action=up&server=<?php echo $ip ?>"><img src="<?php echo $g_img_dir; ?>/up.png" alt="Up" /></a><a href="<?php echo $thispage ?>?action=down&server=<?php echo $ip ?>"><img src="<?php echo $g_img_dir; ?>/down.png" alt="Down" /></a></td>
|
||||
<td><?php echo $play; ?></td>
|
||||
<?php
|
||||
if(can_mod() && $spons == 0){
|
||||
|
|
|
@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
if (!defined('SS_PAGE'))
|
||||
die('Hacking attempt...');
|
||||
die(highlight_file(__FILE__, true));
|
||||
|
||||
function vote(){
|
||||
// forceLogin();
|
||||
|
||||
global $uid;
|
||||
global $uid, $recaptcha_pubkey;
|
||||
|
||||
$action = $_GET['action'];
|
||||
|
||||
|
@ -49,9 +49,10 @@ function vote(){
|
|||
<input type="hidden" name="ip" value="<?php echo $ip; ?>" />
|
||||
|
||||
<?php
|
||||
require_once('recaptchalib.php');
|
||||
$publickey = "6LddIr4SAAAAALtdzE4zN3pkquo40zhRrOlab-Gf "; // you got this from the signup page
|
||||
echo recaptcha_get_html($publickey, null, ($_SERVER['HTTPS'] == "on") );
|
||||
if(!empty($recaptcha_pubkey)){
|
||||
require_once('recaptchalib.php');
|
||||
echo recaptcha_get_html($recaptcha_pubkey, null, ($_SERVER['HTTPS'] == "on") );
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="submit" name="submit" value="Vote" accesskey="s" />
|
||||
|
@ -61,10 +62,9 @@ function vote(){
|
|||
}
|
||||
|
||||
function vote2(){
|
||||
// $_SERVER['HTTP_REFERER'] : http://mopar.moparscape.org/serverstatus.php?action=up&server=72.9.251.24
|
||||
// forceLogin();
|
||||
|
||||
global $uid, $uname, $thispage, $time_format, $time_offset, $g_mysqli;
|
||||
global $uid, $uname, $thispage, $time_format, $time_offset, $g_mysqli, $recaptcha_privkey;
|
||||
|
||||
//wait time in seconds to vote again
|
||||
$wait_time = 3600;
|
||||
|
@ -74,12 +74,13 @@ function vote2(){
|
|||
if($action != 'up' && $action != 'down')
|
||||
forward();
|
||||
|
||||
require_once('recaptchalib.php');
|
||||
$privatekey = "6LddIr4SAAAAAIPlo9971NoHMx2HCUbHATsQVSX5";
|
||||
$resp = recaptcha_check_answer ($privatekey,
|
||||
$_SERVER["REMOTE_ADDR"],
|
||||
$_POST["recaptcha_challenge_field"],
|
||||
$_POST["recaptcha_response_field"]);
|
||||
if(!empty($recaptcha_privkey)){
|
||||
require_once('recaptchalib.php');
|
||||
$resp = recaptcha_check_answer ($recaptcha_privkey,
|
||||
$_SERVER["REMOTE_ADDR"],
|
||||
$_POST["recaptcha_challenge_field"],
|
||||
$_POST["recaptcha_response_field"]);
|
||||
}
|
||||
|
||||
if (!$resp->is_valid) {
|
||||
// What happens when the CAPTCHA was entered incorrectly
|
||||
|
@ -141,7 +142,8 @@ function vote2(){
|
|||
// execute the query
|
||||
$stmt->execute();
|
||||
if ($stmt->affected_rows != 1) {
|
||||
echo 'Vote failed, PM <a href="http://www.moparscape.org/smf/index.php?action=profile;u=1">Moparisthebest</a> on the forums to with details so he can fix it.';
|
||||
global $g_admin_contact;
|
||||
echo 'Vote failed, PM '.$g_admin_contact.' on the forums to with details so he can fix it.';
|
||||
return;
|
||||
}
|
||||
$stmt->close();
|
||||
|
@ -153,7 +155,8 @@ function vote2(){
|
|||
$stmt->bind_param("isiiss", $uid, $uname, $id, $_SESSION['last_voted'], $_SERVER['REMOTE_ADDR'], $op);
|
||||
$stmt->execute() or debug($g_mysqli->error);
|
||||
if ($stmt->affected_rows != 1) {
|
||||
echo 'Vote log failed, PM <a href="http://www.moparscape.org/smf/index.php?action=profile;u=1">Moparisthebest</a> on the forums to with details so he can fix it.';
|
||||
global $g_admin_contact;
|
||||
echo 'Vote log failed, PM '.$g_admin_contact.' on the forums to with details so he can fix it.';
|
||||
return;
|
||||
}
|
||||
$stmt->close();
|
||||
|
@ -181,4 +184,4 @@ function getMysqlId($server, &$id, &$suid, &$name, &$ip){
|
|||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|