Initial commit
675
LICENCE
Normal file
|
|
@ -0,0 +1,675 @@
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 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 General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is 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. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
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.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
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 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. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
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 Affero 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 special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU 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 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 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 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 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU 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 the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
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 GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
|
||||||
68
add_declare.php
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$mode = $_POST['mode'];
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("add_declare");
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($mode == 'addit') {
|
||||||
|
$declarator = $user['id'];
|
||||||
|
$declarator_name = addslashes(htmlspecialchars($user['username']));
|
||||||
|
$decl1 = addslashes(htmlspecialchars($_POST['dec1']));
|
||||||
|
$decl2 = addslashes(htmlspecialchars($_POST['dec2']));
|
||||||
|
$decl3 = addslashes(htmlspecialchars($_POST['dec3']));
|
||||||
|
$reason1 = addslashes(htmlspecialchars($_POST['reason']));
|
||||||
|
|
||||||
|
$QryDeclare = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryDeclare .= "`declarator` = '". $declarator ."', ";
|
||||||
|
$QryDeclare .= "`declarator_name` = '". $declarator_name ."', "; $QryDeclare .= "`declared_1` = '". $decl1 ."', ";
|
||||||
|
$QryDeclare .= "`declared_2` = '". $decl2 ."', ";
|
||||||
|
$QryDeclare .= "`declared_3` = '". $decl3 ."', ";
|
||||||
|
$QryDeclare .= "`reason` = '". $reason1 ."' ";
|
||||||
|
|
||||||
|
doquery( $QryDeclare, "declared");
|
||||||
|
doquery("UPDATE {{table}} SET multi_validated ='1' WHERE username='{$user['username']}'","users");
|
||||||
|
|
||||||
|
AdminMessage ( "Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout" );
|
||||||
|
}
|
||||||
|
$Page = parsetemplate($PageTpl, $parse);
|
||||||
|
|
||||||
|
display ($Page, "Declaration d\'IP partagee", false, '', true);
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
79
admin/ElementQueueFixer.php
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$QrySelectPlanet = "SELECT `id`, `id_owner`, `b_hangar`, `b_hangar_id` ";
|
||||||
|
$QrySelectPlanet .= "FROM {{table}} ";
|
||||||
|
$QrySelectPlanet .= "WHERE ";
|
||||||
|
$QrySelectPlanet .= "`b_hangar_id` != '0';";
|
||||||
|
$AffectedPlanets = doquery ($QrySelectPlanet, 'planets');
|
||||||
|
$DeletedQueues = 0;
|
||||||
|
while ( $ActualPlanet = mysql_fetch_assoc($AffectedPlanets) ) {
|
||||||
|
$HangarQueue = explode (";", $ActualPlanet['b_hangar_id']);
|
||||||
|
$bDelQueue = false;
|
||||||
|
if (count($HangarQueue)) {
|
||||||
|
for ( $Queue = 0; $Queue < count($HangarQueue); $Queue++) {
|
||||||
|
$InQueue = explode (",", $HangarQueue[$Queue]);
|
||||||
|
if ($InQueue[1] > MAX_FLEET_OR_DEFS_PER_ROW) {
|
||||||
|
$bDelQueue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($bDelQueue) {
|
||||||
|
$QryUpdatePlanet = "UPDATE {{table}} ";
|
||||||
|
$QryUpdatePlanet .= "SET ";
|
||||||
|
$QryUpdatePlanet .= "`b_hangar` = '0', ";
|
||||||
|
$QryUpdatePlanet .= "`b_hangar_id` = '0' ";
|
||||||
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
|
$QryUpdatePlanet .= "`id` = '".$ActualPlanet['id']."';";
|
||||||
|
doquery ($QryUpdatePlanet, 'planets');
|
||||||
|
$DeletedQueues += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($DeletedQueues > 0) {
|
||||||
|
$QuitMessage = $lang['adm_cleaned']." ". $DeletedQueues;
|
||||||
|
} else {
|
||||||
|
$QuitMessage = $lang['adm_done'];
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminMessage ($QuitMessage, $lang['adm_cleaner_title']);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
59
admin/QueryExecute.php
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
includeLang('admin/Queries');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($_POST['really_do_it'] == 'on') {
|
||||||
|
|
||||||
|
mysql_query ($_POST['qry_sql']);
|
||||||
|
AdminMessage ($lang['qry_succesful'], 'Succes', '?');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/exec_query");
|
||||||
|
$Page = parsetemplate( $PageTpl, $parse);
|
||||||
|
|
||||||
|
display( $Page, $lang['qry_title'], false, '', true );
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
50
admin/ShowFlyingFleets.php
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin/fleets');
|
||||||
|
$PageTPL = gettemplate('admin/fleet_body');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['flt_table'] = BuildFlyingFleetTable ();
|
||||||
|
|
||||||
|
$page = parsetemplate( $PageTPL, $parse );
|
||||||
|
display ( $page, $lang['flt_title'], false, '', true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
138
admin/XNovaResetUnivers.php
Normal file
|
|
@ -0,0 +1,138 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
function XNovaResetUnivers ( $CurrentUser ) {
|
||||||
|
global $lang;
|
||||||
|
|
||||||
|
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
|
||||||
|
// Copier la table users et planets vers des tables de replis !
|
||||||
|
doquery( "RENAME TABLE {{table}} TO {{table}}_s", 'planets');
|
||||||
|
doquery( "RENAME TABLE {{table}} TO {{table}}_s", 'users');
|
||||||
|
doquery( "RENAME TABLE {{table}} TO {{table}}_s", 'galaxy');
|
||||||
|
doquery( "RENAME TABLE {{table}} TO {{table}}_s", 'banned');
|
||||||
|
|
||||||
|
// Recreer la structure des tables renommées
|
||||||
|
doquery( "CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'planets');
|
||||||
|
doquery( "CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'users');
|
||||||
|
doquery( "CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'galaxy');
|
||||||
|
doquery( "CREATE TABLE IF NOT EXISTS {{table}} ( LIKE {{table}}_s );", 'banned');
|
||||||
|
|
||||||
|
// Vider toutes les tables !
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'aks');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'alliance');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'annonce');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'banned');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'buddy');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'chat');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'galaxy');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'errors');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'fleets');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'iraks');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'lunas');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'messages');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'notes');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'rw');
|
||||||
|
doquery( "TRUNCATE TABLE {{table}}", 'statpoints');
|
||||||
|
|
||||||
|
$AllUsers = doquery ("SELECT `username`,`password`,`email`, `email_2`,`authlevel`,`galaxy`,`system`,`planet`, `sex`, `dpath`, `onlinetime`, `register_time`, `id_planet` FROM {{table}} WHERE 1;", 'users_s');
|
||||||
|
$LimitTime = time() - (15 * (24 * (60 * 60)));
|
||||||
|
$TransUser = 0;
|
||||||
|
while ( $TheUser = mysql_fetch_assoc($AllUsers) ) {
|
||||||
|
if ( $TheUser['onlinetime'] > $LimitTime ) {
|
||||||
|
$UserPlanet = doquery ("SELECT `name` FROM {{table}} WHERE `id` = '". $TheUser['id_planet']."';", 'planets_s', true);
|
||||||
|
if ($UserPlanet['name'] != "") {
|
||||||
|
// Creation de l'utilisateur
|
||||||
|
$QryInsertUser = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertUser .= "`username` = '". $TheUser['username'] ."', ";
|
||||||
|
$QryInsertUser .= "`email` = '". $TheUser['email'] ."', ";
|
||||||
|
$QryInsertUser .= "`email_2` = '". $TheUser['email_2'] ."', ";
|
||||||
|
$QryInsertUser .= "`sex` = '". $TheUser['sex'] ."', ";
|
||||||
|
$QryInsertUser .= "`id_planet` = '0', ";
|
||||||
|
$QryInsertUser .= "`authlevel` = '". $TheUser['authlevel'] ."', ";
|
||||||
|
$QryInsertUser .= "`dpath` = '". $TheUser['dpath'] ."', ";
|
||||||
|
$QryInsertUser .= "`galaxy` = '". $TheUser['galaxy'] ."', ";
|
||||||
|
$QryInsertUser .= "`system` = '". $TheUser['system'] ."', ";
|
||||||
|
$QryInsertUser .= "`planet` = '". $TheUser['planet'] ."', ";
|
||||||
|
$QryInsertUser .= "`register_time` = '". $TheUser['register_time'] ."', ";
|
||||||
|
$QryInsertUser .= "`password` = '". $TheUser['password'] ."';";
|
||||||
|
doquery( $QryInsertUser, 'users');
|
||||||
|
|
||||||
|
// On cherche le numero d'enregistrement de l'utilisateur fraichement cr<63><72>
|
||||||
|
$NewUser = doquery("SELECT `id` FROM {{table}} WHERE `username` = '". $TheUser['username'] ."' LIMIT 1;", 'users', true);
|
||||||
|
|
||||||
|
CreateOnePlanetRecord ($TheUser['galaxy'], $TheUser['system'], $TheUser['planet'], $NewUser['id'], $UserPlanet['name'], true);
|
||||||
|
// Recherche de la reference de la nouvelle planete (qui est unique normalement !
|
||||||
|
$PlanetID = doquery("SELECT `id` FROM {{table}} WHERE `id_owner` = '". $NewUser['id'] ."' LIMIT 1;", 'planets', true);
|
||||||
|
|
||||||
|
// Mise a jour de l'enregistrement utilisateur avec les infos de sa planete mere
|
||||||
|
$QryUpdateUser = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateUser .= "`id_planet` = '". $PlanetID['id'] ."', ";
|
||||||
|
$QryUpdateUser .= "`current_planet` = '". $PlanetID['id'] ."' ";
|
||||||
|
$QryUpdateUser .= "WHERE ";
|
||||||
|
$QryUpdateUser .= "`id` = '". $NewUser['id'] ."';";
|
||||||
|
doquery( $QryUpdateUser, 'users');
|
||||||
|
$TransUser++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // while
|
||||||
|
// Mise a jour du nombre de joueurs inscripts
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $TransUser ."' WHERE `config_name` = 'users_amount' LIMIT 1;", 'config');
|
||||||
|
|
||||||
|
// Menage on vire les tables transitoires
|
||||||
|
doquery("DROP TABLE {{table}}", 'planets_s');
|
||||||
|
doquery("DROP TABLE {{table}}", 'users_s');
|
||||||
|
|
||||||
|
AdminMessage ( $TransUser . $lang['adm_rz_done'], $lang['adm_rz_ttle'] );
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
return $Page;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mode = $_POST['mode'];
|
||||||
|
$PageTpl = gettemplate("admin/reset_body");
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($mode == 'reset') {
|
||||||
|
XNovaResetUnivers ( $user );
|
||||||
|
} else {
|
||||||
|
$Page = parsetemplate($PageTpl, $parse);
|
||||||
|
display ($Page, $lang['Reset'], false, '', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
66
admin/activeplanet.php
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['mf'] = $mf;
|
||||||
|
|
||||||
|
$PageTPL = gettemplate('admin/activeplanet_body');
|
||||||
|
$AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '". (time()-15 * 60) ."' ORDER BY `id` ASC", 'planets');
|
||||||
|
$Count = 0;
|
||||||
|
|
||||||
|
while ($ActivPlanet = mysql_fetch_array($AllActivPlanet)) {
|
||||||
|
$parse['online_list'] .= "<tr>";
|
||||||
|
$parse['online_list'] .= "<td class=b><center><b>". $ActivPlanet['name'] ."</b></center></td>";
|
||||||
|
$parse['online_list'] .= "<td class=b><center><b>[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]</b></center></td>";
|
||||||
|
$parse['online_list'] .= "<td class=m><center><b>". pretty_number($ActivPlanet['points'] / 1000) ."</b></center></td>";
|
||||||
|
$parse['online_list'] .= "<td class=b><center><b>". pretty_time(time() - $ActivPlanet['last_update']) . "</b></center></td>";
|
||||||
|
$parse['online_list'] .= "</tr>";
|
||||||
|
$Count++;
|
||||||
|
}
|
||||||
|
$parse['online_list'] .= "<tr>";
|
||||||
|
$parse['online_list'] .= "<th class=\"b\" colspan=\"4\">". $lang['adm_pl_they'] ." ". $Count ." ". $lang['adm_pl_apla'] ."</th>";
|
||||||
|
$parse['online_list'] .= "</tr>";
|
||||||
|
|
||||||
|
$page = parsetemplate( $PageTPL , $parse );
|
||||||
|
display( $page, $lang['adm_pl_title'], false, '', true );
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
101
admin/add_fleet.php
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if ($user['authlevel'] >= 1) {
|
||||||
|
includeLang('admin/add_fleet');
|
||||||
|
$mode = $_GET['mode'];
|
||||||
|
|
||||||
|
if($mode != 'add') {
|
||||||
|
$parse['ID'] = $lang['Id'];
|
||||||
|
$parse['Cle'] = $lang['cle'];
|
||||||
|
$parse['Clourd'] = $lang['clourd'];
|
||||||
|
$parse['Pt'] = $lang['pt'];
|
||||||
|
$parse['Gt'] = $lang['gt'];
|
||||||
|
$parse['Cruise'] = $lang['cruise'];
|
||||||
|
$parse['Vb'] = $lang['vb'];
|
||||||
|
$parse['Colo'] = $lang['colo'];
|
||||||
|
$parse['Rc'] = $lang['rc'];
|
||||||
|
$parse['Spy'] = $lang['spy'];
|
||||||
|
$parse['Bomb'] = $lang['bomb'];
|
||||||
|
$parse['Solar'] = $lang['solar'];
|
||||||
|
$parse['Des'] = $lang['des'];
|
||||||
|
$parse['Rip'] = $lang['rip'];
|
||||||
|
$parse['Traq'] = $lang['traq'];
|
||||||
|
|
||||||
|
} elseif($mode == 'add') {
|
||||||
|
$id = $_POST['id'];
|
||||||
|
$cle = $_POST['cle'];
|
||||||
|
$clourd = $_POST['clourd'];
|
||||||
|
$pt = $_POST['pt'];
|
||||||
|
$gt = $_POST['gt'];
|
||||||
|
$cruise = $_POST['cruise'];
|
||||||
|
$vb = $_POST['vb'];
|
||||||
|
$colo = $_POST['colo'];
|
||||||
|
$rc = $_POST['rc'];
|
||||||
|
$spy = $_POST['spy'];
|
||||||
|
$bomb = $_POST['bomb'];
|
||||||
|
$solar = $_POST['solar'];
|
||||||
|
$des = $_POST['des'];
|
||||||
|
$rip = $_POST['rip'];
|
||||||
|
$traq = $_POST['traq'];
|
||||||
|
|
||||||
|
$SqlAdd = "UPDATE {{table}} SET";
|
||||||
|
$SqlAdd .= "`light_hunter` = '".$cle."+light_hunter', ";
|
||||||
|
$SqlAdd .= "`heavy_hunter` = '".$clourd."+heavy_hunter', ";
|
||||||
|
$SqlAdd .= "`small_ship_cargo` = '".$pt."+small_ship_cargo', ";
|
||||||
|
$SqlAdd .= "`big_ship_cargo` = '".$gt."+big_ship_cargo', ";
|
||||||
|
$SqlAdd .= "`crusher` = '".$cruise."+crusher', ";
|
||||||
|
$SqlAdd .= "`battle_ship` = '".$vb."+battle_ship', ";
|
||||||
|
$SqlAdd .= "`colonizer` = '".$colo."+colonizer', ";
|
||||||
|
$SqlAdd .= "`recycler` = '".$rc."+recycler', ";
|
||||||
|
$SqlAdd .= "`spy_sonde`= '".$spy."+spy_sonde', ";
|
||||||
|
$SqlAdd .= "`bomber_ship` = '".$bomb."+bomber_ship', ";
|
||||||
|
$SqlAdd .= "`solar_satelit` = '".$solar."+solar_satelit', ";
|
||||||
|
$SqlAdd .= "`destructor` = '".$des."+destructor', ";
|
||||||
|
$SqlAdd .= "`dearth_star` = '".$rip."+dearth_star', ";
|
||||||
|
$SqlAdd .= "`battleship` = '".$traq."+battleship', ";
|
||||||
|
$SqlAdd .= " WHERE `id` = '".$id."' LIMIT 1";
|
||||||
|
doquery($SqlAdd, "planets");
|
||||||
|
message('Ajout OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = parsetemplate(gettemplate('admin/add_fleet'), $parse);
|
||||||
|
display( $page);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
67
admin/add_money.php
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$mode = $_POST['mode'];
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/add_money");
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($mode == 'addit') {
|
||||||
|
$id = $_POST['id'];
|
||||||
|
$metal = $_POST['metal'];
|
||||||
|
$cristal = $_POST['cristal'];
|
||||||
|
$deut = $_POST['deut'];
|
||||||
|
|
||||||
|
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdatePlanet .= "`metal` = `metal` + '". $metal ."', ";
|
||||||
|
$QryUpdatePlanet .= "`crystal` = `crystal` + '". $cristal ."', ";
|
||||||
|
$QryUpdatePlanet .= "`deuterium` = `deuterium` + '". $deut ."' ";
|
||||||
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
|
$QryUpdatePlanet .= "`id` = '". $id ."' ";
|
||||||
|
doquery( $QryUpdatePlanet, "planets");
|
||||||
|
|
||||||
|
AdminMessage ( $lang['adm_am_done'], $lang['adm_am_ttle'] );
|
||||||
|
}
|
||||||
|
$Page = parsetemplate($PageTpl, $parse);
|
||||||
|
|
||||||
|
display ($Page, $lang['adm_am_ttle'], false, '', true);
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
69
admin/add_moon.php
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin/addmoon');
|
||||||
|
|
||||||
|
$mode = $_POST['mode'];
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/add_moon");
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($mode == 'addit') {
|
||||||
|
$PlanetID = $_POST['user'];
|
||||||
|
$MoonName = $_POST['name'];
|
||||||
|
|
||||||
|
$QrySelectPlanet = "SELECT * FROM {{table}} ";
|
||||||
|
$QrySelectPlanet .= "WHERE ";
|
||||||
|
$QrySelectPlanet .= "`id` = '". $PlanetID ."';";
|
||||||
|
$PlanetSelected = doquery ( $QrySelectPlanet, 'planets', true);
|
||||||
|
|
||||||
|
$Galaxy = $PlanetSelected['galaxy'];
|
||||||
|
$System = $PlanetSelected['system'];
|
||||||
|
$Planet = $PlanetSelected['planet'];
|
||||||
|
$Owner = $PlanetSelected['id_owner'];
|
||||||
|
$MoonID = time();
|
||||||
|
|
||||||
|
CreateOneMoonRecord ( $Galaxy, $System, $Planet, $Owner, $MoonID, $MoonName, 20 );
|
||||||
|
|
||||||
|
AdminMessage ( $lang['addm_done'], $lang['addm_title'] );
|
||||||
|
}
|
||||||
|
$Page = parsetemplate($PageTpl, $parse);
|
||||||
|
|
||||||
|
display ($Page, $lang['addm_title'], false, '', true);
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
?>
|
||||||
48
admin/autounban.php
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
$lang['PHP_SELF'] = 'options.'.PHPEXT;
|
||||||
|
doquery("UPDATE {{table}} SET `banaday` =` banaday` - '1' WHERE `banaday` != '0';",'users');
|
||||||
|
doquery("UPDATE {{table}} SET `bana` = '0' WHERE `banaday` < '1';",'users');
|
||||||
|
$parse = $gameConfig;
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":'';
|
||||||
|
} else {
|
||||||
|
message ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
89
admin/banned.php
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$mode = $_POST['mode'];
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/banned");
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
if ($mode == 'banit') {
|
||||||
|
$name = $_POST['name'];
|
||||||
|
$reas = $_POST['why'];
|
||||||
|
$days = $_POST['days'];
|
||||||
|
$hour = $_POST['hour'];
|
||||||
|
$mins = $_POST['mins'];
|
||||||
|
$secs = $_POST['secs'];
|
||||||
|
|
||||||
|
$admin = $user['username'];
|
||||||
|
$mail = $user['email'];
|
||||||
|
|
||||||
|
$Now = time();
|
||||||
|
$BanTime = $days * 86400;
|
||||||
|
$BanTime += $hour * 3600;
|
||||||
|
$BanTime += $mins * 60;
|
||||||
|
$BanTime += $secs;
|
||||||
|
$BannedUntil = $Now + $BanTime;
|
||||||
|
|
||||||
|
$QryInsertBan = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertBan .= "`who` = \"". $name ."\", ";
|
||||||
|
$QryInsertBan .= "`theme` = '". $reas ."', ";
|
||||||
|
$QryInsertBan .= "`who2` = '". $name ."', ";
|
||||||
|
$QryInsertBan .= "`time` = '". $Now ."', ";
|
||||||
|
$QryInsertBan .= "`longer` = '". $BannedUntil ."', ";
|
||||||
|
$QryInsertBan .= "`author` = '". $admin ."', ";
|
||||||
|
$QryInsertBan .= "`email` = '". $mail ."';";
|
||||||
|
doquery( $QryInsertBan, 'banned');
|
||||||
|
|
||||||
|
$QryUpdateUser = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateUser .= "`bana` = '1', ";
|
||||||
|
$QryUpdateUser .= "`banaday` = '". $BannedUntil ."' ";
|
||||||
|
$QryUpdateUser .= "WHERE ";
|
||||||
|
$QryUpdateUser .= "`username` = \"". $name ."\";";
|
||||||
|
doquery( $QryUpdateUser, 'users');
|
||||||
|
|
||||||
|
$DoneMessage = $lang['adm_bn_thpl'] ." ". $name ." ". $lang['adm_bn_isbn'];
|
||||||
|
AdminMessage ($DoneMessage, $lang['adm_bn_ttle']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Page = parsetemplate($PageTpl, $parse);
|
||||||
|
display( $Page, $lang['adm_bn_ttle'], false, '', true);
|
||||||
|
} else {
|
||||||
|
AdminMessage ($lang['sys_noalloaw'], $lang['sys_noaccess']);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
56
admin/changelog.php
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
includeLang('changelog');
|
||||||
|
$template = gettemplate('changelog_table');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
foreach($lang['changelog'] as $a => $b)
|
||||||
|
{
|
||||||
|
|
||||||
|
$parse['version_number'] = $a;
|
||||||
|
$parse['description'] = nl2br($b);
|
||||||
|
|
||||||
|
$body .= parsetemplate($template, $parse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse['body'] = $body;
|
||||||
|
|
||||||
|
$page .= parsetemplate(gettemplate('changelog_body'), $parse);
|
||||||
|
|
||||||
|
display( $page, "Changelog", false, '', true);
|
||||||
|
|
||||||
|
?>
|
||||||
66
admin/chat.php
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
includeLang('admin');
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
|
||||||
|
// Système de suppression
|
||||||
|
extract($_GET);
|
||||||
|
if (isset($delete)) {
|
||||||
|
doquery("DELETE FROM {{table}} WHERE `messageid`=$delete", 'chat');
|
||||||
|
} elseif ($deleteall == 'yes') {
|
||||||
|
doquery("DELETE FROM {{table}}", 'chat');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage des messages
|
||||||
|
$query = doquery("SELECT * FROM {{table}} ORDER BY messageid DESC LIMIT 25", 'chat');
|
||||||
|
$i = 0;
|
||||||
|
while ($e = mysql_fetch_array($query)) {
|
||||||
|
$i++;
|
||||||
|
$parse['msg_list'] .= stripslashes("<tr><th class=b>" . date('h:i:s', $e['timestamp']) . "</th>".
|
||||||
|
"<th class=b>". $e['user'] . "</th>".
|
||||||
|
"<td class=b>" . nl2br($e['message']) . "</td>".
|
||||||
|
"<th class=b><a href=?delete=".$e['messageid']."><img src=\"../images/r1.png\" border=\"0\"></a></th></tr>");
|
||||||
|
}
|
||||||
|
$parse['msg_list'] .= "<tr><th class=b colspan=4>{$i} ".$lang['adm_ch_nbs']."</th></tr>";
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('admin/chat_body'), $parse), "Chat", false, '', true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
73
admin/credit.php
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
includeLang('credit');
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
if ($_POST['opt_save'] == "1") {
|
||||||
|
// Extended copyright is activated?
|
||||||
|
if (isset($_POST['ExtCopyFrame']) && $_POST['ExtCopyFrame'] == 'on') {
|
||||||
|
$gameConfig['ExtCopyFrame'] = "1";
|
||||||
|
$gameConfig['ExtCopyOwner'] = $_POST['ExtCopyOwner'];
|
||||||
|
$gameConfig['ExtCopyFunct'] = $_POST['ExtCopyFunct'];
|
||||||
|
} else {
|
||||||
|
$gameConfig['ExtCopyFrame'] = "0";
|
||||||
|
$gameConfig['ExtCopyOwner'] = "";
|
||||||
|
$gameConfig['ExtCopyFunct'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update values
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ExtCopyFrame'] ."' WHERE `config_name` = 'ExtCopyFrame';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ExtCopyOwner'] ."' WHERE `config_name` = 'ExtCopyOwner';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ExtCopyFunct'] ."' WHERE `config_name` = 'ExtCopyFunct';", 'config');
|
||||||
|
|
||||||
|
AdminMessage ($lang['cred_done'], $lang['cred_ext']);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//View values
|
||||||
|
$parse['ExtCopyFrame'] = ($gameConfig['ExtCopyFrame'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
$parse['ExtCopyOwnerVal'] = $gameConfig['ExtCopyOwner'];
|
||||||
|
$parse['ExtCopyFunctVal'] = $gameConfig['ExtCopyFunct'];
|
||||||
|
|
||||||
|
$BodyTPL = gettemplate('admin/credit_body');
|
||||||
|
$page = parsetemplate($BodyTPL, $parse);
|
||||||
|
display($page, $lang['cred_credit'], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
84
admin/declare_list.php
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
if ($_GET['cmd'] == 'dele') {
|
||||||
|
DeleteSelectedUser ( $_GET['user'] );
|
||||||
|
}
|
||||||
|
if ($_GET['cmd'] == 'sort') {
|
||||||
|
$TypeSort = $_GET['type'];
|
||||||
|
} else {
|
||||||
|
$TypeSort = "id";
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTPL = gettemplate('admin/declarelist_body');
|
||||||
|
$RowsTPL = gettemplate('admin/declarelist_rows');
|
||||||
|
|
||||||
|
$query = doquery("SELECT * FROM {{table}} ORDER BY `declarator` DESC", 'declared');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['adm_ul_table'] = "";
|
||||||
|
$i = 0;
|
||||||
|
$Color = "lime";
|
||||||
|
while ($u = mysql_fetch_assoc ($query) ) {
|
||||||
|
if ($PrevIP != "") {
|
||||||
|
if ($PrevIP == $u['declarator']) {
|
||||||
|
$Color = "red";
|
||||||
|
} else {
|
||||||
|
$Color = "lime";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$Bloc['adm_ul_data_id'] = stripslashes($u['declarator_name']);
|
||||||
|
$Bloc['adm_ul_data_name'] = stripslashes($u['declarator']);
|
||||||
|
$Bloc['adm_ul_data_mail'] = stripslashes($u['declared_1']);
|
||||||
|
$Bloc['adm_ul_data_adip'] = stripslashes($u['declared_2']);
|
||||||
|
$Bloc['adm_ul_data_detai'] = stripslashes($u['declared_3']);
|
||||||
|
$Bloc['adm_ul_data_regd'] = stripslashes($u['reason']);
|
||||||
|
|
||||||
|
|
||||||
|
$parse['adm_ul_table'] .= parsetemplate( $RowsTPL, $Bloc );
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$parse['adm_ul_count'] = $i;
|
||||||
|
|
||||||
|
$page = parsetemplate( $PageTPL, $parse );
|
||||||
|
display( $page, "Liste des joueurs ayant declare une IP collective", false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Created by e-Zobar. All rights reversed (C) XNova Team 2008
|
||||||
|
?>
|
||||||
50
admin/deletuser.php
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
$PageTpl = gettemplate( "admin/deletuser" );
|
||||||
|
|
||||||
|
if ( $mode != "delet" ) {
|
||||||
|
$parse['adm_bt_delet'] = $lang['adm_bt_delet'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$Page = parsetemplate( $PageTpl, $parse );
|
||||||
|
display ( $Page, $lang['adminpanel'], false, '', true );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
70
admin/errors.php
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('admin');
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
|
||||||
|
// Supprimer les erreurs
|
||||||
|
extract($_GET);
|
||||||
|
if (isset($delete)) {
|
||||||
|
doquery("DELETE FROM {{table}} WHERE `error_id`=$delete", 'errors');
|
||||||
|
} elseif ($deleteall == 'yes') {
|
||||||
|
doquery("TRUNCATE TABLE {{table}}", 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Afficher les erreurs
|
||||||
|
$query = doquery("SELECT * FROM {{table}}", 'errors');
|
||||||
|
$i = 0;
|
||||||
|
while ($u = mysql_fetch_array($query)) {
|
||||||
|
$i++;
|
||||||
|
$parse['errors_list'] .= "
|
||||||
|
<tr><td width=\"25\" class=n>". $u['error_id'] ."</td>
|
||||||
|
<td width=\"170\" class=n>". $u['error_type'] ."</td>
|
||||||
|
<td width=\"230\" class=n>". date('d/m/Y h:i:s', $u['error_time']) ."</td>
|
||||||
|
<td width=\"95\" class=n><a href=\"?delete=". $u['error_id'] ."\"><img src=\"../images/r1.png\"></a></td></tr>
|
||||||
|
<tr><td colspan=\"4\" class=b>". nl2br($u['error_text'])."</td></tr>";
|
||||||
|
}
|
||||||
|
$parse['errors_list'] .= "<tr>
|
||||||
|
<th class=b colspan=5>". $i ." ". $lang['adm_er_nbs'] ."</th>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('admin/errors_body'), $parse), "Bledy", false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
50
admin/leftmenu.php
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('leftmenu');
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['mf'] = "Hauptframe";
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['XNovaRelease'] = VERSION;
|
||||||
|
$parse['servername'] = XNova;
|
||||||
|
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
|
||||||
|
display( $Page, "", false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
66
admin/mass_message.php
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
|
||||||
|
function mass_message_run($parent){
|
||||||
|
if($_POST["mode"] == "change"){
|
||||||
|
if(isset($_POST["tresc"])&& $_POST["tresc"] != ''){
|
||||||
|
$gameConfig['tresc'] = $parent->safe_get_post_var("tresc");
|
||||||
|
}
|
||||||
|
if(isset($_POST["temat"])&& $_POST["temat"] != ''){
|
||||||
|
$gameConfig['temat'] = $parent->safe_get_post_var("temat");
|
||||||
|
}
|
||||||
|
$kolor = 'red';
|
||||||
|
if($gameConfig['tresc'] !='' and $gameConfig['temat']){
|
||||||
|
$sq = $parent->db->query("SELECT `id` FROM {{table}}","users");
|
||||||
|
while($u = $parent->db->fetch_assoc($sq)){
|
||||||
|
doquery("INSERT INTO {{table}} SET
|
||||||
|
`message_owner`='{$u['id']}',
|
||||||
|
`message_sender`='1' ,
|
||||||
|
`message_time`='".time()."',
|
||||||
|
`message_type`='0',
|
||||||
|
`message_from`='<font color=\"$kolor\">Administracja</font>',
|
||||||
|
`message_subject`='<font color=\"$kolor\">{$gameConfig['temat']}</font>',
|
||||||
|
`message_text`='<font color=\"$kolor\"><b>{$gameConfig['tresc']}</b></font>'
|
||||||
|
","messages");
|
||||||
|
$parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users');
|
||||||
|
}
|
||||||
|
$parent->smarty->assign("message","<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$parent->smarty->display("mass_message.tpl");
|
||||||
|
}
|
||||||
|
|
||||||
|
function mass_message_info(){
|
||||||
|
return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0");
|
||||||
|
}
|
||||||
60
admin/md5changepass.php
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin/changepass');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($_POST['md5q'] != "") {
|
||||||
|
|
||||||
|
doquery ("UPDATE {{table}} SET `password` = '" . md5 ($_POST['md5q']) . "' WHERE `username` = '".$_POST['user']."';", 'users');
|
||||||
|
//$QueryUpdatePass = "UPDATE {{table}} SET ";
|
||||||
|
//$QueryUpdatePass .= "`password` = '" . md5 ($_POST['md5q']) . "', ";
|
||||||
|
//$QueryUpdatePass = "WHERE ";
|
||||||
|
//$QueryUpdatePass .= "`username`=" . $_POST['user'] . "";
|
||||||
|
// doquery($QueryUpdatePass, 'users');
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/changepass");
|
||||||
|
$Page = parsetemplate( $PageTpl, $parse);
|
||||||
|
|
||||||
|
display( $Page, $lang['md5_title'], false, '', true );
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
57
admin/md5enc.php
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin/md5enc');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
if ($_POST['md5q'] != "") {
|
||||||
|
$parse['md5_md5'] = $_POST['md5q'];
|
||||||
|
$parse['md5_enc'] = md5 ($_POST['md5q']);
|
||||||
|
} else {
|
||||||
|
$parse['md5_md5'] = "";
|
||||||
|
$parse['md5_enc'] = md5 ("");
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTpl = gettemplate("admin/md5enc");
|
||||||
|
$Page = parsetemplate( $PageTpl, $parse);
|
||||||
|
|
||||||
|
display( $Page, $lang['md5_title'], false, '', true );
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
148
admin/messagelist.php
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin/messagelist');
|
||||||
|
|
||||||
|
$BodyTpl = gettemplate('admin/messagelist_body');
|
||||||
|
$RowsTpl = gettemplate('admin/messagelist_table_rows');
|
||||||
|
|
||||||
|
$Prev = ( !empty($_POST['prev']) ) ? true : false;
|
||||||
|
$Next = ( !empty($_POST['next']) ) ? true : false;
|
||||||
|
$DelSel = ( !empty($_POST['delsel']) ) ? true : false;
|
||||||
|
$DelDat = ( !empty($_POST['deldat']) ) ? true : false;
|
||||||
|
$CurrPage = ( !empty($_POST['curr']) ) ? $_POST['curr'] : 1;
|
||||||
|
$Selected = ( !empty($_POST['sele']) ) ? $_POST['sele'] : 0;
|
||||||
|
$SelType = $_POST['type'];
|
||||||
|
$SelPage = $_POST['page'];
|
||||||
|
|
||||||
|
$ViewPage = 1;
|
||||||
|
if ( $Selected != $SelType ) {
|
||||||
|
$Selected = $SelType;
|
||||||
|
$ViewPage = 1;
|
||||||
|
} elseif ( $CurrPage != $SelPage ) {
|
||||||
|
$ViewPage = ( !empty($SelPage) ) ? $SelPage : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Prev == true) {
|
||||||
|
$CurrPage -= 1;
|
||||||
|
if ($CurrPage >= 1) {
|
||||||
|
$ViewPage = $CurrPage;
|
||||||
|
} else {
|
||||||
|
$ViewPage = 1;
|
||||||
|
}
|
||||||
|
} elseif ($Next == true) {
|
||||||
|
$Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', true);
|
||||||
|
$MaxPage = ceil ( ($Mess['max'] / 25) );
|
||||||
|
$CurrPage += 1;
|
||||||
|
if ($CurrPage <= $MaxPage) {
|
||||||
|
$ViewPage = $CurrPage;
|
||||||
|
} else {
|
||||||
|
$ViewPage = $MaxPage;
|
||||||
|
}
|
||||||
|
} elseif ($DelSel == true) {
|
||||||
|
foreach($_POST['sele'] as $MessId => $Value) {
|
||||||
|
if ($Value = "on") {
|
||||||
|
doquery ( "DELETE FROM {{table}} WHERE `message_id` = '". $MessId ."';", 'messages');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($DelDat == true) {
|
||||||
|
$SelDay = $_POST['selday'];
|
||||||
|
$SelMonth = $_POST['selmonth'];
|
||||||
|
$SelYear = $_POST['selyear'];
|
||||||
|
$LimitDate = mktime (0,0,0, $SelMonth, $SelDay, $SelYear );
|
||||||
|
if ($LimitDate != false) {
|
||||||
|
doquery ( "DELETE FROM {{table}} WHERE `message_time` <= '". $LimitDate ."';", 'messages');
|
||||||
|
doquery ( "DELETE FROM {{table}} WHERE `time` <= '". $LimitDate ."';", 'rw');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$Mess = doquery("SELECT COUNT(*) AS `max` FROM {{table}} WHERE `message_type` = '". $Selected ."';", 'messages', true);
|
||||||
|
$MaxPage = ceil ( ($Mess['max'] / 25) );
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['mlst_data_page'] = $ViewPage;
|
||||||
|
$parse['mlst_data_pagemax'] = $MaxPage;
|
||||||
|
$parse['mlst_data_sele'] = $Selected;
|
||||||
|
|
||||||
|
$parse['mlst_data_types'] = "<option value=\"0\"". (($Selected == "0") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__0'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"1\"". (($Selected == "1") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__1'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"2\"". (($Selected == "2") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__2'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"3\"". (($Selected == "3") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__3'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"4\"". (($Selected == "4") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__4'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"5\"". (($Selected == "5") ? " SELECTED" : "") .">". $lang['mlst_mess_typ__5'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"15\"". (($Selected == "15") ? " SELECTED" : "") .">". $lang['mlst_mess_typ_15'] ."</option>";
|
||||||
|
$parse['mlst_data_types'] .= "<option value=\"99\"". (($Selected == "99") ? " SELECTED" : "") .">". $lang['mlst_mess_typ_99'] ."</option>";
|
||||||
|
|
||||||
|
$parse['mlst_data_pages'] = "";
|
||||||
|
for ( $cPage = 1; $cPage <= $MaxPage; $cPage++ ) {
|
||||||
|
$parse['mlst_data_pages'] .= "<option value=\"".$cPage."\"". (($ViewPage == $cPage) ? " SELECTED" : "") .">". $cPage ."/". $MaxPage ."</option>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse['mlst_scpt'] = "<script language=\"JavaScript\">\n";
|
||||||
|
$parse['mlst_scpt'] .= "function f(target_url, win_name) {\n";
|
||||||
|
$parse['mlst_scpt'] .= "var new_win = window.open(target_url,win_name,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,width=550,height=280,top=0,left=0');\n";
|
||||||
|
$parse['mlst_scpt'] .= "new_win.focus();\n";
|
||||||
|
$parse['mlst_scpt'] .= "}\n";
|
||||||
|
$parse['mlst_scpt'] .= "</script>\n";
|
||||||
|
|
||||||
|
$parse['tbl_rows'] = "";
|
||||||
|
$parse['mlst_title'] = $lang['mlst_title'];
|
||||||
|
|
||||||
|
$StartRec = 1 + (($ViewPage - 1) * 25);
|
||||||
|
$Messages = doquery("SELECT * FROM {{table}} WHERE `message_type` = '". $Selected ."' ORDER BY `message_time` DESC LIMIT ". $StartRec .",25;", 'messages');
|
||||||
|
while ($row = mysql_fetch_assoc($Messages)) {
|
||||||
|
$OwnerData = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". $row['message_owner'] ."';", 'users',true);
|
||||||
|
$bloc['mlst_id'] = $row['message_id'];
|
||||||
|
$bloc['mlst_from'] = $row['message_from'];
|
||||||
|
$bloc['mlst_to'] = $OwnerData['username'] ." ID:". $row['message_owner'];
|
||||||
|
$bloc['mlst_text'] = $row['message_text'];
|
||||||
|
$bloc['mlst_time'] = gmdate ( "d. M Y H:i:s", $row['message_time'] );
|
||||||
|
|
||||||
|
$parse['mlst_data_rows'] .= parsetemplate($RowsTpl , $bloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
$display = parsetemplate($BodyTpl , $parse);
|
||||||
|
|
||||||
|
if (isset($_POST['delit'])) {
|
||||||
|
doquery ("DELETE FROM {{table}} WHERE `message_id` = '". $_POST['delit'] ."';", 'messages');
|
||||||
|
AdminMessage ( $lang['mlst_mess_del'] ." ( ". $_POST['delit'] ." )", $lang['mlst_title'], "./messagelist.".PHPEXT, 3);
|
||||||
|
}
|
||||||
|
display ($display, $lang['mlst_title'], false, '', true);
|
||||||
|
} else {
|
||||||
|
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
75
admin/messall.php
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
if ($_POST && $mode == "change") {
|
||||||
|
if (isset($_POST["tresc"]) && $_POST["tresc"] != '') {
|
||||||
|
$gameConfig['tresc'] = $_POST['tresc'];
|
||||||
|
}
|
||||||
|
if (isset($_POST["temat"]) && $_POST["temat"] != '') {
|
||||||
|
$gameConfig['temat'] = $_POST['temat'];
|
||||||
|
}
|
||||||
|
if ($user['authlevel'] == LEVEL_ADMIN) {
|
||||||
|
$kolor = 'red';
|
||||||
|
$ranga = 'Administrator';
|
||||||
|
} elseif ($user['authlevel'] == LEVEL_OPERATOR) {
|
||||||
|
$kolor = 'skyblue';
|
||||||
|
$ranga = 'Operator';
|
||||||
|
} elseif ($user['authlevel'] == LEVEL_MODERATOR) {
|
||||||
|
$kolor = 'yellow';
|
||||||
|
$ranga = 'Moderator';
|
||||||
|
}
|
||||||
|
if ($gameConfig['tresc'] != '' and $gameConfig['temat']) {
|
||||||
|
$sq = doquery("SELECT `id` FROM {{table}}", "users");
|
||||||
|
$Time = time();
|
||||||
|
$From = "<font color=\"". $kolor ."\">". $ranga ." ".$user['username']."</font>";
|
||||||
|
$Subject = "<font color=\"". $kolor ."\">". $gameConfig['temat'] ."</font>";
|
||||||
|
$Message = "<font color=\"". $kolor ."\"><b>". $gameConfig['tresc'] ."</b></font>";
|
||||||
|
while ($u = mysql_fetch_array($sq)) {
|
||||||
|
SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message);
|
||||||
|
}
|
||||||
|
message("<font color=\"lime\">Wys<79>a<EFBFBD>e<EFBFBD> wiadomo<6D><6F> do wszystkich graczy</font>", "Complete", "../overview." . PHPEXT, 3);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$parse = $gameConfig;
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":'';
|
||||||
|
$page .= parsetemplate(gettemplate('admin/messall_body'), $parse);
|
||||||
|
display($page, '', false,'', true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
|
||||||
|
}
|
||||||
|
?>
|
||||||
62
admin/moonlist.php
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('overview');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$query = doquery("SELECT * FROM {{table}} WHERE planet_type='3'", "planets");
|
||||||
|
$i = 0;
|
||||||
|
while ($u = mysql_fetch_array($query)) {
|
||||||
|
$parse['moon'] .= "<tr>"
|
||||||
|
. "<td class=b><center><b>" . $u[0] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[1] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[2] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[4] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[5] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[6] . "</center></b></td>"
|
||||||
|
. "</tr>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i == "1")
|
||||||
|
$parse['moon'] .= "<tr><th class=b colspan=6>Il y a qu'une seule lune</th></tr>";
|
||||||
|
else
|
||||||
|
$parse['moon'] .= "<tr><th class=b colspan=6>Il y a {$i} lunes</th></tr>";
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('admin/moonlist_body'), $parse), 'Lunalist' , false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
?>
|
||||||
65
admin/multi.php
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin/multi');
|
||||||
|
|
||||||
|
$query = doquery("SELECT * FROM {{table}}", 'multi');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['adm_mt_table'] = "";
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
$RowsTPL = gettemplate('admin/multi_rows');
|
||||||
|
$PageTPL = gettemplate('admin/multi_body');
|
||||||
|
|
||||||
|
while ($infos = mysql_fetch_assoc($query)) {
|
||||||
|
$Bloc['player'] = $infos['player'];
|
||||||
|
$Bloc['text'] = $infos['text'];
|
||||||
|
|
||||||
|
$parse['adm_mt_table'] .= parsetemplate( $RowsTPL, $Bloc );
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse['adm_mt_count'] = $i;
|
||||||
|
|
||||||
|
$page = parsetemplate( $PageTPL, $parse );
|
||||||
|
display( $page, $lang['adm_mt_title'], false, '', true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
116
admin/overview.php
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
if ($_GET['cmd'] == 'sort') {
|
||||||
|
$TypeSort = $_GET['type'];
|
||||||
|
} else {
|
||||||
|
$TypeSort = "id";
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTPL = gettemplate('admin/overview_body');
|
||||||
|
$RowsTPL = gettemplate('admin/overview_rows');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['mf'] = $mf;
|
||||||
|
$parse['adm_ov_data_yourv'] = colorRed(VERSION);
|
||||||
|
|
||||||
|
$Last15Mins = doquery("SELECT * FROM {{table}} WHERE `onlinetime` >= '". (time() - 15 * 60) ."' ORDER BY `". $TypeSort ."` ASC;", 'users');
|
||||||
|
$Count = 0;
|
||||||
|
$Color = "lime";
|
||||||
|
while ( $TheUser = mysql_fetch_array($Last15Mins) ) {
|
||||||
|
if ($PrevIP != "") {
|
||||||
|
if ($PrevIP == $TheUser['user_lastip']) {
|
||||||
|
$Color = "red";
|
||||||
|
} else {
|
||||||
|
$Color = "lime";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $TheUser['id'] . "';", 'statpoints', true);
|
||||||
|
$Bloc['dpath'] = $dpath;
|
||||||
|
$Bloc['adm_ov_altpm'] = $lang['adm_ov_altpm'];
|
||||||
|
$Bloc['adm_ov_wrtpm'] = $lang['adm_ov_wrtpm'];
|
||||||
|
$Bloc['adm_ov_data_id'] = $TheUser['id'];
|
||||||
|
$Bloc['adm_ov_data_name'] = $TheUser['username'];
|
||||||
|
$Bloc['adm_ov_data_agen'] = $TheUser['user_agent'];
|
||||||
|
$Bloc['current_page'] = $TheUser['current_page'];
|
||||||
|
$Bloc['usr_s_id'] = $TheUser['id'];
|
||||||
|
|
||||||
|
$Bloc['adm_ov_data_clip'] = $Color;
|
||||||
|
$Bloc['adm_ov_data_adip'] = $TheUser['user_lastip'];
|
||||||
|
$Bloc['adm_ov_data_ally'] = $TheUser['ally_name'];
|
||||||
|
$Bloc['adm_ov_data_point'] = pretty_number ( $UserPoints['total_points'] );
|
||||||
|
$Bloc['adm_ov_data_activ'] = pretty_time ( time() - $TheUser['onlinetime'] );
|
||||||
|
$Bloc['adm_ov_data_pict'] = "m.gif";
|
||||||
|
$PrevIP = $TheUser['user_lastip'];
|
||||||
|
|
||||||
|
//Tweaks vue g<>n<EFBFBD>rale
|
||||||
|
$Bloc['usr_email'] = $TheUser['email'];
|
||||||
|
$Bloc['usr_xp_raid'] = $TheUser['xpraid'];
|
||||||
|
$Bloc['usr_xp_min'] = $TheUser['xpminier'];
|
||||||
|
|
||||||
|
if ($TheUser['urlaubs_modus'] == 1) {
|
||||||
|
$Bloc['state_vacancy'] = "<img src=\"../images/true.png\" >";
|
||||||
|
} else {
|
||||||
|
$Bloc['state_vacancy'] = "<img src=\"../images/false.png\">";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($TheUser['bana'] == 1) {
|
||||||
|
$Bloc['is_banned'] = "<img src=\"../images/banned.png\" >";
|
||||||
|
} else {
|
||||||
|
$Bloc['is_banned'] = $lang['is_banned_lang'];
|
||||||
|
}
|
||||||
|
$Bloc['usr_planet_gal'] = $TheUser['galaxy'];
|
||||||
|
$Bloc['usr_planet_sys'] = $TheUser['system'];
|
||||||
|
$Bloc['usr_planet_pos'] = $TheUser['planet'];
|
||||||
|
|
||||||
|
|
||||||
|
$parse['adm_ov_data_table'] .= parsetemplate( $RowsTPL, $Bloc );
|
||||||
|
$Count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse['adm_ov_data_count'] = $Count;
|
||||||
|
$Page = parsetemplate($PageTPL, $parse);
|
||||||
|
|
||||||
|
display ( $Page, $lang['sys_overview'], false, '', true);
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
194
admin/paneladmina.php
Normal file
|
|
@ -0,0 +1,194 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
|
||||||
|
includeLang('admin/adminpanel');
|
||||||
|
|
||||||
|
$PanelMainTPL = gettemplate('admin/admin_panel_main');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['adm_sub_form1'] = "";
|
||||||
|
$parse['adm_sub_form2'] = "";
|
||||||
|
$parse['adm_sub_form3'] = "";
|
||||||
|
|
||||||
|
// Afficher les templates
|
||||||
|
if (isset($_GET['result'])) {
|
||||||
|
|
||||||
|
switch ($_GET['result']){
|
||||||
|
case 'usr_search':
|
||||||
|
$pattern = mysql_real_escape_string($_GET['player']);
|
||||||
|
$SelUser = doquery("SELECT * FROM {{table}} WHERE `username` LIKE '%". $pattern ."%' LIMIT 1;", 'users', true);
|
||||||
|
$UsrMain = doquery("SELECT `name` FROM {{table}} WHERE `id` = '". $SelUser['id_planet'] ."';", 'planets', true);
|
||||||
|
|
||||||
|
$bloc = $lang;
|
||||||
|
$bloc['answer1'] = $SelUser['id'];
|
||||||
|
$bloc['answer2'] = $SelUser['username'];
|
||||||
|
$bloc['answer3'] = $SelUser['user_lastip'];
|
||||||
|
$bloc['answer4'] = $SelUser['email'];
|
||||||
|
$bloc['answer5'] = $lang['adm_usr_level'][ $SelUser['authlevel'] ];
|
||||||
|
$bloc['answer6'] = $lang['adm_usr_genre'][ $SelUser['sex'] ];
|
||||||
|
$bloc['answer7'] = "[".$SelUser['id_planet']."] ".$UsrMain['name'];
|
||||||
|
$bloc['answer8'] = "[".$SelUser['galaxy'].":".$SelUser['system'].":".$SelUser['planet']."] ";
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_asw1');
|
||||||
|
$parse['adm_sub_form2'] = parsetemplate( $SubPanelTPL, $bloc );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'usr_data':
|
||||||
|
$pattern = mysql_real_escape_string($_GET['player']);
|
||||||
|
$SelUser = doquery("SELECT * FROM {{table}} WHERE `username` LIKE '%". $pattern ."%' LIMIT 1;", 'users', true);
|
||||||
|
$UsrMain = doquery("SELECT `name` FROM {{table}} WHERE `id` = '". $SelUser['id_planet'] ."';", 'planets', true);
|
||||||
|
|
||||||
|
$bloc = $lang;
|
||||||
|
$bloc['answer1'] = $SelUser['id'];
|
||||||
|
$bloc['answer2'] = $SelUser['username'];
|
||||||
|
$bloc['answer3'] = $SelUser['user_lastip'];
|
||||||
|
$bloc['answer4'] = $SelUser['email'];
|
||||||
|
$bloc['answer5'] = $lang['adm_usr_level'][ $SelUser['authlevel'] ];
|
||||||
|
$bloc['answer6'] = $lang['adm_usr_genre'][ $SelUser['sex'] ];
|
||||||
|
$bloc['answer7'] = "[".$SelUser['id_planet']."] ".$UsrMain['name'];
|
||||||
|
$bloc['answer8'] = "[".$SelUser['galaxy'].":".$SelUser['system'].":".$SelUser['planet']."] ";
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_asw1');
|
||||||
|
$parse['adm_sub_form1'] = parsetemplate( $SubPanelTPL, $bloc );
|
||||||
|
|
||||||
|
$parse['adm_sub_form2'] = "<table><tbody>";
|
||||||
|
$parse['adm_sub_form2'] .= "<tr><td colspan=\"4\" class=\"c\">".$lang['adm_colony']."</td></tr>";
|
||||||
|
$UsrColo = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '". $SelUser['id'] ." ORDER BY `galaxy` ASC, `planet` ASC, `system` ASC, `planet_type` ASC';", 'planets');
|
||||||
|
while ( $Colo = mysql_fetch_assoc($UsrColo) ) {
|
||||||
|
if ($Colo['id'] != $SelUser['id_planet']) {
|
||||||
|
$parse['adm_sub_form2'] .= "<tr><th>".$Colo['id']."</th>";
|
||||||
|
$parse['adm_sub_form2'] .= "<th>". (($Colo['planet_type'] == 1) ? $lang['adm_planet'] : $lang['adm_moon'] ) ."</th>";
|
||||||
|
$parse['adm_sub_form2'] .= "<th>[".$Colo['galaxy'].":".$Colo['system'].":".$Colo['planet']."]</th>";
|
||||||
|
$parse['adm_sub_form2'] .= "<th>".$Colo['name']."</th></tr>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$parse['adm_sub_form2'] .= "</tbody></table>";
|
||||||
|
|
||||||
|
$parse['adm_sub_form3'] = "<table><tbody>";
|
||||||
|
$parse['adm_sub_form3'] .= "<tr><td colspan=\"4\" class=\"c\">".$lang['adm_technos']."</td></tr>";
|
||||||
|
for ($Item = 100; $Item <= 199; $Item++) {
|
||||||
|
if ($resource[$Item] != "") {
|
||||||
|
$parse['adm_sub_form3'] .= "<tr><th>".$lang['tech'][$Item]."</th>";
|
||||||
|
$parse['adm_sub_form3'] .= "<th>".$SelUser[$resource[$Item]]."</th></tr>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$parse['adm_sub_form3'] .= "</tbody></table>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'usr_level':
|
||||||
|
if (!isset($_GET['s']) || !isset($_SESSION['CSRF']) || $_GET['s'] !== $_SESSION['CSRF']) {
|
||||||
|
AdminMessage(
|
||||||
|
'One have tried to overcome administration privilleges.',
|
||||||
|
'Hacking attempt');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$player = isset($_GET['player']) ? mysql_real_escape_string($_GET['player']) : '';
|
||||||
|
$level = isset($_GET['authlvl']) ? mysql_real_escape_string($_GET['authlvl']) : '';
|
||||||
|
|
||||||
|
if ($level >= $user['authlevel'] && $user['authlevel'] != LEVEL_ADMIN) {
|
||||||
|
AdminMessage('Not enough privilleges to promote user.', $lang['adm_mod_level']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$userData = doquery("SELECT id FROM {{table}} WHERE `username` = '".$player."';", 'users', true);
|
||||||
|
if (empty($user)) {
|
||||||
|
AdminMessage('No such user.', $lang['adm_mod_level']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
doquery("UPDATE {{table}} SET `authlevel` = '{$level}' WHERE id={$userData['id']}", 'users');
|
||||||
|
$message = $lang['adm_mess_lvl1']. " ". $player ." ".$lang['adm_mess_lvl2'];
|
||||||
|
$message .= "<font color=\"red\">".$lang['adm_usr_level'][$level]."</font>!";
|
||||||
|
|
||||||
|
AdminMessage($message, $lang['adm_mod_level']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ip_search':
|
||||||
|
$pattern = isset($_GET['ip']) ? mysql_real_escape_string($_GET['ip']) : '';
|
||||||
|
$SelUser = doquery("SELECT * FROM {{table}} WHERE `user_lastip` = '". $pattern ."' LIMIT 10;", 'users');
|
||||||
|
$bloc = $lang;
|
||||||
|
$bloc['adm_this_ip'] = $pattern;
|
||||||
|
while ( $Usr = mysql_fetch_assoc($SelUser) ) {
|
||||||
|
$UsrMain = doquery("SELECT `name` FROM {{table}} WHERE `id` = '". $Usr['id_planet'] ."';", 'planets', true);
|
||||||
|
$bloc['adm_plyer_lst'] .= "<tr><th>".$Usr['username']."</th><th>[".$Usr['galaxy'].":".$Usr['system'].":".$Usr['planet']."] ".$UsrMain['name']."</th></tr>";
|
||||||
|
}
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_asw2');
|
||||||
|
$parse['adm_sub_form2'] = parsetemplate( $SubPanelTPL, $bloc );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Traiter les reponses aux formulaires
|
||||||
|
if (isset($_GET['action'])) {
|
||||||
|
$bloc = $lang;
|
||||||
|
|
||||||
|
$_SESSION['CSRF'] = sha1(uniqid(null, true));
|
||||||
|
$bloc['csrf_hack'] = $_SESSION['CSRF'];
|
||||||
|
|
||||||
|
switch ($_GET['action']){
|
||||||
|
case 'usr_search':
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_frm1');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'usr_data':
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_frm4');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'usr_level':
|
||||||
|
for ($Lvl = 0; $Lvl < 4; $Lvl++) {
|
||||||
|
$bloc['adm_level_lst'] .= "<option value=\"". $Lvl ."\">". $lang['adm_usr_level'][ $Lvl ] ."</option>";
|
||||||
|
}
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_frm3');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ip_search':
|
||||||
|
$SubPanelTPL = gettemplate('admin/admin_panel_frm2');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$parse['adm_sub_form2'] = parsetemplate( $SubPanelTPL, $bloc );
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = parsetemplate( $PanelMainTPL, $parse );
|
||||||
|
display( $page, $lang['panel_mainttl'], false, '', true );
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
63
admin/planetlist.php
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$query = doquery("SELECT * FROM {{table}} WHERE planet_type='1'", "planets");
|
||||||
|
$i = 0;
|
||||||
|
while ($u = mysql_fetch_array($query)) {
|
||||||
|
$parse['planetes'] .= "<tr>"
|
||||||
|
. "<td class=b><center><b>" . $u[0] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[1] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[4] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[5] . "</center></b></td>"
|
||||||
|
. "<td class=b><center><b>" . $u[6] . "</center></b></td>"
|
||||||
|
. "</tr>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i == "1")
|
||||||
|
$parse['planetes'] .= "<tr><th class=b colspan=5>Il y a qu'une seule planète</th></tr>";
|
||||||
|
else
|
||||||
|
$parse['planetes'] .= "<tr><th class=b colspan=5>Il y a {$i} planètes</th></tr>";
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('admin/planetlist_body'), $parse), 'Planetlist', false, '', true);
|
||||||
|
} else {
|
||||||
|
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Created by e-Zobar. All rights reversed (C) XNova Team 2008
|
||||||
|
?>
|
||||||
310
admin/settings.php
Normal file
|
|
@ -0,0 +1,310 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
|
||||||
|
function DisplayGameSettingsPage ( $CurrentUser ) {
|
||||||
|
global $lang, $gameConfig;
|
||||||
|
|
||||||
|
includeLang('admin/settings');
|
||||||
|
|
||||||
|
if (in_array((int) $CurrentUser['authlevel'], array(LEVEL_ADMIN))) {
|
||||||
|
if ($_POST['opt_save'] == "1") {
|
||||||
|
// Jeu Ouvert ou Ferm<72> !
|
||||||
|
if (isset($_POST['closed']) && $_POST['closed'] == 'on') {
|
||||||
|
$gameConfig['game_disable'] = "1";
|
||||||
|
$gameConfig['close_reason'] = addslashes( $_POST['close_reason'] );
|
||||||
|
} else {
|
||||||
|
$gameConfig['game_disable'] = "0";
|
||||||
|
$gameConfig['close_reason'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Y a un News Frame ? !
|
||||||
|
if (isset($_POST['newsframe']) && $_POST['newsframe'] == 'on') {
|
||||||
|
$gameConfig['OverviewNewsFrame'] = "1";
|
||||||
|
$gameConfig['OverviewNewsText'] = addslashes( $_POST['NewsText'] );
|
||||||
|
} else {
|
||||||
|
$gameConfig['OverviewNewsFrame'] = "0";
|
||||||
|
$gameConfig['OverviewNewsText'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Y a un TCHAT externe ??
|
||||||
|
if (isset($_POST['chatframe']) && $_POST['chatframe'] == 'on') {
|
||||||
|
$gameConfig['OverviewExternChat'] = "1";
|
||||||
|
$gameConfig['OverviewExternChatCmd'] = addslashes( $_POST['ExternChat'] );
|
||||||
|
} else {
|
||||||
|
$gameConfig['OverviewExternChat'] = "0";
|
||||||
|
$gameConfig['OverviewExternChatCmd'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['googlead']) && $_POST['googlead'] == 'on') {
|
||||||
|
$gameConfig['OverviewBanner'] = "1";
|
||||||
|
$gameConfig['OverviewClickBanner'] = addslashes( $_POST['GoogleAds'] );
|
||||||
|
} else {
|
||||||
|
$gameConfig['OverviewBanner'] = "0";
|
||||||
|
$gameConfig['OverviewClickBanner'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Y a un BANNER Frame ?
|
||||||
|
if (isset($_POST['bannerframe']) && $_POST['bannerframe'] == 'on') {
|
||||||
|
$gameConfig['ForumBannerFrame'] = "1";
|
||||||
|
} else {
|
||||||
|
$gameConfig['ForumBannerFrame'] = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mode Debug ou pas !
|
||||||
|
if (isset($_POST['debug']) && $_POST['debug'] == 'on') {
|
||||||
|
$gameConfig['debug'] = "1";
|
||||||
|
} else {
|
||||||
|
$gameConfig['debug'] = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nom du Jeu
|
||||||
|
if (isset($_POST['game_name']) && $_POST['game_name'] != '') {
|
||||||
|
$gameConfig['game_name'] = $_POST['game_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adresse du Forum
|
||||||
|
if (isset($_POST['forum_url']) && $_POST['forum_url'] != '') {
|
||||||
|
$gameConfig['forum_url'] = $_POST['forum_url'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vitesse du Jeu
|
||||||
|
if (isset($_POST['game_speed']) && is_numeric($_POST['game_speed'])) {
|
||||||
|
$gameConfig['game_speed'] = $_POST['game_speed'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vitesse des Flottes
|
||||||
|
if (isset($_POST['fleet_speed']) && is_numeric($_POST['fleet_speed'])) {
|
||||||
|
$gameConfig['fleet_speed'] = $_POST['fleet_speed'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multiplicateur de Production
|
||||||
|
if (isset($_POST['resource_multiplier']) && is_numeric($_POST['resource_multiplier'])) {
|
||||||
|
$gameConfig['resource_multiplier'] = $_POST['resource_multiplier'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Taille de la planete mère
|
||||||
|
if (isset($_POST['initial_fields']) && is_numeric($_POST['initial_fields'])) {
|
||||||
|
$gameConfig['initial_fields'] = $_POST['initial_fields'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Revenu de base Metal
|
||||||
|
if (isset($_POST['metal_basic_income']) && is_numeric($_POST['metal_basic_income'])) {
|
||||||
|
$gameConfig['metal_basic_income'] = $_POST['metal_basic_income'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Revenu de base Cristal
|
||||||
|
if (isset($_POST['crystal_basic_income']) && is_numeric($_POST['crystal_basic_income'])) {
|
||||||
|
$gameConfig['crystal_basic_income'] = $_POST['crystal_basic_income'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Revenu de base Deuterium
|
||||||
|
if (isset($_POST['deuterium_basic_income']) && is_numeric($_POST['deuterium_basic_income'])) {
|
||||||
|
$gameConfig['deuterium_basic_income'] = $_POST['deuterium_basic_income'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Revenu de base Energie
|
||||||
|
if (isset($_POST['energy_basic_income']) && is_numeric($_POST['energy_basic_income'])) {
|
||||||
|
$gameConfig['energy_basic_income'] = $_POST['energy_basic_income'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lien supplémentaire dans le menu
|
||||||
|
if (isset($_POST['enable_link_']) && is_numeric($_POST['enable_link_'])) {
|
||||||
|
$gameConfig['link_enable'] = $_POST['enable_link_'];
|
||||||
|
}
|
||||||
|
// Texte de ce lien...
|
||||||
|
$gameConfig['link_name'] = addslashes( $_POST['name_link_']);
|
||||||
|
|
||||||
|
// URL de ce lien...
|
||||||
|
$gameConfig['link_url'] = $_POST['url_link_'];
|
||||||
|
// Image de la bannière
|
||||||
|
$gameConfig['banner_source_post'] = $_POST['banner_source_post'];
|
||||||
|
// 1 point = ??? Ressources ?
|
||||||
|
if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings'])) {
|
||||||
|
$gameConfig['stat_settings'] = $_POST['stat_settings'];
|
||||||
|
}
|
||||||
|
// Activation -ou non- des annonces
|
||||||
|
if (isset($_POST['enable_announces_']) && is_numeric($_POST['enable_announces_'])) {
|
||||||
|
$gameConfig['enable_announces'] = $_POST['enable_announces_'];
|
||||||
|
}
|
||||||
|
// Activation -ou non- du marchand
|
||||||
|
if (isset($_POST['enable_marchand_']) && is_numeric($_POST['enable_marchand_'])) {
|
||||||
|
$gameConfig['enable_marchand'] = $_POST['enable_marchand_'];
|
||||||
|
}
|
||||||
|
// Activation -ou non- des notes
|
||||||
|
if (isset($_POST['enable_notes_']) && is_numeric($_POST['enable_notes_'])) {
|
||||||
|
$gameConfig['enable_notes'] = $_POST['enable_notes_'];
|
||||||
|
}
|
||||||
|
// Nom du bot antimulti
|
||||||
|
$gameConfig['bot_name'] = addslashes( $_POST['name_bot']);
|
||||||
|
|
||||||
|
// email du bot antimulti
|
||||||
|
$gameConfig['bot_adress'] = addslashes( $_POST['adress_bot']);
|
||||||
|
|
||||||
|
// Activation -ou non- des notes
|
||||||
|
if (isset($_POST['duration_ban']) && is_numeric($_POST['duration_ban'])) {
|
||||||
|
$gameConfig['ban_duration'] = $_POST['duration_ban'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activation -ou non- du bot
|
||||||
|
if (isset($_POST['bot_enable']) && is_numeric($_POST['bot_enable'])) {
|
||||||
|
$gameConfig['enable_bot'] = $_POST['bot_enable'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// BBCode ou pas ?
|
||||||
|
|
||||||
|
if (isset($_POST['bbcode_field']) && is_numeric($_POST['bbcode_field'])) {
|
||||||
|
$gameConfig['enable_bbcode'] = $_POST['bbcode_field'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activation du jeu
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_disable'] ."' WHERE `config_name` = 'game_disable';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['close_reason'] ."' WHERE `config_name` = 'close_reason';", 'config');
|
||||||
|
|
||||||
|
//Stats
|
||||||
|
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['stat_settings'] ."' WHERE `config_name` = 'stat_settings';", 'config');
|
||||||
|
|
||||||
|
|
||||||
|
// Configuration du Jeu
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['forum_url'] ."' WHERE `config_name` = 'forum_url';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_name'] ."' WHERE `config_name` = 'game_name';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['game_speed'] ."' WHERE `config_name` = 'game_speed';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['fleet_speed'] ."' WHERE `config_name` = 'fleet_speed';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['resource_multiplier'] ."' WHERE `config_name` = 'resource_multiplier';", 'config');
|
||||||
|
|
||||||
|
// Page Generale
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewNewsFrame'] ."' WHERE `config_name` = 'OverviewNewsFrame';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewNewsText'] ."' WHERE `config_name` = 'OverviewNewsText';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewExternChat'] ."' WHERE `config_name` = 'OverviewExternChat';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewExternChatCmd'] ."' WHERE `config_name` = 'OverviewExternChatCmd';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewBanner'] ."' WHERE `config_name` = 'OverviewBanner';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['OverviewClickBanner'] ."' WHERE `config_name` = 'OverviewClickBanner';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ForumBannerFrame'] ."' WHERE `config_name` = 'ForumBannerFrame';", 'config');
|
||||||
|
|
||||||
|
//Bannière
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['banner_source_post'] ."' WHERE `config_name` = 'banner_source_post';", 'config');
|
||||||
|
|
||||||
|
// Lien supplémentaire dans le menu
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_enable'] ."' WHERE `config_name` = 'link_enable';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_name'] ."' WHERE `config_name` = 'link_name';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['link_url'] ."' WHERE `config_name` = 'link_url';", 'config');
|
||||||
|
|
||||||
|
// Options Planete
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['initial_fields'] ."' WHERE `config_name` = 'initial_fields';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['metal_basic_income'] ."' WHERE `config_name` = 'metal_basic_income';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['crystal_basic_income'] ."' WHERE `config_name` = 'crystal_basic_income';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['deuterium_basic_income'] ."' WHERE `config_name` = 'deuterium_basic_income';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['energy_basic_income'] ."' WHERE `config_name` = 'energy_basic_income';", 'config');
|
||||||
|
|
||||||
|
//Bot antimulti
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['bot_name'] ."' WHERE `config_name` = 'bot_name';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['bot_adress'] ."' WHERE `config_name` = 'bot_adress';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['ban_duration'] ."' WHERE `config_name` = 'ban_duration';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_bot'] ."' WHERE `config_name` = 'enable_bot';", 'config');
|
||||||
|
|
||||||
|
|
||||||
|
//Réglage du BBCode
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_bbcode'] ."' WHERE `config_name` = 'enable_bbcode';", 'config');
|
||||||
|
|
||||||
|
|
||||||
|
//Controle des pages
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_announces'] ."' WHERE `config_name` = 'enable_announces';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_marchand'] ."' WHERE `config_name` = 'enable_marchand';", 'config');
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '". $gameConfig['enable_notes'] ."' WHERE `config_name` = 'enable_notes';", 'config');
|
||||||
|
|
||||||
|
// Mode Debug
|
||||||
|
doquery("UPDATE {{table}} SET `config_value` = '" .$gameConfig['debug'] ."' WHERE `config_name` ='debug'", 'config');
|
||||||
|
AdminMessage ('Options changees avec succes !', 'Succes', '?');
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['game_name'] = $gameConfig['game_name'];
|
||||||
|
$parse['game_speed'] = $gameConfig['game_speed'];
|
||||||
|
$parse['fleet_speed'] = $gameConfig['fleet_speed'];
|
||||||
|
$parse['resource_multiplier'] = $gameConfig['resource_multiplier'];
|
||||||
|
$parse['forum_url'] = $gameConfig['forum_url'];
|
||||||
|
$parse['initial_fields'] = $gameConfig['initial_fields'];
|
||||||
|
$parse['metal_basic_income'] = $gameConfig['metal_basic_income'];
|
||||||
|
$parse['crystal_basic_income'] = $gameConfig['crystal_basic_income'];
|
||||||
|
$parse['deuterium_basic_income'] = $gameConfig['deuterium_basic_income'];
|
||||||
|
$parse['energy_basic_income'] = $gameConfig['energy_basic_income'];
|
||||||
|
$parse['enable_link'] = $gameConfig['link_enable'];
|
||||||
|
$parse['name_link'] = $gameConfig['link_name'];
|
||||||
|
$parse['url_link'] = $gameConfig['link_url'];
|
||||||
|
$parse['enable_announces'] = $gameConfig['enable_announces'];
|
||||||
|
$parse['enable_marchand'] = $gameConfig['enable_marchand'];
|
||||||
|
$parse['enable_notes'] = $gameConfig['enable_notes'];
|
||||||
|
$parse['bot_name'] = stripslashes($gameConfig['bot_name']);
|
||||||
|
$parse['bot_adress'] = stripslashes($gameConfig['bot_adress']);
|
||||||
|
$parse['ban_duration'] = stripslashes($gameConfig['ban_duration']);
|
||||||
|
$parse['enable_bot'] = stripslashes($gameConfig['enable_bot']);
|
||||||
|
$parse['enable_bbcode'] = stripslashes($gameConfig['enable_bbcode']);
|
||||||
|
|
||||||
|
$parse['banner_source_post'] = $gameConfig['banner_source_post'];
|
||||||
|
$parse['stat_settings'] = stripslashes($gameConfig['stat_settings']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$parse['closed'] = ($gameConfig['game_disable'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
$parse['close_reason'] = stripslashes( $gameConfig['close_reason'] );
|
||||||
|
|
||||||
|
$parse['newsframe'] = ($gameConfig['OverviewNewsFrame'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
$parse['NewsTextVal'] = stripslashes( $gameConfig['OverviewNewsText'] );
|
||||||
|
|
||||||
|
$parse['chatframe'] = ($gameConfig['OverviewExternChat'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
$parse['ExtTchatVal'] = stripslashes( $gameConfig['OverviewExternChatCmd'] );
|
||||||
|
|
||||||
|
$parse['googlead'] = ($gameConfig['OverviewBanner'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
$parse['GoogleAdVal'] = stripslashes( $gameConfig['OverviewClickBanner'] );
|
||||||
|
|
||||||
|
$parse['debug'] = ($gameConfig['debug'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
|
||||||
|
$parse['bannerframe'] = ($gameConfig['ForumBannerFrame'] == 1) ? " checked = 'checked' ":"";
|
||||||
|
|
||||||
|
$PageTPL = gettemplate('admin/options_body');
|
||||||
|
$Page .= parsetemplate( $PageTPL, $parse );
|
||||||
|
|
||||||
|
display ( $Page, $lang['adm_opt_title'], false, '', true );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
return $Page;
|
||||||
|
}
|
||||||
|
|
||||||
|
$Page = DisplayGameSettingsPage ( $user );
|
||||||
|
|
||||||
|
?>
|
||||||
270
admin/statbuilder.php
Normal file
|
|
@ -0,0 +1,270 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
include(ROOT_PATH . 'admin/statfunctions.' . PHPEXT);
|
||||||
|
|
||||||
|
|
||||||
|
if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
|
||||||
|
$StatDate = time();
|
||||||
|
// Rotation des statistiques
|
||||||
|
doquery ( "DELETE FROM {{table}} WHERE `stat_code` = '2';" , 'statpoints');
|
||||||
|
doquery ( "UPDATE {{table}} SET `stat_code` = `stat_code` + '1';" , 'statpoints');
|
||||||
|
|
||||||
|
$GameUsers = doquery("SELECT * FROM {{table}} WHERE authlevel<3", 'users');
|
||||||
|
|
||||||
|
while ($CurUser = mysql_fetch_assoc($GameUsers)) {
|
||||||
|
// Recuperation des anciennes statistiques
|
||||||
|
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';",'statpoints');
|
||||||
|
if ($OldStatRecord) {
|
||||||
|
$OldTotalRank = $OldStatRecord['total_rank'];
|
||||||
|
$OldTechRank = $OldStatRecord['tech_rank'];
|
||||||
|
$OldBuildRank = $OldStatRecord['build_rank'];
|
||||||
|
$OldDefsRank = $OldStatRecord['defs_rank'];
|
||||||
|
$OldFleetRank = $OldStatRecord['fleet_rank'];
|
||||||
|
// Suppression de l'ancien enregistrement
|
||||||
|
doquery ("DELETE FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';",'statpoints');
|
||||||
|
} else {
|
||||||
|
$OldTotalRank = 0;
|
||||||
|
$OldTechRank = 0;
|
||||||
|
$OldBuildRank = 0;
|
||||||
|
$OldDefsRank = 0;
|
||||||
|
$OldFleetRank = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Total des unitées consommée pour la recherche
|
||||||
|
$Points = GetTechnoPoints ( $CurUser );
|
||||||
|
$TTechCount = $Points['TechCount'];
|
||||||
|
$TTechPoints = ($Points['TechPoint'] / $gameConfig['stat_settings']);
|
||||||
|
|
||||||
|
// Totalisation des points accumulés par planete
|
||||||
|
$TBuildCount = 0;
|
||||||
|
$TBuildPoints = 0;
|
||||||
|
$TDefsCount = 0;
|
||||||
|
$TDefsPoints = 0;
|
||||||
|
$TFleetCount = 0;
|
||||||
|
$TFleetPoints = 0;
|
||||||
|
$GCount = $TTechCount;
|
||||||
|
$GPoints = $TTechPoints;
|
||||||
|
$UsrPlanets = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '". $CurUser['id'] ."';", 'planets');
|
||||||
|
while ($CurPlanet = mysql_fetch_assoc($UsrPlanets) ) {
|
||||||
|
$Points = GetBuildPoints ( $CurPlanet );
|
||||||
|
$TBuildCount += $Points['BuildCount'];
|
||||||
|
$GCount += $Points['BuildCount'];
|
||||||
|
$PlanetPoints = ($Points['BuildPoint'] / $gameConfig['stat_settings']);
|
||||||
|
$TBuildPoints += ($Points['BuildPoint'] / $gameConfig['stat_settings']);
|
||||||
|
|
||||||
|
$Points = GetDefensePoints ( $CurPlanet );
|
||||||
|
$TDefsCount += $Points['DefenseCount'];;
|
||||||
|
$GCount += $Points['DefenseCount'];
|
||||||
|
$PlanetPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']);
|
||||||
|
$TDefsPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']);
|
||||||
|
|
||||||
|
$Points = GetFleetPoints ( $CurPlanet );
|
||||||
|
$TFleetCount += $Points['FleetCount'];
|
||||||
|
$GCount += $Points['FleetCount'];
|
||||||
|
$PlanetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']);
|
||||||
|
$TFleetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']);
|
||||||
|
|
||||||
|
$GPoints += $PlanetPoints;
|
||||||
|
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdatePlanet .= "`points` = '". $PlanetPoints ."' ";
|
||||||
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
|
$QryUpdatePlanet .= "`id` = '". $CurPlanet['id'] ."';";
|
||||||
|
doquery ( $QryUpdatePlanet , 'planets');
|
||||||
|
}
|
||||||
|
|
||||||
|
$QryInsertStats = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertStats .= "`id_owner` = '". $CurUser['id'] ."', ";
|
||||||
|
$QryInsertStats .= "`id_ally` = '". $CurUser['ally_id'] ."', ";
|
||||||
|
$QryInsertStats .= "`stat_type` = '1', "; // 1 pour joueur , 2 pour alliance
|
||||||
|
$QryInsertStats .= "`stat_code` = '1', "; // de 1 a 2 mis a jour de maniere automatique
|
||||||
|
$QryInsertStats .= "`tech_points` = '". $TTechPoints ."', ";
|
||||||
|
$QryInsertStats .= "`tech_count` = '". $TTechCount ."', ";
|
||||||
|
$QryInsertStats .= "`tech_old_rank` = '". $OldTechRank ."', ";
|
||||||
|
$QryInsertStats .= "`build_points` = '". $TBuildPoints ."', ";
|
||||||
|
$QryInsertStats .= "`build_count` = '". $TBuildCount ."', ";
|
||||||
|
$QryInsertStats .= "`build_old_rank` = '". $OldBuildRank ."', ";
|
||||||
|
$QryInsertStats .= "`defs_points` = '". $TDefsPoints ."', ";
|
||||||
|
$QryInsertStats .= "`defs_count` = '". $TDefsCount ."', ";
|
||||||
|
$QryInsertStats .= "`defs_old_rank` = '". $OldDefsRank ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_points` = '". $TFleetPoints ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_count` = '". $TFleetCount ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_old_rank` = '". $OldFleetRank ."', ";
|
||||||
|
$QryInsertStats .= "`total_points` = '". $GPoints ."', ";
|
||||||
|
$QryInsertStats .= "`total_count` = '". $GCount ."', ";
|
||||||
|
$QryInsertStats .= "`total_old_rank` = '". $OldTotalRank ."', ";
|
||||||
|
$QryInsertStats .= "`stat_date` = '". $StatDate ."';";
|
||||||
|
doquery ( $QryInsertStats , 'statpoints');
|
||||||
|
}
|
||||||
|
|
||||||
|
$Rank = 1;
|
||||||
|
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `tech_points` DESC;", 'statpoints');
|
||||||
|
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
|
||||||
|
$QryUpdateStats = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateStats .= "`tech_rank` = '". $Rank ."' ";
|
||||||
|
$QryUpdateStats .= "WHERE ";
|
||||||
|
$QryUpdateStats .= " `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
|
||||||
|
doquery ( $QryUpdateStats , 'statpoints');
|
||||||
|
$Rank++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$Rank = 1;
|
||||||
|
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `build_points` DESC;", 'statpoints');
|
||||||
|
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
|
||||||
|
$QryUpdateStats = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateStats .= "`build_rank` = '". $Rank ."' ";
|
||||||
|
$QryUpdateStats .= "WHERE ";
|
||||||
|
$QryUpdateStats .= " `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
|
||||||
|
doquery ( $QryUpdateStats , 'statpoints');
|
||||||
|
$Rank++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$Rank = 1;
|
||||||
|
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `defs_points` DESC;", 'statpoints');
|
||||||
|
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
|
||||||
|
$QryUpdateStats = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateStats .= "`defs_rank` = '". $Rank ."' ";
|
||||||
|
$QryUpdateStats .= "WHERE ";
|
||||||
|
$QryUpdateStats .= " `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
|
||||||
|
doquery ( $QryUpdateStats , 'statpoints');
|
||||||
|
$Rank++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$Rank = 1;
|
||||||
|
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `fleet_points` DESC;", 'statpoints');
|
||||||
|
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
|
||||||
|
$QryUpdateStats = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateStats .= "`fleet_rank` = '". $Rank ."' ";
|
||||||
|
$QryUpdateStats .= "WHERE ";
|
||||||
|
$QryUpdateStats .= " `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
|
||||||
|
doquery ( $QryUpdateStats , 'statpoints');
|
||||||
|
$Rank++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$Rank = 1;
|
||||||
|
$RankQry = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `total_points` DESC;", 'statpoints');
|
||||||
|
while ($TheRank = mysql_fetch_assoc($RankQry) ) {
|
||||||
|
$QryUpdateStats = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateStats .= "`total_rank` = '". $Rank ."' ";
|
||||||
|
$QryUpdateStats .= "WHERE ";
|
||||||
|
$QryUpdateStats .= " `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';";
|
||||||
|
doquery ( $QryUpdateStats , 'statpoints');
|
||||||
|
$Rank++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Statistiques des alliances ...
|
||||||
|
$GameAllys = doquery("SELECT * FROM {{table}}", 'alliance');
|
||||||
|
|
||||||
|
while ($CurAlly = mysql_fetch_assoc($GameAllys)) {
|
||||||
|
// Recuperation des anciennes statistiques
|
||||||
|
$OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '".$CurAlly['id']."';",'statpoints');
|
||||||
|
if ($OldStatRecord) {
|
||||||
|
$OldTotalRank = $OldStatRecord['total_rank'];
|
||||||
|
$OldTechRank = $OldStatRecord['tech_rank'];
|
||||||
|
$OldBuildRank = $OldStatRecord['build_rank'];
|
||||||
|
$OldDefsRank = $OldStatRecord['defs_rank'];
|
||||||
|
$OldFleetRank = $OldStatRecord['fleet_rank'];
|
||||||
|
// Suppression de l'ancien enregistrement
|
||||||
|
doquery ("DELETE FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '".$CurAlly['id']."';",'statpoints');
|
||||||
|
} else {
|
||||||
|
$OldTotalRank = 0;
|
||||||
|
$OldTechRank = 0;
|
||||||
|
$OldBuildRank = 0;
|
||||||
|
$OldDefsRank = 0;
|
||||||
|
$OldFleetRank = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Total des unitées consommée pour la recherche
|
||||||
|
$QrySumSelect = "SELECT ";
|
||||||
|
$QrySumSelect .= "SUM(`tech_points`) as `TechPoint`, ";
|
||||||
|
$QrySumSelect .= "SUM(`tech_count`) as `TechCount`, ";
|
||||||
|
$QrySumSelect .= "SUM(`build_points`) as `BuildPoint`, ";
|
||||||
|
$QrySumSelect .= "SUM(`build_count`) as `BuildCount`, ";
|
||||||
|
$QrySumSelect .= "SUM(`defs_points`) as `DefsPoint`, ";
|
||||||
|
$QrySumSelect .= "SUM(`defs_count`) as `DefsCount`, ";
|
||||||
|
$QrySumSelect .= "SUM(`fleet_points`) as `FleetPoint`, ";
|
||||||
|
$QrySumSelect .= "SUM(`fleet_count`) as `FleetCount`, ";
|
||||||
|
$QrySumSelect .= "SUM(`total_points`) as `TotalPoint`, ";
|
||||||
|
$QrySumSelect .= "SUM(`total_count`) as `TotalCount` ";
|
||||||
|
$QrySumSelect .= "FROM {{table}} ";
|
||||||
|
$QrySumSelect .= "WHERE ";
|
||||||
|
$QrySumSelect .= "`stat_type` = '1' AND ";
|
||||||
|
$QrySumSelect .= "`id_ally` = '". $CurAlly['id'] ."';";
|
||||||
|
$Points = doquery( $QrySumSelect, 'statpoints', true);
|
||||||
|
|
||||||
|
$TTechCount = $Points['TechCount'];
|
||||||
|
$TTechPoints = $Points['TechPoint'];
|
||||||
|
$TBuildCount = $Points['BuildCount'];
|
||||||
|
$TBuildPoints = $Points['BuildPoint'];
|
||||||
|
$TDefsCount = $Points['DefsCount'];
|
||||||
|
$TDefsPoints = $Points['DefsPoint'];
|
||||||
|
$TFleetCount = $Points['FleetCount'];
|
||||||
|
$TFleetPoints = $Points['FleetPoint'];
|
||||||
|
$GCount = $Points['TotalCount'];
|
||||||
|
$GPoints = $Points['TotalPoint'];
|
||||||
|
|
||||||
|
$QryInsertStats = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertStats .= "`id_owner` = '". $CurAlly['id'] ."', ";
|
||||||
|
$QryInsertStats .= "`id_ally` = '0', ";
|
||||||
|
$QryInsertStats .= "`stat_type` = '2', "; // 1 pour joueur , 2 pour alliance
|
||||||
|
$QryInsertStats .= "`stat_code` = '1', "; // de 1 a 5 mis a jour de maniere automatique
|
||||||
|
$QryInsertStats .= "`tech_points` = '". $TTechPoints ."', ";
|
||||||
|
$QryInsertStats .= "`tech_count` = '". $TTechCount ."', ";
|
||||||
|
$QryInsertStats .= "`tech_old_rank` = '". $OldTechRank ."', ";
|
||||||
|
$QryInsertStats .= "`build_points` = '". $TBuildPoints ."', ";
|
||||||
|
$QryInsertStats .= "`build_count` = '". $TBuildCount ."', ";
|
||||||
|
$QryInsertStats .= "`build_old_rank` = '". $OldBuildRank ."', ";
|
||||||
|
$QryInsertStats .= "`defs_points` = '". $TDefsPoints ."', ";
|
||||||
|
$QryInsertStats .= "`defs_count` = '". $TDefsCount ."', ";
|
||||||
|
$QryInsertStats .= "`defs_old_rank` = '". $OldDefsRank ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_points` = '". $TFleetPoints ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_count` = '". $TFleetCount ."', ";
|
||||||
|
$QryInsertStats .= "`fleet_old_rank` = '". $OldFleetRank ."', ";
|
||||||
|
$QryInsertStats .= "`total_points` = '". $GPoints ."', ";
|
||||||
|
$QryInsertStats .= "`total_count` = '". $GCount ."', ";
|
||||||
|
$QryInsertStats .= "`total_old_rank` = '". $OldTotalRank ."', ";
|
||||||
|
$QryInsertStats .= "`stat_date` = '". $StatDate ."';";
|
||||||
|
doquery ( $QryInsertStats , 'statpoints');
|
||||||
|
}
|
||||||
|
|
||||||
|
AdminMessage ( $lang['adm_done'], $lang['adm_stat_title'] );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
107
admin/statfunctions.php
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function GetTechnoPoints ( $CurrentUser ) {
|
||||||
|
global $resource, $pricelist, $reslist;
|
||||||
|
|
||||||
|
$TechCounts = 0;
|
||||||
|
$TechPoints = 0;
|
||||||
|
foreach ( $reslist['tech'] as $n => $Techno ) {
|
||||||
|
if ( $CurrentUser[ $resource[ $Techno ] ] > 0 ) {
|
||||||
|
for ( $Level = 1; $Level < $CurrentUser[ $resource[ $Techno ] ]; $Level++ ) {
|
||||||
|
$Units = $pricelist[ $Techno ]['metal'] + $pricelist[ $Techno ]['crystal'] + $pricelist[ $Techno ]['deuterium'];
|
||||||
|
$LevelMul = pow( $pricelist[ $Techno ]['factor'], $Level );
|
||||||
|
$TechPoints += ($Units * $LevelMul);
|
||||||
|
$TechCounts += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$RetValue['TechCount'] = $TechCounts;
|
||||||
|
$RetValue['TechPoint'] = $TechPoints;
|
||||||
|
|
||||||
|
return $RetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetBuildPoints ( $CurrentPlanet ) {
|
||||||
|
global $resource, $pricelist, $reslist;
|
||||||
|
|
||||||
|
$BuildCounts = 0;
|
||||||
|
$BuildPoints = 0;
|
||||||
|
foreach($reslist['build'] as $n => $Building) {
|
||||||
|
if ( $CurrentPlanet[ $resource[ $Building ] ] > 0 ) {
|
||||||
|
for ( $Level = 1; $Level < $CurrentPlanet[ $resource[ $Building ] ]; $Level++ ) {
|
||||||
|
$Units = $pricelist[ $Building ]['metal'] + $pricelist[ $Building ]['crystal'] + $pricelist[ $Building ]['deuterium'];
|
||||||
|
$LevelMul = pow( $pricelist[ $Building ]['factor'], $Level );
|
||||||
|
$BuildPoints += ($Units * $LevelMul);
|
||||||
|
$BuildCounts += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$RetValue['BuildCount'] = $BuildCounts;
|
||||||
|
$RetValue['BuildPoint'] = $BuildPoints;
|
||||||
|
|
||||||
|
return $RetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDefensePoints ( $CurrentPlanet ) {
|
||||||
|
global $resource, $pricelist, $reslist;
|
||||||
|
|
||||||
|
$DefenseCounts = 0;
|
||||||
|
$DefensePoints = 0;
|
||||||
|
foreach($reslist['defense'] as $n => $Defense) {
|
||||||
|
if ($CurrentPlanet[ $resource[ $Defense ] ] > 0) {
|
||||||
|
$Units = $pricelist[ $Defense ]['metal'] + $pricelist[ $Defense ]['crystal'] + $pricelist[ $Defense ]['deuterium'];
|
||||||
|
$DefensePoints += ($Units * $CurrentPlanet[ $resource[ $Defense ] ]);
|
||||||
|
$DefenseCounts += $CurrentPlanet[ $resource[ $Defense ] ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$RetValue['DefenseCount'] = $DefenseCounts;
|
||||||
|
$RetValue['DefensePoint'] = $DefensePoints;
|
||||||
|
|
||||||
|
return $RetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFleetPoints ( $CurrentPlanet ) {
|
||||||
|
global $resource, $pricelist, $reslist;
|
||||||
|
|
||||||
|
$FleetCounts = 0;
|
||||||
|
$FleetPoints = 0;
|
||||||
|
foreach($reslist['fleet'] as $n => $Fleet) {
|
||||||
|
if ($CurrentPlanet[ $resource[ $Fleet ] ] > 0) {
|
||||||
|
$Units = $pricelist[ $Fleet ]['metal'] + $pricelist[ $Fleet ]['crystal'] + $pricelist[ $Fleet ]['deuterium'];
|
||||||
|
$FleetPoints += ($Units * $CurrentPlanet[ $resource[ $Fleet ] ]);
|
||||||
|
$FleetCounts += $CurrentPlanet[ $resource[ $Fleet ] ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$RetValue['FleetCount'] = $FleetCounts;
|
||||||
|
$RetValue['FleetPoint'] = $FleetPoints;
|
||||||
|
|
||||||
|
return $RetValue;
|
||||||
|
}
|
||||||
57
admin/unbanned.php
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
$mode = $_GET['mode'];
|
||||||
|
|
||||||
|
if ($mode != 'change') {
|
||||||
|
$parse['Name'] = "Nom du joueur";
|
||||||
|
} elseif ($mode == 'change') {
|
||||||
|
$nam = $_POST['nam'];
|
||||||
|
doquery("DELETE FROM {{table}} WHERE who2='{$nam}'", 'banned');
|
||||||
|
doquery("UPDATE {{table}} SET bana=0, banaday=0 WHERE username='{$nam}'", "users");
|
||||||
|
message("Le joueur {$nam} a bien été débanni!", 'Information');
|
||||||
|
}
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('admin/unbanned'), $parse), "Overview", false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
89
admin/userlist.php
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||||
|
includeLang('admin');
|
||||||
|
if ($_GET['cmd'] == 'dele') {
|
||||||
|
DeleteSelectedUser ( $_GET['user'] );
|
||||||
|
}
|
||||||
|
if ($_GET['cmd'] == 'sort') {
|
||||||
|
$TypeSort = $_GET['type'];
|
||||||
|
} else {
|
||||||
|
$TypeSort = "id";
|
||||||
|
}
|
||||||
|
|
||||||
|
$PageTPL = gettemplate('admin/userlist_body');
|
||||||
|
$RowsTPL = gettemplate('admin/userlist_rows');
|
||||||
|
|
||||||
|
$query = doquery("SELECT * FROM {{table}} ORDER BY `". $TypeSort ."` ASC", 'users');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['adm_ul_table'] = "";
|
||||||
|
$i = 0;
|
||||||
|
$Color = "lime";
|
||||||
|
while ($u = mysql_fetch_assoc ($query) ) {
|
||||||
|
if ($PrevIP != "") {
|
||||||
|
if ($PrevIP == $u['user_lastip']) {
|
||||||
|
$Color = "red";
|
||||||
|
} else {
|
||||||
|
$Color = "lime";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$Bloc['adm_ul_data_id'] = $u['id'];
|
||||||
|
$Bloc['adm_ul_data_name'] = $u['username'];
|
||||||
|
$Bloc['adm_ul_data_mail'] = $u['email'];
|
||||||
|
$Bloc['ip_adress_at_register'] = $u['ip_at_reg'];
|
||||||
|
$Bloc['adm_ul_data_adip'] = "<font color=\"".$Color."\">". $u['user_lastip'] ."</font>";
|
||||||
|
$Bloc['adm_ul_data_regd'] = gmdate ( "d/m/Y G:i:s", $u['register_time'] );
|
||||||
|
$Bloc['adm_ul_data_lconn'] = gmdate ( "d/m/Y G:i:s", $u['onlinetime'] );
|
||||||
|
$Bloc['adm_ul_data_banna'] = ( $u['bana'] == 1 ) ? "<a href # title=\"". gmdate ( "d/m/Y G:i:s", $u['banaday']) ."\">". $lang['adm_ul_yes'] ."</a>" : $lang['adm_ul_no'];
|
||||||
|
$Bloc['adm_ul_data_detai'] = ""; // Lien vers une page de details genre Empire
|
||||||
|
$Bloc['adm_ul_data_actio'] = "<a href=\"userlist.php?cmd=dele&user=".$u['id']."\"><img src=\"../images/r1.png\"></a>"; // Lien vers actions 'effacer'
|
||||||
|
|
||||||
|
|
||||||
|
$PrevIP = $u['user_lastip'];
|
||||||
|
$parse['adm_ul_table'] .= parsetemplate( $RowsTPL, $Bloc );
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$parse['adm_ul_count'] = $i;
|
||||||
|
|
||||||
|
$page = parsetemplate( $PageTPL, $parse );
|
||||||
|
display( $page, $lang['adm_ul_title'], false, '', true);
|
||||||
|
} else {
|
||||||
|
message( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
47
admin/variables.php
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('IN_ADMIN', true);
|
||||||
|
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||||
|
|
||||||
|
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||||
|
|
||||||
|
$parse['phpinfo'] = phpinfo();
|
||||||
|
|
||||||
|
$Page = parsetemplate($PageTPL, $parse);
|
||||||
|
|
||||||
|
display ( $Page, "PhpInfo", false, '', true);
|
||||||
|
} else {
|
||||||
|
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
71
ainfo.php
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
$dpath = (!$userrow["dpath"]) ? DEFAULT_SKINPATH : $userrow["dpath"];
|
||||||
|
|
||||||
|
|
||||||
|
if(!is_numeric($_GET["a"]) || !$_GET["a"] ){ message("Ungültige Allianz-ID","Fehler");}
|
||||||
|
|
||||||
|
$allyrow = doquery("SELECT ally_name,ally_tag,ally_description,ally_web,ally_image FROM {{table}} WHERE id=".$_GET["a"],"alliance",true);
|
||||||
|
|
||||||
|
if(!$allyrow){ message("Alliance non trouvée","Erreur");}
|
||||||
|
|
||||||
|
$count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=".$_GET["a"].";","users",true);
|
||||||
|
$ally_member_scount = $count[0];
|
||||||
|
|
||||||
|
$page .="<table width=519><tr><td class=c colspan=2>Informations sur l'alliance</td></tr>";
|
||||||
|
|
||||||
|
if($allyrow["ally_image"] != ""){
|
||||||
|
$page .= "<tr><th colspan=2><img src=\"".$allyrow["ally_image"]."\"></td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "<tr><th>Tag</th><th>".$allyrow["ally_tag"]."</th></tr><tr><th>Nom</th><th>".$allyrow["ally_name"]."</th></tr><tr><th>Membres</th><th>$ally_member_scount</th></tr>";
|
||||||
|
|
||||||
|
if($allyrow["ally_description"] != ""){
|
||||||
|
$page .= "<tr><th colspan=2 height=100>".$allyrow["ally_description"]."</th></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($allyrow["ally_web"] != ""){
|
||||||
|
$page .="<tr>
|
||||||
|
<th>Site internet</th>
|
||||||
|
<th><a href=\"".$allyrow["ally_web"]."\">".$allyrow["ally_web"]."</a></th>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
$page .= "</table>";
|
||||||
|
|
||||||
|
display($page,"Information sur l'alliance [".$allyrow["ally_name"]."]",false);
|
||||||
|
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
1199
alliance.php
Normal file
124
annonce.php
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users');
|
||||||
|
$annonce = doquery("SELECT * FROM {{table}} ", 'annonce');
|
||||||
|
$action = $_GET['action'];
|
||||||
|
|
||||||
|
if ($action == 5) {
|
||||||
|
$metalvendre = $_POST['metalvendre'];
|
||||||
|
$cristalvendre = $_POST['cristalvendre'];
|
||||||
|
$deutvendre = $_POST['deutvendre'];
|
||||||
|
|
||||||
|
$metalsouhait = $_POST['metalsouhait'];
|
||||||
|
$cristalsouhait = $_POST['cristalsouhait'];
|
||||||
|
$deutsouhait = $_POST['deutsouhait'];
|
||||||
|
|
||||||
|
while ($v_annonce = mysql_fetch_array($users)) {
|
||||||
|
$user = $v_annonce['username'];
|
||||||
|
$galaxie = $v_annonce['galaxy'];
|
||||||
|
$systeme = $v_annonce['system'];
|
||||||
|
}
|
||||||
|
|
||||||
|
doquery("INSERT INTO {{table}} SET
|
||||||
|
user='{$user}',
|
||||||
|
galaxie='{$galaxie}',
|
||||||
|
systeme='{$systeme}',
|
||||||
|
metala='{$metalvendre}',
|
||||||
|
cristala='{$cristalvendre}',
|
||||||
|
deuta='{$deutvendre}',
|
||||||
|
metals='{$metalsouhait}',
|
||||||
|
cristals='{$cristalsouhait}',
|
||||||
|
deuts='{$deutsouhait}'" , "annonce");
|
||||||
|
|
||||||
|
$page2 .= <<<HTML
|
||||||
|
<center>
|
||||||
|
<br>
|
||||||
|
<p>Votre Annonce a bien été enregistrée !</p>
|
||||||
|
<br><p><a href="annonce.php">Retour aux annonces</a></p>
|
||||||
|
|
||||||
|
HTML;
|
||||||
|
|
||||||
|
display($page2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action != 5) {
|
||||||
|
$annonce = doquery("SELECT * FROM {{table}} ORDER BY `id` DESC ", "annonce");
|
||||||
|
|
||||||
|
$page2 = "<HTML>
|
||||||
|
<center>
|
||||||
|
<br>
|
||||||
|
<table width=\"600\">
|
||||||
|
<td class=\"c\" colspan=\"10\"><font color=\"#FFFFFF\">Petites Annonces</font></td></tr>
|
||||||
|
<tr><th colspan=\"3\">Infos de livraison</th><th colspan=\"3\">Ressources à vendre</th><th colspan=\"3\">Ressources souhaitées</th><th>Action</th></tr>
|
||||||
|
<tr><th>Vendeur</th><th>Galaxie</th><th>Système</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Delet</th></tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
";
|
||||||
|
while ($b = mysql_fetch_array($annonce)) {
|
||||||
|
$page2 .= '<tr><th> ';
|
||||||
|
$page2 .= $b["user"] ;
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["galaxie"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["systeme"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["metala"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["gcristala"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["deuta"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["metals"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["cristals"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= $b["deuts"];
|
||||||
|
$page2 .= '</th><th>';
|
||||||
|
$page2 .= "</th></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page2 .= "
|
||||||
|
<tr><th colspan=\"10\" align=\"center\"><a href=\"annonce2.php?action=2\">Ajouter une Annonce</a></th></tr>
|
||||||
|
</td>
|
||||||
|
</table>
|
||||||
|
</HTML>";
|
||||||
|
|
||||||
|
display($page2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Créer par Tom1991 Copyright 2008
|
||||||
|
// Merci au site Spacon pour m'avoir donner l'inspiration
|
||||||
|
?>
|
||||||
62
annonce2.php
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
$actions = $_GET['action'];
|
||||||
|
|
||||||
|
if($actions == 2)
|
||||||
|
{
|
||||||
|
$page .=<<<HTML
|
||||||
|
<center>
|
||||||
|
<br>
|
||||||
|
<table width="600">
|
||||||
|
<td class="c" colspan="10" align="center"><b><font color="white">Ajouter une Annonce</font></b></td></tr>
|
||||||
|
<td class="c" colspan="10" align="center"><b>Ressources à Vendre</font></b></td></tr>
|
||||||
|
|
||||||
|
<form action="annonce.php?action=5" method="post">
|
||||||
|
<tr><th colspan="5">Métal</th><th colspan="5"><input type="texte" value="0" name="metalvendre" /></th></tr>
|
||||||
|
<tr><th colspan="5">Cristal</th><th colspan="5"><input type="texte" value="0" name="cristalvendre" /></th></tr>
|
||||||
|
<tr><th colspan="5">Deuterium</th><th colspan="5"><input type="texte" value="0" name="deutvendre" /></th></tr>
|
||||||
|
<td class="c" colspan="10" align="center"><b>Ressources Souhaitées</font></b></td></tr>
|
||||||
|
<tr><th colspan="5">Métal</th><th colspan="5"><input type="texte" value="0" name="metalsouhait" /></th></tr>
|
||||||
|
<tr><th colspan="5">Cristal</th><th colspan="5"><input type="texte" value="0" name="cristalsouhait" /></th></tr>
|
||||||
|
<tr><th colspan="5">Deuterium</th><th colspan="5"><input type="texte" value="0" name="deutsouhait" /></th></tr>
|
||||||
|
<tr><th colspan="10"><input type="submit" value="Envoyer" /></th></tr>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
</table>
|
||||||
|
HTML;
|
||||||
|
|
||||||
|
display($page);
|
||||||
|
}
|
||||||
|
?>
|
||||||
64
banned.php
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
|
||||||
|
includeLang('banned');
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['dpath'] = $dpath;
|
||||||
|
$parse['mf'] = $mf;
|
||||||
|
|
||||||
|
|
||||||
|
$query = doquery("SELECT * FROM {{table}} ORDER BY `id`;",'banned');
|
||||||
|
$i=0;
|
||||||
|
while($u = mysql_fetch_array($query)){
|
||||||
|
$parse['banned'] .=
|
||||||
|
"<tr><td class=b><center><b>".$u[1]."</center></td></b>".
|
||||||
|
"<td class=b><center><b>".$u[2]."</center></b></td>".
|
||||||
|
"<td class=b><center><b>".date("d/m/Y G:i:s",$u[4])."</center></b></td>".
|
||||||
|
"<td class=b><center><b>".date("d/m/Y G:i:s",$u[5])."</center></b></td>".
|
||||||
|
"<td class=b><center><b>".$u[6]."</center></b></td></tr>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i=="0")
|
||||||
|
$parse['banned'] .= "<tr><th class=b colspan=6>Il n'y a pas de joueurs bannis</th></tr>";
|
||||||
|
else
|
||||||
|
$parse['banned'] .= "<tr><th class=b colspan=6>Il y a {$i} joueurs bannis</th></tr>";
|
||||||
|
|
||||||
|
display(parsetemplate(gettemplate('banned_body'), $parse),'Banned',true);
|
||||||
|
|
||||||
|
|
||||||
|
// Created by e-Zobar (XNova Team). All rights reversed (C) 2008
|
||||||
|
?>
|
||||||
230
buddy.php
Normal file
|
|
@ -0,0 +1,230 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('buddy');
|
||||||
|
|
||||||
|
$a = $_GET['a'];
|
||||||
|
$e = $_GET['e'];
|
||||||
|
$s = $_GET['s'];
|
||||||
|
$u = intval( $_GET['u'] );
|
||||||
|
|
||||||
|
if ( $s == 1 && isset( $_GET['bid'] ) ) {
|
||||||
|
// Effacer une entree de la liste d'amis
|
||||||
|
$bid = intval( $_GET['bid'] );
|
||||||
|
|
||||||
|
$buddy = doquery( "SELECT * FROM {{table}} WHERE `id` = '".$bid."';", 'buddy', true );
|
||||||
|
if ( $buddy['owner'] == $user['id'] ) {
|
||||||
|
if ( $buddy['active'] == 0 && $a == 1 ) {
|
||||||
|
doquery( "DELETE FROM {{table}} WHERE `id` = '".$bid."';", 'buddy' );
|
||||||
|
} elseif ( $buddy['active'] == 1 ) {
|
||||||
|
doquery( "DELETE FROM {{table}} WHERE `id` = '".$bid."';", 'buddy' );
|
||||||
|
} elseif ( $buddy['active'] == 0 ) {
|
||||||
|
doquery( "UPDATE {{table}} SET `active` = '1' WHERE `id` = '".$bid."';", 'buddy' );
|
||||||
|
}
|
||||||
|
} elseif ( $buddy['sender'] == $user['id'] ) {
|
||||||
|
doquery( "DELETE FROM {{table}} WHERE `id` = '".$bid."';", 'buddy' );
|
||||||
|
}
|
||||||
|
} elseif ( $_POST["s"] == 3 && $_POST["a"] == 1 && $_POST["e"] == 1 && isset( $_POST["u"] ) ) {
|
||||||
|
// Traitement de l'enregistrement de la demande d'entree dans la liste d'amis
|
||||||
|
$uid = $user["id"];
|
||||||
|
$u = intval( $_POST["u"] );
|
||||||
|
|
||||||
|
$buddy = doquery( "SELECT * FROM {{table}} WHERE sender={$uid} AND owner={$u} OR sender={$u} AND owner={$uid}", 'buddy', true );
|
||||||
|
|
||||||
|
if ( !$buddy ) {
|
||||||
|
if ( strlen( $_POST['text'] ) > 5000 ) {
|
||||||
|
message( "Le texte ne doit pas faire plus de 5000 caractères !", "Erreur" );
|
||||||
|
}
|
||||||
|
$text = mysql_escape_string( strip_tags( $_POST['text'] ) );
|
||||||
|
doquery( "INSERT INTO {{table}} SET sender={$uid}, owner={$u}, active=0, text='{$text}'", 'buddy' );
|
||||||
|
message( $lang['Request_sent'], $lang['Buddy_request'], 'buddy.php' );
|
||||||
|
} else {
|
||||||
|
message( $lang['A_request_exists_already_for_this_user'], $lang['Buddy_request'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = "<br>";
|
||||||
|
|
||||||
|
if ( $a == 2 && isset( $u ) ) {
|
||||||
|
// Saisie texte de demande d'entree dans la liste d'amis
|
||||||
|
$u = doquery( "SELECT * FROM {{table}} WHERE id='$u'", "users", true );
|
||||||
|
if ( isset( $u ) && $u["id"] != $user["id"] ) {
|
||||||
|
$page .= "
|
||||||
|
<script src=\"scripts/cntchar.js\" type=\"text/javascript\"></script>
|
||||||
|
<script src=\"scripts/win.js\" type=\"text/javascript\"></script>
|
||||||
|
<center>
|
||||||
|
<form action=buddy.php method=post>
|
||||||
|
<input type=hidden name=a value=1>
|
||||||
|
<input type=hidden name=s value=3>
|
||||||
|
<input type=hidden name=e value=1>
|
||||||
|
<input type=hidden name=u value=" . $u["id"] . ">
|
||||||
|
<table width=519>
|
||||||
|
<tr>
|
||||||
|
<td class=c colspan=2>{$lang['Buddy_request']}</td>
|
||||||
|
</tr><tr>
|
||||||
|
<th>{$lang['Player']}</th>
|
||||||
|
<th>" . $u["username"] . "</th>
|
||||||
|
</tr><tr>
|
||||||
|
<th>{$lang['Request_text']} (<span id=\"cntChars\">0</span> / 5000 {$lang['characters']})</th>
|
||||||
|
<th><textarea name=text cols=60 rows=10 onKeyUp=\"javascript:cntchar(5000)\"></textarea></th>
|
||||||
|
</tr><tr>
|
||||||
|
<td class=c><a href=\"javascript:back();\">{$lang['Back']}</a></td>
|
||||||
|
<td class=c><input type=submit value='{$lang['Send']}'></td>
|
||||||
|
</tr>
|
||||||
|
</table></form>
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>";
|
||||||
|
display( $page, 'buddy' );
|
||||||
|
} elseif ( $u["id"] == $user["id"] ) {
|
||||||
|
message( $lang['You_cannot_ask_yourself_for_a_request'], $lang['Buddy_request'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// con a indicamos las solicitudes y con e las distiguimos
|
||||||
|
if ( $a == 1 )
|
||||||
|
$TableTitle = ( $e == 1 ) ? $lang['My_requests']:$lang['Anothers_requests'];
|
||||||
|
else
|
||||||
|
$TableTitle = $lang['Buddy_list'];
|
||||||
|
|
||||||
|
$page .= "
|
||||||
|
<table width=519>
|
||||||
|
<tr>
|
||||||
|
<td class=c colspan=6>{$TableTitle}</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
|
if ( !isset( $a ) ) {
|
||||||
|
$page .= "
|
||||||
|
<tr>
|
||||||
|
<th colspan=6><a href=?a=1>{$lang['Requests']}</a></th>
|
||||||
|
</tr><tr>
|
||||||
|
<th colspan=6><a href=?a=1&e=1>{$lang['My_requests']}</a></th>
|
||||||
|
</tr><tr>
|
||||||
|
<td class=c></td>
|
||||||
|
<td class=c>{$lang['Name']}</td>
|
||||||
|
<td class=c>{$lang['Alliance']}</td>
|
||||||
|
<td class=c>{$lang['Coordinates']}</td>
|
||||||
|
<td class=c>{$lang['Position']}</td>
|
||||||
|
<td class=c></td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $a == 1 ) {
|
||||||
|
$query = ( $e == 1 ) ? "WHERE active=0 AND sender=" . $user["id"] : "WHERE active=0 AND owner=" . $user["id"];
|
||||||
|
} else {
|
||||||
|
$query = "WHERE active=1 AND sender=" . $user["id"] . " OR active=1 AND owner=" . $user["id"];
|
||||||
|
}
|
||||||
|
$buddyrow = doquery( "SELECT * FROM {{table}} " . $query, 'buddy' );
|
||||||
|
|
||||||
|
while ( $b = mysql_fetch_array( $buddyrow ) ) {
|
||||||
|
// para solicitudes
|
||||||
|
if ( !isset( $i ) && isset( $a ) ) {
|
||||||
|
$page .= "
|
||||||
|
<tr>
|
||||||
|
<td class=c></td>
|
||||||
|
<td class=c>{$lang['User']}</td>
|
||||||
|
<td class=c>{$lang['Alliance']}</td>
|
||||||
|
<td class=c>{$lang['Coordinates']}</td>
|
||||||
|
<td class=c>{$lang['Text']}</td>
|
||||||
|
<td class=c></td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
$uid = ( $b["owner"] == $user["id"] ) ? $b["sender"] : $b["owner"];
|
||||||
|
// query del user
|
||||||
|
$u = doquery( "SELECT id,username,galaxy,system,planet,onlinetime,ally_id,ally_name FROM {{table}} WHERE id=" . $uid, "users", true );
|
||||||
|
// $g = doquery("SELECT galaxy, system, planet FROM {{table}} WHERE id_planet=".$u["id_planet"],"galaxy",true);
|
||||||
|
// $a = doquery("SELECT * FROM {{table}} WHERE id=".$uid,"aliance",true);
|
||||||
|
if ( $u["ally_id"] != 0 ) { // Alianza
|
||||||
|
// $allyrow = doquery("SELECT id,ally_tag FROM {{table}} WHERE id=".$u["ally_id"],"alliance",true);
|
||||||
|
// if($allyrow){
|
||||||
|
$UserAlly .= "<a href=alliance.php?mode=ainfo&a=" . $u["id"] . ">" . $u["ally_name"] . "</a>";
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $a ) ) {
|
||||||
|
$LastOnline = $b["text"];
|
||||||
|
} else {
|
||||||
|
$LastOnline = "<font color=";
|
||||||
|
if ( $u["onlinetime"] + 60 * 10 >= time() ) {
|
||||||
|
$LastOnline .= "lime>{$lang['On']}";
|
||||||
|
} elseif ( $u["onlinetime"] + 60 * 20 >= time() ) {
|
||||||
|
$LastOnline .= "yellow>{$lang['15_min']}";
|
||||||
|
} else {
|
||||||
|
$LastOnline .= "red>{$lang['Off']}";
|
||||||
|
}
|
||||||
|
$LastOnline .= "</font>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $a ) && isset( $e ) ) {
|
||||||
|
$UserCommand = "<a href=?s=1&bid=" . $b["id"] . ">{$lang['Delete_request']}</a>";
|
||||||
|
} elseif ( isset( $a ) ) {
|
||||||
|
$UserCommand = "<a href=?s=1&bid=" . $b["id"] . ">{$lang['Ok']}</a><br/>";
|
||||||
|
$UserCommand .= "<a href=?a=1&s=1&bid=" . $b["id"] . ">{$lang['Reject']}</a></a>";
|
||||||
|
} else {
|
||||||
|
$UserCommand = "<a href=?s=1&bid=" . $b["id"] . ">{$lang['Delete']}</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "
|
||||||
|
<tr>
|
||||||
|
<th width=20>" . $i . "</th>
|
||||||
|
<th><a href=messages.php?mode=write&id=" . $u["id"] . ">" . $u["username"] . "</a></th>
|
||||||
|
<th>{$UserAlly}</th>
|
||||||
|
<th><a href=\"galaxy.php?mode=3&galaxy=" . $u["galaxy"] . "&system=" . $u["system"] . "\">" . $u["galaxy"] . ":" . $u["system"] . ":" . $u["planet"] . "</a></th>
|
||||||
|
<th>{$LastOnline}</th>
|
||||||
|
<th>{$UserCommand}</th>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !isset( $i ) ) {
|
||||||
|
$page .= "
|
||||||
|
<tr>
|
||||||
|
<th colspan=6>{$lang['There_is_no_request']}</th>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $a == 1 ) {
|
||||||
|
$page .= "
|
||||||
|
<tr>
|
||||||
|
<td colspan=6 class=c><a href=buddy.php>{$lang['Back']}</a></td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "
|
||||||
|
</table>
|
||||||
|
</center>";
|
||||||
|
|
||||||
|
display ( $page, $lang['Buddy_list'], false );
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
68
buildings.php
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('buildings');
|
||||||
|
|
||||||
|
// Mise a jour de la liste de construction si necessaire
|
||||||
|
UpdatePlanetBatimentQueueList ( $planetrow, $user );
|
||||||
|
$IsWorking = HandleTechnologieBuild ( $planetrow, $user );
|
||||||
|
|
||||||
|
switch ($_GET['mode']) {
|
||||||
|
case 'fleet':
|
||||||
|
// --------------------------------------------------------------------------------------------------
|
||||||
|
FleetBuildingPage ( $planetrow, $user );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'research':
|
||||||
|
// --------------------------------------------------------------------------------------------------
|
||||||
|
ResearchBuildingPage ( $planetrow, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'defense':
|
||||||
|
// --------------------------------------------------------------------------------------------------
|
||||||
|
DefensesBuildingPage ( $planetrow, $user );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// --------------------------------------------------------------------------------------------------
|
||||||
|
BatimentBuildingPage ( $planetrow, $user );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
// History version
|
||||||
|
// 1.0 - Nettoyage modularisation
|
||||||
|
// 1.1 - Mise au point, mise en fonction pour lin<69>arisation du fonctionnement
|
||||||
|
// 1.2 - Liste de construction batiments
|
||||||
|
?>
|
||||||
286
calc.php
Normal file
|
|
@ -0,0 +1,286 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$v = '0.6c'; /* Version de la Calculadora */
|
||||||
|
|
||||||
|
$edff = array();
|
||||||
|
$invv = array();
|
||||||
|
$hann = array();
|
||||||
|
$deff = array();
|
||||||
|
|
||||||
|
$edf = GetInFile('edf.txt');
|
||||||
|
$edf_v = array_fill(0, count($edf), array(0, 0, 0, 0));
|
||||||
|
|
||||||
|
$inv = GetInFile('inv.txt');
|
||||||
|
$inv_v = array_fill(0, count($inv), array(0, 0, 0, 0));
|
||||||
|
|
||||||
|
$han = GetInFile('han.txt');
|
||||||
|
$han_v = array_fill(0, count($han), array(0, 0, 0, 0));
|
||||||
|
|
||||||
|
$def = GetInFile('def.txt');
|
||||||
|
$def_v = array_fill(0, count($def), array(0, 0, 0, 0));
|
||||||
|
|
||||||
|
LoadCookies();
|
||||||
|
|
||||||
|
if (!empty($_POST['reset'])) {
|
||||||
|
foreach($_COOKIE as $elm => $con) {
|
||||||
|
setcoookie($elm, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$_POST = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($_POST['suma'])) {
|
||||||
|
if (!empty($_POST['edf'])) setcoookie('edf', serialize($_POST['edf']), time()+60*60*24*30);
|
||||||
|
if (!empty($_POST['inv'])) setcoookie('inv', serialize($_POST['inv']), time()+60*60*24*30);
|
||||||
|
if (!empty($_POST['han'])) setcoookie('han', serialize($_POST['han']), time()+60*60*24*30);
|
||||||
|
if (!empty($_POST['def'])) setcoookie('def', serialize($_POST['def']), time()+60*60*24*30);
|
||||||
|
|
||||||
|
LoadCookies();
|
||||||
|
|
||||||
|
for($i = 0; $i < count($edf); $i++) {
|
||||||
|
if (!empty($edff)) {
|
||||||
|
$edf_v[$i][0] = og_pow($edf[$i][1], abs($edff[$i]), $edf[$i][4]);
|
||||||
|
$edf_v[$i][1] = og_pow($edf[$i][2], abs($edff[$i]), $edf[$i][4]);
|
||||||
|
$edf_v[$i][2] = og_pow($edf[$i][3], abs($edff[$i]), $edf[$i][4]);
|
||||||
|
|
||||||
|
$edf_v[$i][3] = round(($edf_v[$i][0] + $edf_v[$i][1] + $edf_v[$i][2]) / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i = 0; $i < count($inv); $i++) {
|
||||||
|
if (!empty($invv)) {
|
||||||
|
$inv_v[$i][0] = og_pow($inv[$i][1], abs($invv[$i]), $inv[$i][4]);
|
||||||
|
$inv_v[$i][1] = og_pow($inv[$i][2], abs($invv[$i]), $inv[$i][4]);
|
||||||
|
$inv_v[$i][2] = og_pow($inv[$i][3], abs($invv[$i]), $inv[$i][4]);
|
||||||
|
|
||||||
|
$inv_v[$i][3] = round(($inv_v[$i][0] + $inv_v[$i][1] + $inv_v[$i][2]) / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i = 0; $i < count($han); $i++) {
|
||||||
|
if (!empty($hann)) {
|
||||||
|
$han_v[$i][0] = $han[$i][1] * abs($hann[$i]);
|
||||||
|
$han_v[$i][1] = $han[$i][2] * abs($hann[$i]);
|
||||||
|
$han_v[$i][2] = $han[$i][3] * abs($hann[$i]);
|
||||||
|
|
||||||
|
$han_v[$i][3] = round(($han_v[$i][0] + $han_v[$i][1] + $han_v[$i][2]) / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i = 0; $i < count($def); $i++) {
|
||||||
|
if (!empty($deff)) {
|
||||||
|
$def_v[$i][0] = $def[$i][1] * abs($deff[$i]);
|
||||||
|
$def_v[$i][1] = $def[$i][2] * abs($deff[$i]);
|
||||||
|
$def_v[$i][2] = $def[$i][3] * abs($deff[$i]);
|
||||||
|
|
||||||
|
$def_v[$i][3] = round(($def_v[$i][0] + $def_v[$i][1] + $def_v[$i][2]) / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function og_pow($v, $lvl, $x) {
|
||||||
|
$t = 0;
|
||||||
|
|
||||||
|
if ($lvl != 1) {
|
||||||
|
for ($i = 0; $i < $lvl; $i++) {
|
||||||
|
if ($i == 0) {
|
||||||
|
$t += $v;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$v *= $x;
|
||||||
|
$t += $v;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$t = $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
return round($t);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetInFile($f) {
|
||||||
|
$f = file($f);
|
||||||
|
|
||||||
|
$ar = array();
|
||||||
|
|
||||||
|
foreach ($f as $linea) {
|
||||||
|
$tmp = array();
|
||||||
|
|
||||||
|
$exp = explode(':', $linea);
|
||||||
|
$tmp[] = $exp[0];
|
||||||
|
|
||||||
|
$x = explode(' ', trim($exp[1]));
|
||||||
|
foreach ($x as $y) {
|
||||||
|
$tmp[] = $y;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ar[] = $tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ar;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SumaTodo() {
|
||||||
|
global $edf_v, $inv_v, $han_v, $def_v;
|
||||||
|
$t = 0;
|
||||||
|
|
||||||
|
foreach (array_merge($edf_v, $inv_v, $han_v, $def_v) as $e) {
|
||||||
|
foreach($e as $a) {
|
||||||
|
$t += $a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return round($t / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LoadCookies() {
|
||||||
|
global $edff, $invv, $hann, $deff;
|
||||||
|
|
||||||
|
if (!empty($_COOKIE['edf'])) $edff = unserialize($_COOKIE['edf']);
|
||||||
|
if (!empty($_COOKIE['inv'])) $invv = unserialize($_COOKIE['inv']);
|
||||||
|
if (!empty($_COOKIE['han'])) $hann = unserialize($_COOKIE['han']);
|
||||||
|
if (!empty($_COOKIE['def'])) $deff = unserialize($_COOKIE['def']);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setcoookie($a, $b, $c = '') {
|
||||||
|
@setcookie($a, $b, $c);
|
||||||
|
|
||||||
|
$_COOKIE[$a] = $b;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>OGame Clone</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo $dpath?>formate.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<center>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form method="POST" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']?>">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$tot = SumaTodo();
|
||||||
|
$to = array_fill(0, 4, 0);
|
||||||
|
|
||||||
|
for ($a = 0; $a < 4; $a++) {
|
||||||
|
switch ($a) {
|
||||||
|
case 0:
|
||||||
|
$titulo = 'Gebäde';
|
||||||
|
$loc = true;
|
||||||
|
|
||||||
|
$c = 'edf'; $d = 'edff';
|
||||||
|
$t = $edf;
|
||||||
|
$t_v = $edf_v;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$titulo = 'Forschung';
|
||||||
|
$loc = true;
|
||||||
|
|
||||||
|
$c = 'inv'; $d = 'invv';
|
||||||
|
$t = $inv;
|
||||||
|
$t_v = $inv_v;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$titulo = 'Flotte';
|
||||||
|
$loc = false;
|
||||||
|
|
||||||
|
$c = 'han'; $d = 'hann';
|
||||||
|
$t = $han;
|
||||||
|
$t_v = $han_v;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$titulo = 'Flotte';
|
||||||
|
$loc = false;
|
||||||
|
|
||||||
|
$c = 'def'; $d = 'deff';
|
||||||
|
$t = $def;
|
||||||
|
$t_v = $def_v;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<table border="0" cellpadding="2" cellspacing="1" width="90%">
|
||||||
|
<tr>
|
||||||
|
<td class="c" style="width: 30%"><b><?=$titulo?></b></td>
|
||||||
|
<td class="c" style="width: 10%"><b><?=$loc == true ? 'Stufe' : 'Anzahl'?></b></td>
|
||||||
|
<td class="c" style="width: 15%"><b><span style="color: green">Metall</span></b></td>
|
||||||
|
<td class="c" style="width: 15%"><b><span style="color: blue">Kristall</span></b></td>
|
||||||
|
<td class="c" style="width: 15%"><b><span style="color: darkred">Deuterium</span></b></td>
|
||||||
|
<td class="c" style="width: 10%"><b>Punkte</b></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
for($i = 0; $i < count($t); $i++) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 30%"><?=$t[$i][0]?></td>
|
||||||
|
<th style="text-align: center; width: 10%"><input type="text" name="<?=$c?>[]" value="<?=!empty(${$d}[$i]) ? ${$d}[$i]: 0;?>" style="width: 30px;"></th>
|
||||||
|
<th style="width: 15%"><span style="color: green"><?=number_format($t_v[$i][0], 0, ',', '.');?></span></th>
|
||||||
|
<th style="width: 15%"><span style="color: blue"><?=number_format($t_v[$i][1], 0, ',', '.');?></span></th>
|
||||||
|
<th style="width: 15%"><span style="color: darkred"><?=number_format($t_v[$i][2], 0, ',', '.');?></span></th>
|
||||||
|
<th style="width: 10%"><?=number_format($t_v[$i][3], 0, ',', '.');?> (<?=@round((100 * $t_v[$i][3]) / $tot)?>%)</th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$to[$a] += $t_v[$i][3];
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"> </td>
|
||||||
|
<td class="c">Summe: </th>
|
||||||
|
<th><?=$to[$a]?> (<?=@round((100 * $to[$a]) / $tot)?>%)</th>
|
||||||
|
</tr>
|
||||||
|
</table><br />
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<input type="submit" name="suma" value="Berechen">
|
||||||
|
<input type="submit" name="reset" value="Zurücksetzen">
|
||||||
|
|
||||||
|
<br /><br />
|
||||||
|
Punkte: <?=number_format($tot, 0, '.', ''); ?>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
57
changelog.php
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
includeLang('changelog');
|
||||||
|
|
||||||
|
$template = gettemplate('changelog_table');
|
||||||
|
|
||||||
|
|
||||||
|
foreach($lang['changelog'] as $a => $b)
|
||||||
|
{
|
||||||
|
|
||||||
|
$parse['version_number'] = $a;
|
||||||
|
$parse['description'] = nl2br($b);
|
||||||
|
|
||||||
|
$body .= parsetemplate($template, $parse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse = $lang;
|
||||||
|
$parse['body'] = $body;
|
||||||
|
|
||||||
|
$page .= parsetemplate(gettemplate('changelog_body'), $parse);
|
||||||
|
|
||||||
|
display($page,"Change Log");
|
||||||
|
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
45
chat.php
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('chat');
|
||||||
|
$BodyTPL = gettemplate('chat_body');
|
||||||
|
|
||||||
|
$nick = $user['username'];
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
$page = parsetemplate($BodyTPL, $parse);
|
||||||
|
display($page, $lang['Chat'], false);
|
||||||
|
|
||||||
|
// Shoutbox by e-Zobar - Copyright XNova Team 2008
|
||||||
|
?>
|
||||||
53
chat_add.php
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
// On récupère les informations du message et de l'envoyeur
|
||||||
|
if (isset($_POST["msg"]) && isset($user['username'])) {
|
||||||
|
$nick = trim (str_replace ("+","plus",$user['username']));
|
||||||
|
$msg = trim (str_replace ("+","plus",$_POST["msg"]));
|
||||||
|
$msg = addslashes ($_POST["msg"]);
|
||||||
|
$nick = addslashes ($user['username']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$msg="";
|
||||||
|
$nick="";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ajout du message dans la database
|
||||||
|
if ($msg!="" && $nick!="") {
|
||||||
|
$query = doquery("INSERT INTO {{table}}(user, message, timestamp) VALUES ('".$nick."', '".$msg."', '".time()."')", "chat");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shoutbox by e-Zobar - Copyright XNova Team 2008
|
||||||
|
?>
|
||||||
73
chat_msg.php
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
// On efface les anciens messages
|
||||||
|
$timemoment=time();
|
||||||
|
$time_1h=$timemoment - 3600;
|
||||||
|
|
||||||
|
// On selectionne les messages présents dans la base de donnée
|
||||||
|
$query = doquery("SELECT * FROM {{table}} ORDER BY messageid ASC", "chat");
|
||||||
|
while($v=mysql_fetch_object($query)){
|
||||||
|
$nick=htmlentities($v->user);
|
||||||
|
$msg=htmlentities($v->message);
|
||||||
|
|
||||||
|
// Les différentes polices (gras, italique, couleurs, etc...)
|
||||||
|
$msg=preg_replace("#\[a=(ft|https?://)(.+)\](.+)\[/a\]#isU", "<a href=\"$1$2\" target=\"_blank\">$3</a>", $msg);
|
||||||
|
$msg=preg_replace("#\[b\](.+)\[/b\]#isU","<b>$1</b>",$msg);
|
||||||
|
$msg=preg_replace("#\[i\](.+)\[/i\]#isU","<i>$1</i>",$msg);
|
||||||
|
$msg=preg_replace("#\[u\](.+)\[/u\]#isU","<u>$1</u>",$msg);
|
||||||
|
$msg=preg_replace("#\[c=(blue|yellow|green|pink|red|orange)\](.+)\[/c\]#isU","<font color=\"$1\">$2</font>",$msg);
|
||||||
|
|
||||||
|
// Les smileys avec leurs raccourcis
|
||||||
|
$msg=preg_replace("#:c#isU","<img src=\"images/smileys/cry.png\" align=\"absmiddle\" title=\":c\" alt=\":c\">",$msg);
|
||||||
|
$msg=preg_replace("#:/#isU","<img src=\"images/smileys/confused.png\" align=\"absmiddle\" title=\":/\" alt=\":/\">",$msg);
|
||||||
|
$msg=preg_replace("#o0#isU","<img src=\"images/smileys/dizzy.png\" align=\"absmiddle\" title=\"o0\" alt=\"o0\">",$msg);
|
||||||
|
$msg=preg_replace("#\^\^#isU","<img src=\"images/smileys/happy.png\" align=\"absmiddle\" title=\"^^\" alt=\"^^\">",$msg);
|
||||||
|
$msg=preg_replace("#:D#isU","<img src=\"images/smileys/lol.png\" align=\"absmiddle\" title=\":D\" alt=\":D\">",$msg);
|
||||||
|
$msg=preg_replace("#:\|#isU","<img src=\"images/smileys/neutral.png\" align=\"absmiddle\" title=\":|\" alt=\":|\">",$msg);
|
||||||
|
$msg=preg_replace("#:\)#isU","<img src=\"images/smileys/smile.png\" align=\"absmiddle\" title=\":)\" alt=\":)\">",$msg);
|
||||||
|
$msg=preg_replace("#:o#isU","<img src=\"images/smileys/omg.png\" align=\"absmiddle\" title=\":o\" alt=\":o\">",$msg);
|
||||||
|
$msg=preg_replace("#:p#isU","<img src=\"images/smileys/tongue.png\" align=\"absmiddle\" title=\":p\" alt=\":p\">",$msg);
|
||||||
|
$msg=preg_replace("#:\(#isU","<img src=\"images/smileys/sad.png\" align=\"absmiddle\" title=\":(\" alt=\":(\">",$msg);
|
||||||
|
$msg=preg_replace("#;\)#isU","<img src=\"images/smileys/wink.png\" align=\"absmiddle\" title=\";)\" alt=\";)\">",$msg);
|
||||||
|
$msg=preg_replace("#:s#isU","<img src=\"images/smileys/shit.png\" align=\"absmiddle\" title=\":s\" alt=\":s\">",$msg);
|
||||||
|
$msg=preg_replace("#xnova#","<a href=\"http://www.xnova-ng.org\">XNova</a>",$msg);
|
||||||
|
|
||||||
|
// Affichage du message
|
||||||
|
$msg="<div align=\"left\">".$nick." > ".$msg."<br></div>";
|
||||||
|
print stripslashes($msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shoutbox by e-Zobar - Copyright XNova Team 2008
|
||||||
|
?>
|
||||||
153
common.php
Normal file
|
|
@ -0,0 +1,153 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('DEBUG') && in_array(strtolower(getenv('DEBUG')), array('1', 'on', 'true'))) {
|
||||||
|
define('DEBUG', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('DEBUG')) {
|
||||||
|
@ini_set('display_errors', false);
|
||||||
|
} else {
|
||||||
|
@ini_set('display_errors', true);
|
||||||
|
@error_reporting(E_ALL | E_STRICT);
|
||||||
|
}
|
||||||
|
|
||||||
|
defined('ROOT_PATH') || define('ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||||
|
defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
|
defined('PHPEXT') || define('PHPEXT', require 'extension.inc');
|
||||||
|
|
||||||
|
defined('VERSION') || define('VERSION', '2009.5');
|
||||||
|
|
||||||
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core',
|
||||||
|
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community',
|
||||||
|
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local',
|
||||||
|
get_include_path()
|
||||||
|
)));
|
||||||
|
|
||||||
|
function __autoload($class) {
|
||||||
|
include_once str_replace('_', '/', $class) . '.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 === filesize(ROOT_PATH . 'config.php')) {
|
||||||
|
header('Location: install/');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
$lang = array();
|
||||||
|
|
||||||
|
define('DEFAULT_SKINPATH', 'skins/xnova/');
|
||||||
|
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
|
||||||
|
define('TEMPLATE_NAME', 'OpenGame');
|
||||||
|
define('DEFAULT_LANG', 'fr');
|
||||||
|
|
||||||
|
include(ROOT_PATH . 'includes/debug.class.'.PHPEXT);
|
||||||
|
$debug = new Debug();
|
||||||
|
|
||||||
|
include(ROOT_PATH . 'includes/constants.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'includes/functions.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
|
||||||
|
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'includes/db.' . PHPEXT);
|
||||||
|
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
|
||||||
|
|
||||||
|
$gameConfig = Legacies_Core_Model_Config::getSingleton();
|
||||||
|
$user = Legacies_Empire_Model_User::getSingleton();
|
||||||
|
|
||||||
|
if (!defined('DISABLE_IDENTITY_CHECK')) {
|
||||||
|
if (($user === null || !$user->getId())) {
|
||||||
|
header('Location: login.php');
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
|
||||||
|
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
includeLang('system');
|
||||||
|
includeLang('tech');
|
||||||
|
|
||||||
|
$now = time();
|
||||||
|
$sql =<<<SQL_EOF
|
||||||
|
SELECT
|
||||||
|
fleet_start_galaxy AS galaxy,
|
||||||
|
fleet_start_system AS system,
|
||||||
|
fleet_start_planet AS planet,
|
||||||
|
fleet_start_type AS planet_type
|
||||||
|
FROM {{table}}
|
||||||
|
WHERE `fleet_start_time` <= {$now}
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
fleet_end_galaxy AS galaxy,
|
||||||
|
fleet_end_system AS system,
|
||||||
|
fleet_end_planet AS planet,
|
||||||
|
fleet_end_type AS planet_type
|
||||||
|
FROM {{table}}
|
||||||
|
WHERE `fleet_end_time` <= {$now}
|
||||||
|
SQL_EOF;
|
||||||
|
|
||||||
|
$fleets = doquery($sql, 'fleets');
|
||||||
|
while ($row = mysql_fetch_array($fleets)) {
|
||||||
|
FlyingFleetHandler($row);
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($fleets);
|
||||||
|
|
||||||
|
include(ROOT_PATH . 'rak.php');
|
||||||
|
if (!defined('IN_ADMIN')) {
|
||||||
|
$dpath = (isset($user['dpath']) && !empty($user["dpath"])) ? $user['dpath'] : DEFAULT_SKINPATH;
|
||||||
|
} else {
|
||||||
|
$dpath = '../' . DEFAULT_SKINPATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($user !== null && $user->getId())) {
|
||||||
|
SetSelectedPlanet($user); // FIXME
|
||||||
|
|
||||||
|
$planetrow = $user->getCurrentPlanet();
|
||||||
|
$galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '".$planetrow['id']."';", 'galaxy', true);
|
||||||
|
|
||||||
|
CheckPlanetUsedFields($planetrow); // FIXME
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Update planet resources and constructions
|
||||||
|
*/
|
||||||
|
Legacies::dispatchEvent('planet.update', array(
|
||||||
|
'planet' => $planetrow
|
||||||
|
));
|
||||||
|
$planetrow->save();
|
||||||
|
} else {
|
||||||
|
$planetrow = array();
|
||||||
|
$galaxyrow = array();
|
||||||
|
}
|
||||||
0
config.php
Normal file
61
contact.php
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
define('DISABLE_IDENTITY_CHECK', true);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('contact');
|
||||||
|
|
||||||
|
$BodyTPL = gettemplate('contact_body');
|
||||||
|
$RowsTPL = gettemplate('contact_body_rows');
|
||||||
|
$parse = $lang;
|
||||||
|
|
||||||
|
$QrySelectUser = "SELECT `username`, `email`, `authlevel` ";
|
||||||
|
$QrySelectUser .= "FROM {{table}} ";
|
||||||
|
$QrySelectUser .= "WHERE `authlevel` != '0' ORDER BY `authlevel` DESC;";
|
||||||
|
$GameOps = doquery ( $QrySelectUser, 'users');
|
||||||
|
|
||||||
|
while( $Ops = mysql_fetch_assoc($GameOps) ) {
|
||||||
|
$bloc['ctc_data_name'] = $Ops['username'];
|
||||||
|
$bloc['ctc_data_auth'] = $lang['user_level'][$Ops['authlevel']];
|
||||||
|
$bloc['ctc_data_mail'] = "<a href=mailto:".$Ops['email'].">".$Ops['email']."</a>";
|
||||||
|
$parse['ctc_admin_list'] .= parsetemplate($RowsTPL, $bloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = parsetemplate($BodyTPL, $parse);
|
||||||
|
display($page, $lang['ctc_title'], false);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
// History version
|
||||||
|
// 1.0 - Mise au propre (Virer tout ce qui ne sert pas a une prise de contact en fait)
|
||||||
|
?>
|
||||||
|
|
||||||
85
css/about.css
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.aboutParagraphHead{
|
||||||
|
text-align:left;
|
||||||
|
font-weight:bold;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.storyParagraphHead{
|
||||||
|
text-align:left;
|
||||||
|
font-weight:bold;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storyLink{
|
||||||
|
font-size:12px;
|
||||||
|
color:#878787;
|
||||||
|
text-align:center;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storyLink:hover{
|
||||||
|
color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joinLink{
|
||||||
|
font-weight:bold;
|
||||||
|
font-size:14px;
|
||||||
|
color:#497ec7;
|
||||||
|
text-align:center;
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joinLink:hover{
|
||||||
|
display:block;
|
||||||
|
font-weight:bold;
|
||||||
|
color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageLeft{
|
||||||
|
float:left;
|
||||||
|
margin-right:10px;
|
||||||
|
margin-left:5px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageRight{
|
||||||
|
float:right;
|
||||||
|
margin-left:10px;
|
||||||
|
}
|
||||||
|
.imageFirst{
|
||||||
|
float:right;
|
||||||
|
margin-left:10px;
|
||||||
|
margin-top:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigImage{
|
||||||
|
margin-left:8px;
|
||||||
|
}
|
||||||
543
css/styles.css
Normal file
|
|
@ -0,0 +1,543 @@
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color:#000000;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
text-align: center;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color:#666666;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
margin: -8px 0px 0px 0px;
|
||||||
|
position: relative;
|
||||||
|
width: 886px;
|
||||||
|
height: 580px;
|
||||||
|
background-image: url(../images/tlo.jpg);
|
||||||
|
background-repeat: none;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#mainmenu {
|
||||||
|
position: absolute;
|
||||||
|
left: 270px;
|
||||||
|
top: 364px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
color:#b1daf2;
|
||||||
|
text-align: left;
|
||||||
|
width: 127px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#login {
|
||||||
|
position: absolute;
|
||||||
|
left: 400px;
|
||||||
|
top: 457px;
|
||||||
|
width: 450px;
|
||||||
|
height: 125px;
|
||||||
|
z-index:10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rightmenu_big {
|
||||||
|
position: absolute;
|
||||||
|
left: 400px;
|
||||||
|
top: 70px;
|
||||||
|
width: 450px;
|
||||||
|
height: 384px;
|
||||||
|
z-index:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rightmenu_register {
|
||||||
|
position: absolute;
|
||||||
|
left: 400px;
|
||||||
|
top: 70px;
|
||||||
|
width: 450px;
|
||||||
|
height: 384px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rightmenu {
|
||||||
|
position: absolute;
|
||||||
|
left: 400px;
|
||||||
|
top: 250px;
|
||||||
|
width: 450px;
|
||||||
|
height: 205px;
|
||||||
|
z-index:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#link {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
position: absolute;
|
||||||
|
left: 25px;
|
||||||
|
top: 9px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #b1daf2;
|
||||||
|
text-align: center;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
position: absolute;
|
||||||
|
left: 25px;
|
||||||
|
top: 50px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
color:#b1daf2;
|
||||||
|
text-align: left;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#contentscroll {
|
||||||
|
overflow: auto;
|
||||||
|
height: 320px;
|
||||||
|
width: 405px;
|
||||||
|
|
||||||
|
padding-right: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#register {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 60px;
|
||||||
|
width: 400px;
|
||||||
|
height:26px;
|
||||||
|
padding-top:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#register:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#text2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 120px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
color:#b1daf2;
|
||||||
|
text-align: left;
|
||||||
|
width: 400px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#login_input {
|
||||||
|
position: absolute;
|
||||||
|
left: 25px;
|
||||||
|
top: 21px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 10px;
|
||||||
|
color:#b1daf2;
|
||||||
|
text-align: left;
|
||||||
|
width: 400px;
|
||||||
|
right: 25px;
|
||||||
|
height: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login_text_1 {
|
||||||
|
position: absolute;
|
||||||
|
top: 11px;
|
||||||
|
left: 0px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 9px;
|
||||||
|
color:#666666;
|
||||||
|
text-align: left;
|
||||||
|
width: 440px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login_text_2 {
|
||||||
|
position: absolute;
|
||||||
|
top: 30px;
|
||||||
|
left: 0px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 9px;
|
||||||
|
color:#666666;
|
||||||
|
text-align: left;
|
||||||
|
width: 440px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#downmenu {
|
||||||
|
position: absolute;
|
||||||
|
top: 110px;
|
||||||
|
left: 270px;
|
||||||
|
font-size: 10px;
|
||||||
|
color:#666666;
|
||||||
|
text-align: right;
|
||||||
|
width: 169px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#copyright {
|
||||||
|
position: absolute;
|
||||||
|
top: 110px;
|
||||||
|
left: -100px;
|
||||||
|
font-size: 10px;
|
||||||
|
color:#666666;
|
||||||
|
text-align: left;
|
||||||
|
width: 370px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eingabe{
|
||||||
|
border:1px solid #000000;
|
||||||
|
background:#ffffff;
|
||||||
|
color: #000000;
|
||||||
|
font-size:10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.menupoint {
|
||||||
|
/*width:10px;*/
|
||||||
|
/* height:4px; */
|
||||||
|
padding-top:2px;
|
||||||
|
padding-bottom:1px;
|
||||||
|
padding-left:10px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: left center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.link:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mainmenu a {
|
||||||
|
padding-left:10px;
|
||||||
|
padding-top:2px;
|
||||||
|
padding-bottom:1px;
|
||||||
|
color:#b1daf2;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#mainmenu span {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login_input a {
|
||||||
|
color:#cccccc;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
#login_input a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#mainmenu a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.products {
|
||||||
|
position:relative;
|
||||||
|
width:886px;
|
||||||
|
top:23px;
|
||||||
|
height:30px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
margin:0 auto;
|
||||||
|
font-size: 10px;
|
||||||
|
color:#b5cfcd;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 1px solid #516274;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
img:hover {
|
||||||
|
/* border: 1px solid #ffffff;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
a img:hover {
|
||||||
|
border: 1px solid #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.products {
|
||||||
|
/* display:none;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.products img {
|
||||||
|
color:#516274;
|
||||||
|
border-width: 1px;
|
||||||
|
height: 12px;
|
||||||
|
width: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.products a {
|
||||||
|
color:#b5cfcd;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.products a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#headerselect {
|
||||||
|
border:1px double #000000;
|
||||||
|
background:#595f71;
|
||||||
|
color: #dddddd;
|
||||||
|
font-size:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#register_container {
|
||||||
|
position: absolute;
|
||||||
|
top: 80px;
|
||||||
|
left: 10px;
|
||||||
|
width:380px;
|
||||||
|
height:300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#infotext {
|
||||||
|
position: absolute;
|
||||||
|
top: 210px;
|
||||||
|
width:400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#statustext {
|
||||||
|
position: absolute;
|
||||||
|
top: 260px;
|
||||||
|
width:400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#register_submit {
|
||||||
|
position: absolute;
|
||||||
|
top: 286px;
|
||||||
|
left:75px;
|
||||||
|
width:250px;
|
||||||
|
padding-top: 4px;
|
||||||
|
height:20px;
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
color:#497ec7;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#register_submit:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
table {
|
||||||
|
text-align: right;
|
||||||
|
color:#CCCCCC;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td .eingabe {
|
||||||
|
width: 120px;
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigbutton {
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
color:#497ec7;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigbutton:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning {
|
||||||
|
color:#ff7876;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fine {
|
||||||
|
color:#00ff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.register_agb {
|
||||||
|
color:#cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.register_agb:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline {
|
||||||
|
text-align:center;
|
||||||
|
font-weight:bold;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#gimmik_1 {
|
||||||
|
width:100px;
|
||||||
|
height:50px;
|
||||||
|
top:100px;
|
||||||
|
left:100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#gimmik_2 {
|
||||||
|
width:50px;
|
||||||
|
height:50px;
|
||||||
|
top:200px;
|
||||||
|
left:100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iframe {
|
||||||
|
border:none;
|
||||||
|
|
||||||
|
width:100%;
|
||||||
|
height:27px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginButton {
|
||||||
|
padding-top:2px;
|
||||||
|
padding-left:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.loginButton:hover {
|
||||||
|
padding-top:2px;
|
||||||
|
padding-left:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bildUeberschrift {
|
||||||
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 10px;
|
||||||
|
color:#b1daf2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#unis_content {
|
||||||
|
padding-left:70px;
|
||||||
|
padding-top:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#unis_content a {
|
||||||
|
display: block;
|
||||||
|
color:#878787;
|
||||||
|
}
|
||||||
|
|
||||||
|
#unis_content a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#unis_title2 {
|
||||||
|
padding-top:25px;
|
||||||
|
padding-bottom:3px;
|
||||||
|
width:380px;
|
||||||
|
font-size:14px;
|
||||||
|
font-weight:bold;
|
||||||
|
border-bottom-style:solid;
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-bottom-color:#2a2f33;
|
||||||
|
}
|
||||||
|
|
||||||
|
#closed_uni {
|
||||||
|
color:#535353;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#uni_infos_link {
|
||||||
|
text-align:left;
|
||||||
|
width:200px;
|
||||||
|
padding-top:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#uni_infos_link a {
|
||||||
|
color:#878787;
|
||||||
|
}
|
||||||
|
|
||||||
|
#uni_infos_link a:hover {
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#uni_label {
|
||||||
|
vertical-align:top;
|
||||||
|
padding-top:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table_lable {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.table_input {
|
||||||
|
text-align:left;
|
||||||
|
padding-left:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table_agb {
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#agb_zeile {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea
|
||||||
|
{
|
||||||
|
border : 1px #545454 solid;
|
||||||
|
font-size : 10px;
|
||||||
|
font-family : Tahoma, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td.a, td.b, td.c, td.f, input, select, td.g,
|
||||||
|
td.h, td.i, td.j, td.k, td.m, td.o, td.q, td.r,
|
||||||
|
td.v, td.s, .style td, p td
|
||||||
|
{
|
||||||
|
background-color : #000000;
|
||||||
|
filter : alpha(opacity=70);
|
||||||
|
-moz-opacity : 0.7;
|
||||||
|
-khtml-opacity : 0.7;
|
||||||
|
opacity : 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.f, input, select, textarea
|
||||||
|
{
|
||||||
|
color : #FFFFFF;
|
||||||
|
background-color : #1c1c1c;
|
||||||
|
filter : alpha(opacity=70);
|
||||||
|
-moz-opacity : 0.7;
|
||||||
|
-khtml-opacity : 0.7;
|
||||||
|
opacity : 0.7;
|
||||||
|
}
|
||||||
65
db/mysql.php
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Database
|
||||||
|
{
|
||||||
|
static $dbHandle = NULL;
|
||||||
|
static $config = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
function doquery($query, $table, $fetch = false)
|
||||||
|
{
|
||||||
|
if (!isset(Database::$config)) {
|
||||||
|
$config = require dirname(dirname(__FILE__)) . '/config.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isset(Database::$dbHandle))
|
||||||
|
{
|
||||||
|
Database::$dbHandle = mysql_connect(
|
||||||
|
$config['global']['database']['options']['hostname'],
|
||||||
|
$config['global']['database']['options']['username'],
|
||||||
|
$config['global']['database']['options']['password'])
|
||||||
|
or trigger_error(mysql_error() . "$query<br />" . PHP_EOL, E_USER_WARNING);
|
||||||
|
|
||||||
|
mysql_select_db($config['global']['database']['options']['database'], Database::$dbHandle)
|
||||||
|
or trigger_error(mysql_error()."$query<br />" . PHP_EOL, E_USER_WARNING);
|
||||||
|
}
|
||||||
|
$sql = str_replace("{{table}}", "{$config['global']['database']['table_prefix']}{$table}", $query);
|
||||||
|
|
||||||
|
if (false === ($sqlQuery = mysql_query($sql, Database::$dbHandle))) {
|
||||||
|
trigger_error(mysql_error() . PHP_EOL . "<br /><pre></code>$sql<code></pre><br />" . PHP_EOL, E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($fetch) {
|
||||||
|
return mysql_fetch_array($sqlQuery);
|
||||||
|
}else{
|
||||||
|
return $sqlQuery;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
emoticones/Oo.png
Normal file
|
After Width: | Height: | Size: 782 B |
BIN
emoticones/Smile.png
Normal file
|
After Width: | Height: | Size: 718 B |
BIN
emoticones/cool.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
emoticones/grrr.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
emoticones/love.png
Normal file
|
After Width: | Height: | Size: 495 B |
BIN
emoticones/msn.png
Normal file
|
After Width: | Height: | Size: 850 B |
BIN
emoticones/perdu.png
Normal file
|
After Width: | Height: | Size: 683 B |
BIN
emoticones/wink.png
Normal file
|
After Width: | Height: | Size: 954 B |
BIN
emoticones/wow.png
Normal file
|
After Width: | Height: | Size: 733 B |
1
extension.inc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return 'php';
|
||||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
287
fleet.php
Normal file
|
|
@ -0,0 +1,287 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
$maxfleet = doquery("SELECT COUNT(fleet_owner) AS `actcnt` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', true);
|
||||||
|
|
||||||
|
$MaxFlyingFleets = $maxfleet['actcnt'];
|
||||||
|
|
||||||
|
//Compteur de flotte en expéditions et nombre d'expédition maximum
|
||||||
|
$MaxExpedition = $user[$resource[124]];
|
||||||
|
if ($MaxExpedition >= 1) {
|
||||||
|
$maxexpde = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets', true);
|
||||||
|
$ExpeditionEnCours = $maxexpde['expedi'];
|
||||||
|
$EnvoiMaxExpedition = 1 + floor( $MaxExpedition / 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
$MaxFlottes = 1 + $user[$resource[108]];
|
||||||
|
|
||||||
|
CheckPlanetUsedFields($planetrow);
|
||||||
|
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$missiontype = array(
|
||||||
|
1 => $lang['type_mission'][1],
|
||||||
|
2 => $lang['type_mission'][2],
|
||||||
|
3 => $lang['type_mission'][3],
|
||||||
|
4 => $lang['type_mission'][4],
|
||||||
|
5 => $lang['type_mission'][5],
|
||||||
|
6 => $lang['type_mission'][6],
|
||||||
|
7 => $lang['type_mission'][7],
|
||||||
|
8 => $lang['type_mission'][8],
|
||||||
|
9 => $lang['type_mission'][9],
|
||||||
|
15 => $lang['type_mission'][15]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Histoire de recuperer les infos passées par galaxy
|
||||||
|
$galaxy = $_GET['galaxy'];
|
||||||
|
$system = $_GET['system'];
|
||||||
|
$planet = $_GET['planet'];
|
||||||
|
$planettype = $_GET['planettype'];
|
||||||
|
$target_mission = $_GET['target_mission'];
|
||||||
|
|
||||||
|
if (!$galaxy) {
|
||||||
|
$galaxy = $planetrow['galaxy'];
|
||||||
|
}
|
||||||
|
if (!$system) {
|
||||||
|
$system = $planetrow['system'];
|
||||||
|
}
|
||||||
|
if (!$planet) {
|
||||||
|
$planet = $planetrow['planet'];
|
||||||
|
}
|
||||||
|
if (!$planettype) {
|
||||||
|
$planettype = $planetrow['planet_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = "<script language=\"JavaScript\" src=\"scripts/flotten.js\"></script>\n";
|
||||||
|
$page .= "<script language=\"JavaScript\" src=\"scripts/ocnt.js\"></script>\n";
|
||||||
|
$page .= "<br><center>";
|
||||||
|
$page .= "<table width='519' border='0' cellpadding='0' cellspacing='1'>";
|
||||||
|
$page .= "<tr height='20'>";
|
||||||
|
$page .= "<td colspan='9' class='c'>";
|
||||||
|
$page .= "<table border=\"0\" width=\"100%\">";
|
||||||
|
$page .= "<tbody><tr>";
|
||||||
|
$page .= "<td style=\"background-color: transparent;\">";
|
||||||
|
$page .= $lang['fl_title']." ".$MaxFlyingFleets." ".$lang['fl_sur']." ".$MaxFlottes;
|
||||||
|
$page .= "</td><td style=\"background-color: transparent;\" align=\"right\">";
|
||||||
|
$page .= $ExpeditionEnCours."/".$EnvoiMaxExpedition." ".$lang['fl_expttl'];
|
||||||
|
$page .= "</td>";
|
||||||
|
$page .= "</tr></tbody></table>";
|
||||||
|
$page .= "</td>";
|
||||||
|
$page .= "</tr><tr height='20'>";
|
||||||
|
$page .= "<th>".$lang['fl_id']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_mission']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_count']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_from']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_start_t']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_dest']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_dest_t']."</th>";
|
||||||
|
// $page .= "<th>".$lang['fl_back_t']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_back_in']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_order']."</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
// Gestion des flottes du joueur actif
|
||||||
|
$fq = doquery("SELECT * FROM {{table}} WHERE fleet_owner={$user[id]}", "fleets");
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
|
||||||
|
while ($f = mysql_fetch_array($fq)) {
|
||||||
|
$i++;
|
||||||
|
$page .= "<tr height=20>";
|
||||||
|
// (01) Fleet ID
|
||||||
|
$page .= "<th>".$i."</th>";
|
||||||
|
// (02) Fleet Mission
|
||||||
|
$page .= "<th>";
|
||||||
|
$page .= "<a>". $missiontype[$f[fleet_mission]] ."</a>";
|
||||||
|
if (($f['fleet_start_time'] + 1) == $f['fleet_end_time']) {
|
||||||
|
$page .= "<br><a title=\"".$lang['fl_back_to_ttl']."\">".$lang['fl_back_to']."</a>";
|
||||||
|
} else {
|
||||||
|
$page .= "<br><a title=\"".$lang['fl_get_to_ttl']."\">".$lang['fl_get_to']."</a>";
|
||||||
|
}
|
||||||
|
$page .= "</th>";
|
||||||
|
// (03) Fleet Mission
|
||||||
|
$page .= "<th><a title=\"";
|
||||||
|
// Fleet details (commentaire)
|
||||||
|
$fleet = explode(";", $f['fleet_array']);
|
||||||
|
$e = 0;
|
||||||
|
foreach ($fleet as $a => $b) {
|
||||||
|
if ($b != '') {
|
||||||
|
$e++;
|
||||||
|
$a = explode(",", $b);
|
||||||
|
$page .= $lang['tech'][$a[0]]. ":". $a[1] ."\n";
|
||||||
|
if ($e > 1) {
|
||||||
|
$page .= "\t";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$page .= "\">". pretty_number($f[fleet_amount]) ."</a></th>";
|
||||||
|
// (04) Fleet From (Planete d'origine)
|
||||||
|
$page .= "<th>[".$f[fleet_start_galaxy].":".$f[fleet_start_system].":".$f[fleet_start_planet]."]</th>";
|
||||||
|
// (05) Fleet Start Time
|
||||||
|
$page .= "<th>". gmdate("d. M Y H:i:s", $f['fleet_start_time']) ."</th>";
|
||||||
|
// (06) Fleet Target (Planete de destination)
|
||||||
|
$page .= "<th>[".$f[fleet_end_galaxy].":".$f[fleet_end_system].":".$f[fleet_end_planet]."]</th>";
|
||||||
|
// (07) Fleet Target Time
|
||||||
|
$page .= "<th>". gmdate("d. M Y H:i:s", $f['fleet_end_time']) ."</th>";
|
||||||
|
// (08) Fleet Back Time
|
||||||
|
// $page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>". pretty_time(floor($f['fleet_end_time'] + 1 - time())) ."</font></th>";
|
||||||
|
// (09) Fleet Back In
|
||||||
|
$page .= "<th><font color=\"lime\"><div id=\"time_0\"><font>". pretty_time(floor($f['fleet_end_time'] + 1 - time())) ."</font></th>";
|
||||||
|
// (10) Orders
|
||||||
|
$page .= "<th>";
|
||||||
|
if ($f['fleet_mess'] == 0) {
|
||||||
|
$page .= "<form action=\"fleetback.php\" method=\"post\">";
|
||||||
|
$page .= "<input name=\"fleetid\" value=\"". $f['fleet_id'] ."\" type=\"hidden\">";
|
||||||
|
$page .= "<input value=\" ".$lang['fl_back_to_ttl']." \" type=\"submit\" name=\"send\">";
|
||||||
|
$page .= "</form>";
|
||||||
|
if ($f[fleet_mission] == 1) {
|
||||||
|
$page .= "<form action=\"verband.php\" method=\"post\">";
|
||||||
|
$page .= "<input name=\"fleetid\" value=\"". $f['fleet_id'] ."\" type=\"hidden\">";
|
||||||
|
$page .= "<input value=\" ".$lang['fl_associate']." \" type=\"submit\">";
|
||||||
|
$page .= "</form>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$page .= " - ";
|
||||||
|
}
|
||||||
|
$page .= "</th>";
|
||||||
|
// Fin de ligne
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Y a pas de flottes en vol ... on met des '-'
|
||||||
|
if ($i == 0) {
|
||||||
|
$page .= "<tr>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
// $page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($MaxFlottes == $MaxFlyingFleets) {
|
||||||
|
$page .= "<tr height=\"20\"><th colspan=\"9\"><font color=\"red\">".$lang['fl_noslotfree']."</font></th></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "</table></center>";
|
||||||
|
|
||||||
|
$page .= "<center>";
|
||||||
|
|
||||||
|
// Selection d'une nouvelle mission
|
||||||
|
$page .= "<form action=\"floten1.php\" method=\"post\">";
|
||||||
|
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td colspan=\"4\" class=\"c\">".$lang['fl_new_miss']."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th>".$lang['fl_fleet_typ']."</th>";
|
||||||
|
$page .= "<th>".$lang['fl_fleet_disp']."</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "<th>-</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
if (!$planetrow) {
|
||||||
|
message($lang['fl_noplanetrow'], $lang['fl_error']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prise des coordonnées sur la ligne de commande
|
||||||
|
$galaxy = intval($_GET['galaxy']);
|
||||||
|
$system = intval($_GET['system']);
|
||||||
|
$planet = intval($_GET['planet']);
|
||||||
|
$planettype = intval($_GET['planettype']);
|
||||||
|
$target_mission = intval($_GET['target_mission']);
|
||||||
|
$ShipData = "";
|
||||||
|
|
||||||
|
foreach ($reslist['fleet'] as $n => $i) {
|
||||||
|
if ($planetrow[$resource[$i]] > 0) {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th><a title=\"". $lang['fl_fleetspeed'] . $CurrentShipSpeed ."\">" . $lang['tech'][$i] . "</a></th>";
|
||||||
|
$page .= "<th>". pretty_number ($planetrow[$resource[$i]]);
|
||||||
|
$ShipData .= "<input type=\"hidden\" name=\"maxship". $i ."\" value=\"". $planetrow[$resource[$i]] ."\" />";
|
||||||
|
$ShipData .= "<input type=\"hidden\" name=\"consumption". $i ."\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
|
||||||
|
$ShipData .= "<input type=\"hidden\" name=\"speed" .$i ."\" value=\"" . GetFleetMaxSpeed ("", $i, $user) . "\" />";
|
||||||
|
$ShipData .= "<input type=\"hidden\" name=\"capacity". $i ."\" value=\"". $pricelist[$i]['capacity'] ."\" />";
|
||||||
|
$page .= "</th>";
|
||||||
|
// Satelitte Solaire (eux ne peuvent pas bouger !)
|
||||||
|
if ($i == 212) {
|
||||||
|
$page .= "<th></th><th></th>";
|
||||||
|
} else {
|
||||||
|
$page .= "<th><a href=\"javascript:maxShip('ship". $i ."'); shortInfo();\">".$lang['fl_selmax']."</a> </th>";
|
||||||
|
$page .= "<th><input name=\"ship". $i ."\" size=\"10\" value=\"0\" onfocus=\"javascript:if(this.value == '0') this.value='';\" onblur=\"javascript:if(this.value == '') this.value='0';\" alt=\"". $lang['tech'][$i] . $planetrow[$resource[$i]] ."\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" /></th>";
|
||||||
|
}
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
$have_ships = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$btncontinue = "<tr height=\"20\"><th colspan=\"4\"><input type=\"submit\" value=\" ".$lang['fl_continue']." \" /></th>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
if (!$have_ships) {
|
||||||
|
// Il n'y a pas de vaisseaux sur cette planete
|
||||||
|
$page .= "<th colspan=\"4\">". $lang['fl_noships'] ."</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= $btncontinue;
|
||||||
|
} else {
|
||||||
|
$page .= "<th colspan=\"2\"><a href=\"javascript:noShips();shortInfo();noResources();\" >". $lang['fl_unselectall'] ."</a></th>";
|
||||||
|
$page .= "<th colspan=\"2\"><a href=\"javascript:maxShips();shortInfo();\" >". $lang['fl_selectall'] ."</a></th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
if ($MaxFlottes > $MaxFlyingFleets) {
|
||||||
|
$page .= $btncontinue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "</table>";
|
||||||
|
$page .= $ShipData;
|
||||||
|
$page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $galaxy ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"system\" value=\"". $system ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"planet\" value=\"". $planet ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"planet_type\" value=\"". $planettype ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"mission\" value=\"". $target_mission ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $EnvoiMaxExpedition ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $ExpeditionEnCours ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
|
||||||
|
$page .= "</form>";
|
||||||
|
$page .= "</center>";
|
||||||
|
|
||||||
|
display($page, $lang['fl_title']);
|
||||||
|
|
||||||
|
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
97
fleetback.php
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$BoxTitle = $lang['fl_error'];
|
||||||
|
$TxtColor = "red";
|
||||||
|
$BoxMessage = $lang['fl_notback'];
|
||||||
|
if ( is_numeric($_POST['fleetid']) ) {
|
||||||
|
$fleetid = intval($_POST['fleetid']);
|
||||||
|
|
||||||
|
$FleetRow = doquery("SELECT * FROM {{table}} WHERE `fleet_id` = '". $fleetid ."';", 'fleets', true);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if ($FleetRow['fleet_owner'] == $user['id']) {
|
||||||
|
if ($FleetRow['fleet_mess'] == 0) {
|
||||||
|
if ($FleetRow['fleet_end_stay'] != 0) {
|
||||||
|
// Faut calculer le temps reel de retour
|
||||||
|
if ($FleetRow['fleet_start_time'] < time()) {
|
||||||
|
// On a pas encore entamé le stationnement
|
||||||
|
// Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte
|
||||||
|
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||||
|
} else {
|
||||||
|
// On est deja en stationnement
|
||||||
|
// Il faut donc directement calculer la durée d'un vol aller ou retour
|
||||||
|
$CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// C'est quoi le stationnement ??
|
||||||
|
// On calcule sagement la parcelle de temps ecoulée depuis le depart
|
||||||
|
$CurrentFlyingTime = time() - $FleetRow['start_time'];
|
||||||
|
}
|
||||||
|
// Allez houste au bout du compte y a la maison !! (E.T. phone home.............)
|
||||||
|
$ReturnFlyingTime = $CurrentFlyingTime + time();
|
||||||
|
|
||||||
|
$QryUpdateFleet = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', ";
|
||||||
|
$QryUpdateFleet .= "`fleet_end_stay` = '0', ";
|
||||||
|
$QryUpdateFleet .= "`fleet_end_time` = '". ($ReturnFlyingTime + 1) ."', ";
|
||||||
|
$QryUpdateFleet .= "`fleet_target_owner` = '". $user['id'] ."', ";
|
||||||
|
$QryUpdateFleet .= "`fleet_mess` = '1' ";
|
||||||
|
$QryUpdateFleet .= "WHERE ";
|
||||||
|
$QryUpdateFleet .= "`fleet_id` = '" . $fleetid . "';";
|
||||||
|
doquery( $QryUpdateFleet, 'fleets');
|
||||||
|
|
||||||
|
$BoxTitle = $lang['fl_sback'];
|
||||||
|
$TxtColor = "lime";
|
||||||
|
$BoxMessage = $lang['fl_isback'];
|
||||||
|
} elseif ($FleetRow['fleet_mess'] == 1) {
|
||||||
|
$BoxMessage = $lang['fl_notback'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$BoxMessage = $lang['fl_onlyyours'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message ("<font color=\"".$TxtColor."\">". $BoxMessage ."</font>", $BoxTitle, "fleet.". PHPEXT, 2);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
// History version
|
||||||
|
// Updated by Chlorel. 22 Jan 2008 (String extraction, bug corrections, code uniformisation
|
||||||
|
// Created by DxPpLmOs. All rights reversed (C) 2007
|
||||||
|
// Updated by -= MoF =- for Deutsches Ugamela Forum
|
||||||
|
// 06.12.2007 - 08:41
|
||||||
|
// Open Source
|
||||||
|
// (c) by MoF
|
||||||
|
?>
|
||||||
165
fleetshortcut.php
Normal file
|
|
@ -0,0 +1,165 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
|
||||||
|
$mode = $_GET['mode'];
|
||||||
|
$a = $_GET['a'];
|
||||||
|
/*
|
||||||
|
Este script es original xD
|
||||||
|
La funcion de este script es administrar una variable del $user
|
||||||
|
Permite agregar y quitar arrays...
|
||||||
|
*/
|
||||||
|
//Lets start!
|
||||||
|
if(isset($_GET['mode'])){
|
||||||
|
if($_POST){
|
||||||
|
//Pegamos el texto :P
|
||||||
|
if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";}
|
||||||
|
|
||||||
|
$r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n";
|
||||||
|
$user['fleet_shortcut'] .= $r;
|
||||||
|
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||||
|
message("Le raccourcis a été enregistré !","Enregistrment","fleetshortcut.php");
|
||||||
|
}
|
||||||
|
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
|
||||||
|
<tr height=20>
|
||||||
|
<td colspan=2 class=c>Nom [Galaxie/Système solaire/Planète]</td>
|
||||||
|
</tr><tr height=\"20\"><th>
|
||||||
|
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"Name\">
|
||||||
|
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"Galaxie\">
|
||||||
|
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"Sonnensystem\">
|
||||||
|
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"Planet\">
|
||||||
|
<select name=t>";
|
||||||
|
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Planète</option>";
|
||||||
|
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">Débris</option>";
|
||||||
|
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
|
||||||
|
$page .= "</select>
|
||||||
|
</th></tr><tr>
|
||||||
|
<th><input type=\"reset\" value=\"Zurücksetzen\"> <input type=\"submit\" value=\"Enregistrer\">";
|
||||||
|
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
|
||||||
|
$page .= "</th></tr>";
|
||||||
|
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
|
||||||
|
}
|
||||||
|
elseif(isset($_GET['a'])){
|
||||||
|
if($_POST){
|
||||||
|
//Armamos el array...
|
||||||
|
$scarray = explode("\r\n",$user['fleet_shortcut']);
|
||||||
|
if($_POST["delete"]){
|
||||||
|
unset($scarray[$a]);
|
||||||
|
$user['fleet_shortcut'] = implode("\r\n",$scarray);
|
||||||
|
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||||
|
message("Shortcut wurde gelöscht","Gelöscht","fleetshortcut.php");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$r = explode(",",$scarray[$a]);
|
||||||
|
$r[0] = strip_tags($_POST['n']);
|
||||||
|
$r[1] = intval($_POST['g']);
|
||||||
|
$r[2] = intval($_POST['s']);
|
||||||
|
$r[3] = intval($_POST['p']);
|
||||||
|
$r[4] = intval($_POST['t']);
|
||||||
|
$scarray[$a] = implode(",",$r);
|
||||||
|
$user['fleet_shortcut'] = implode("\r\n",$scarray);
|
||||||
|
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||||
|
message("Le raccourcis a été édité !.","Editer","fleetshortcut.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($user['fleet_shortcut']){
|
||||||
|
|
||||||
|
$scarray = explode("\r\n",$user['fleet_shortcut']);
|
||||||
|
$c = explode(',',$scarray[$a]);
|
||||||
|
|
||||||
|
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
|
||||||
|
<tr height=20>
|
||||||
|
<td colspan=2 class=c>Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]</td>
|
||||||
|
</tr>";
|
||||||
|
//if($i==0){$page .= "";}
|
||||||
|
$page .= "<tr height=\"20\"><th>
|
||||||
|
<input type=hidden name=a value=$a>
|
||||||
|
<input type=text name=n value=\"{$c[0]}\" size=32 maxlength=32>
|
||||||
|
<input type=text name=g value=\"{$c[1]}\" size=3 maxlength=1>
|
||||||
|
<input type=text name=s value=\"{$c[2]}\" size=3 maxlength=3>
|
||||||
|
<input type=text name=p value=\"{$c[3]}\" size=3 maxlength=3>
|
||||||
|
<select name=t>";
|
||||||
|
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Planète</option>";
|
||||||
|
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">Débris</option>";
|
||||||
|
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
|
||||||
|
$page .= "</select>
|
||||||
|
</th></tr><tr>
|
||||||
|
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
|
||||||
|
$page .= "</th></tr>";
|
||||||
|
|
||||||
|
}else{$page .= message("Le raccourcis a été enregistré !","Enregistrer","fleetshortcut.php");}
|
||||||
|
|
||||||
|
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
|
||||||
|
<tr height="20">
|
||||||
|
<td colspan="2" class="c">Raccourcis(<a href="?mode=add">Ajout</a>)</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
if($user['fleet_shortcut']){
|
||||||
|
/*
|
||||||
|
Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones
|
||||||
|
de acceso directo, el formato es el siguiente.
|
||||||
|
Nombre, Galaxia,Sistema,Planeta,Tipo
|
||||||
|
*/
|
||||||
|
$scarray = explode("\r\n",$user['fleet_shortcut']);
|
||||||
|
$i=$e=0;
|
||||||
|
foreach($scarray as $a => $b){
|
||||||
|
if($b!=""){
|
||||||
|
$c = explode(',',$b);
|
||||||
|
if($i==0){$page .= "<tr height=\"20\">";}
|
||||||
|
$page .= "<th><a href=\"?a=".$e++."\">";
|
||||||
|
$page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}";
|
||||||
|
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
|
||||||
|
if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";}
|
||||||
|
$page .= "</a></th>";
|
||||||
|
if($i==1){$page .= "</tr>";}
|
||||||
|
if($i==1){$i=0;}else{$i=1;}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if($i==1){$page .= "<th></th></tr>";}
|
||||||
|
|
||||||
|
}else{$page .= "<th colspan=\"2\">Pas de Raccourcis</th>";}
|
||||||
|
|
||||||
|
$page .= '<tr><td colspan=2 class=c><a href=fleet.php>Retour</a></td></tr></tr></table>';
|
||||||
|
}
|
||||||
|
display($page,"Shortcutmanager");
|
||||||
|
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
286
floten1.php
Normal file
|
|
@ -0,0 +1,286 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Tis file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$speed = array(10 => 100,
|
||||||
|
9 => 90,
|
||||||
|
8 => 80,
|
||||||
|
7 => 70,
|
||||||
|
6 => 60,
|
||||||
|
5 => 50,
|
||||||
|
4 => 40,
|
||||||
|
3 => 30,
|
||||||
|
2 => 20,
|
||||||
|
1 => 10,
|
||||||
|
);
|
||||||
|
|
||||||
|
$g = $_POST['galaxy'];
|
||||||
|
$s = $_POST['system'];
|
||||||
|
$p = $_POST['planet'];
|
||||||
|
$t = $_POST['planet_type'];
|
||||||
|
|
||||||
|
if (!$g) {
|
||||||
|
$g = $planetrow['galaxy'];
|
||||||
|
}
|
||||||
|
if (!$s) {
|
||||||
|
$s = $planetrow['system'];
|
||||||
|
}
|
||||||
|
if (!$p) {
|
||||||
|
$p = $planetrow['planet'];
|
||||||
|
}
|
||||||
|
if (!$t) {
|
||||||
|
$t = $planetrow['planet_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verifions si nous avons bien tout ce que nous voullons envoyer
|
||||||
|
$FleetHiddenBlock = "";
|
||||||
|
foreach ($reslist['fleet'] as $n => $i) {
|
||||||
|
if ($i > 200 && $i < 300 && $_POST["ship$i"] > "0") {
|
||||||
|
if ($_POST["ship$i"] > $planetrow[$resource[$i]]) {
|
||||||
|
$page .= $lang['fl_noenought'];
|
||||||
|
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
|
||||||
|
} else {
|
||||||
|
$fleet['fleetarray'][$i] = $_POST["ship$i"];
|
||||||
|
// Tableau des vaisseaux avec leur nombre
|
||||||
|
$fleet['fleetlist'] .= $i . "," . $_POST["ship$i"] . ";";
|
||||||
|
// Nombre total de vaisseaux
|
||||||
|
$fleet['amount'] += $_POST["ship$i"];
|
||||||
|
// Tableau des vitesses
|
||||||
|
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"consumption". $i ."\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
|
||||||
|
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"speed". $i ."\" value=\"". GetFleetMaxSpeed ( "", $i, $user ) ."\" />";
|
||||||
|
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"capacity". $i ."\" value=\"". $pricelist[$i]['capacity'] ."\" />";
|
||||||
|
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"ship". $i ."\" value=\"". $_POST["ship$i"] ."\" />";
|
||||||
|
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$fleet['fleetlist']) {
|
||||||
|
message($lang['fl_unselectall'], $lang['fl_error'], "fleet." . PHPEXT, 1);
|
||||||
|
} else {
|
||||||
|
$speedallsmin = min($speedalls);
|
||||||
|
}
|
||||||
|
$page .= "<script type=\"text/javascript\" src=\"scripts/flotten.js\"></script>";
|
||||||
|
$page .= "<script type=\"text/javascript\">\n";
|
||||||
|
$page .= "function getStorageFaktor() {\n";
|
||||||
|
$page .= " return 1\n";
|
||||||
|
$page .= "}\n";
|
||||||
|
$page .= "</script>\n";
|
||||||
|
$page .= "<form action=\"floten2.php\" method=\"post\">";
|
||||||
|
$page .= $FleetHiddenBlock;
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $speedallsmin ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". str_rot13(base64_encode(serialize($fleet['fleetarray']))) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planetrow['galaxy'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planetrow['system'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planetrow['planet'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"galaxyend\" value=\"". intval($_POST['galaxy']) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"systemend\" value=\"". intval($_POST['system']) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"planetend\" value=\"". intval($_POST['planet']) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". GetGameSpeedFactor () ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $planetrow['planet_type'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow['metal']) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow['crystal']) ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow['deuterium']) ."\" />";
|
||||||
|
|
||||||
|
$page .= "<br><div><center>";
|
||||||
|
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_floten1_ttl'] ."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th width=\"50%\">". $lang['fl_dest'] ."</th>";
|
||||||
|
$page .= "<th>";
|
||||||
|
$page .= "<input name=\"galaxy\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $g ."\" />";
|
||||||
|
$page .= "<input name=\"system\" size=\"3\" maxlength=\"3\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $s ."\" />";
|
||||||
|
$page .= "<input name=\"planet\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $p ."\" />";
|
||||||
|
$page .= "<select name=\"planettype\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||||
|
$page .= "<option value=\"1\"". (($t == 1) ? " SELECTED" : "" ) .">". $lang['fl_planet'] ." </option>";
|
||||||
|
$page .= "<option value=\"2\"". (($t == 2) ? " SELECTED" : "" ) .">". $lang['fl_ruins'] ." </option>";
|
||||||
|
$page .= "<option value=\"3\"". (($t == 3) ? " SELECTED" : "" ) .">". $lang['fl_moon'] ." </option>";
|
||||||
|
$page .= "</select>";
|
||||||
|
$page .= "</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||||
|
$page .= "<th>";
|
||||||
|
$page .= "<select name=\"speed\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||||
|
foreach ($speed as $a => $b) {
|
||||||
|
$page .= "<option value=\"".$a."\">".$b."</option>";
|
||||||
|
}
|
||||||
|
$page .= "</select> %";
|
||||||
|
$page .= "</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||||
|
$page .= "<th><div id=\"distance\">-</div></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_fltime'] ."</th>";
|
||||||
|
$page .= "<th><div id=\"duration\">-</div></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
/* A faire assez rapidement (faut juste savoir comment)
|
||||||
|
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||||
|
$page .= "<th><font color=\"lime\"><div id=\"llegada1\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||||
|
$page .= "<th><font color=\"lime\"><div id=\"llegada2\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
*/
|
||||||
|
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||||
|
$page .= "<th><div id=\"consumption\">-</div></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_speed_max'] ."</th>";
|
||||||
|
$page .= "<th><div id=\"maxspeed\">-</div></th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_max_load'] ."</th>";
|
||||||
|
$page .= "<th><div id=\"storage\">-</div></th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
// Gestion des raccourcis sur la galaxie
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_shortcut'] ." <a href=\"fleetshortcut.php\">". $lang['fl_shortlnk'] ."</a></td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
if ($user['fleet_shortcut']) {
|
||||||
|
$scarray = explode("\r\n", $user['fleet_shortcut']);
|
||||||
|
$i = 0;
|
||||||
|
foreach ($scarray as $a => $b) {
|
||||||
|
if ($b != "") {
|
||||||
|
$c = explode(',', $b);
|
||||||
|
if ($i == 0) {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
}
|
||||||
|
$page .= "<th><a href=\"javascript:setTarget(". $c[1] .",". $c[2] .",". $c[3] .",". $c[4] ."); shortInfo();\"";
|
||||||
|
$page .= ">". $c[0] ." ". $c[1] .":". $c[2] .":". $c[3] ." ";
|
||||||
|
// Signalisation du type de raccourci ...
|
||||||
|
// (P)lanete
|
||||||
|
// (D)ebris
|
||||||
|
// (L)une
|
||||||
|
if ($c[4] == 1) {
|
||||||
|
$page .= $lang['fl_shrtcup1'];
|
||||||
|
} elseif ($c[4] == 2) {
|
||||||
|
$page .= $lang['fl_shrtcup2'];
|
||||||
|
} elseif ($c[4] == 3) {
|
||||||
|
$page .= $lang['fl_shrtcup3'];
|
||||||
|
}
|
||||||
|
$page .= "</a></th>";
|
||||||
|
if ($i == 1) {
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
if ($i == 1) {
|
||||||
|
$i = 0;
|
||||||
|
} else {
|
||||||
|
$i = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($i == 1) {
|
||||||
|
$page .= "<th></th></tr>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th colspan=\"2\">". $lang['fl_noshortc'] ."</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_myplanets'] ."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
|
||||||
|
// Gestion des raccourcis vers ses propres colonies ou planetes
|
||||||
|
$kolonien = SortUserPlanets ( $user );
|
||||||
|
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
|
||||||
|
|
||||||
|
if (mysql_num_rows($kolonien) > 1) {
|
||||||
|
$i = 0;
|
||||||
|
$w = 0;
|
||||||
|
$tr = true;
|
||||||
|
while ($row = mysql_fetch_array($kolonien)) {
|
||||||
|
if ($w == 0 && $tr) {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$tr = false;
|
||||||
|
}
|
||||||
|
if ($w == 2) {
|
||||||
|
$page .= "</tr>";
|
||||||
|
$w = 0;
|
||||||
|
$tr = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($row['planet_type'] == 3) {
|
||||||
|
$row['name'] .= " ". $lang['fl_shrtcup3'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($currentplanet['galaxy'] == $row['galaxy'] &&
|
||||||
|
$currentplanet['system'] == $row['system'] &&
|
||||||
|
$currentplanet['planet'] == $row['planet'] &&
|
||||||
|
$currentplanet['planet_type'] == $row['planet_type'] ) {
|
||||||
|
// $page .= '<th><a href="javascript:setTarget('.$row['galaxy'].','.$row['system'].','.$row['planet'].','.$row['planet_type'].'); shortInfo();">'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'</a></th>';
|
||||||
|
} else {
|
||||||
|
$page .= "<th><a href=\"javascript:setTarget(". $row['galaxy'] .",". $row['system'] .",". $row['planet'] .",". $row['planet_type'] ."); shortInfo();\">". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ."</a></th>";
|
||||||
|
$w++;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i % 2 != 0) {
|
||||||
|
$page .= "<th> </th></tr>";
|
||||||
|
} elseif ($w == 2) {
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$page .= "<th colspan=\"2\">". $lang['fl_nocolonies'] ."</th>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_grattack'] ."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th colspan=\"2\">-</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th colspan=\"2\"><input type=\"submit\" value=\"". $lang['fl_continue'] ."\" /></th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "</table>";
|
||||||
|
$page .= "</div></center>";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $_POST['maxepedition'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $_POST['curepedition'] ."\" />";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
|
||||||
|
$page .= "</form>";
|
||||||
|
$page .= "<script>javascript:shortInfo(); </script>";
|
||||||
|
|
||||||
|
display($page, $lang['fl_title']);
|
||||||
|
|
||||||
|
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
283
floten2.php
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$galaxy = intval($_POST['galaxy']);
|
||||||
|
$system = intval($_POST['system']);
|
||||||
|
$planet = intval($_POST['planet']);
|
||||||
|
$planettype = intval($_POST['planettype']);
|
||||||
|
|
||||||
|
// Test d'existance et de proprieté de la planete
|
||||||
|
$YourPlanet = false;
|
||||||
|
$UsedPlanet = false;
|
||||||
|
$select = doquery("SELECT * FROM {{table}}", "planets");
|
||||||
|
|
||||||
|
while ($row = mysql_fetch_array($select)) {
|
||||||
|
if ($galaxy == $row['galaxy'] &&
|
||||||
|
$system == $row['system'] &&
|
||||||
|
$planet == $row['planet'] &&
|
||||||
|
$planettype == $row['planet_type']) {
|
||||||
|
if ($row['id_owner'] == $user['id']) {
|
||||||
|
$YourPlanet = true;
|
||||||
|
$UsedPlanet = true;
|
||||||
|
} else {
|
||||||
|
$UsedPlanet = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determinons les type de missions possibles par rapport a la planete cible
|
||||||
|
if ($_POST['planettype'] == "2") {
|
||||||
|
if ($_POST['ship209'] >= 1) {
|
||||||
|
$missiontype = array(8 => $lang['type_mission'][8]);
|
||||||
|
} else {
|
||||||
|
$missiontype = array();
|
||||||
|
}
|
||||||
|
} elseif ($_POST['planettype'] == "1" || $_POST['planettype'] == "3") {
|
||||||
|
if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
|
||||||
|
$missiontype = array(7 => $lang['type_mission'][7]);
|
||||||
|
} elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
|
||||||
|
$missiontype = array(6 => $lang['type_mission'][6]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['ship202'] >= 1 ||
|
||||||
|
$_POST['ship203'] >= 1 ||
|
||||||
|
$_POST['ship204'] >= 1 ||
|
||||||
|
$_POST['ship205'] >= 1 ||
|
||||||
|
$_POST['ship206'] >= 1 ||
|
||||||
|
$_POST['ship207'] >= 1 ||
|
||||||
|
$_POST['ship210'] >= 1 ||
|
||||||
|
$_POST['ship211'] >= 1 ||
|
||||||
|
$_POST['ship213'] >= 1 ||
|
||||||
|
$_POST['ship214'] >= 1 ||
|
||||||
|
$_POST['ship215'] >= 1 ||
|
||||||
|
$_POST['ship216'] >= 1) {
|
||||||
|
if (!$YourPlanet) {
|
||||||
|
$missiontype[1] = $lang['type_mission'][1];
|
||||||
|
$missiontype[5] = $lang['type_mission'][5];
|
||||||
|
}
|
||||||
|
$missiontype[3] = $lang['type_mission'][3];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} elseif ($_POST['ship209'] >= 1 || $_POST['ship208'] >= 1) {
|
||||||
|
$missiontype[3] = $lang['type_mission'][3];
|
||||||
|
}
|
||||||
|
if ($YourPlanet)
|
||||||
|
$missiontype[4] = $lang['type_mission'][4];
|
||||||
|
|
||||||
|
if ( $_POST['planettype'] == 3 &&
|
||||||
|
($_POST['ship214'] ||
|
||||||
|
$_POST['ship213']) &&
|
||||||
|
!$YourPlanet &&
|
||||||
|
$UsedPlanet) {
|
||||||
|
$missiontype[2] = $lang['type_mission'][2];
|
||||||
|
}
|
||||||
|
if ( $_POST['planettype'] == 3 &&
|
||||||
|
($_POST['ship214'] >= 1 || $_POST['ship216'] >= 1) &&
|
||||||
|
!$YourPlanet &&
|
||||||
|
$UsedPlanet) {
|
||||||
|
$missiontype[9] = $lang['type_mission'][9];
|
||||||
|
}
|
||||||
|
|
||||||
|
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
|
||||||
|
$mission = $_POST['target_mission'];
|
||||||
|
$SpeedFactor = $_POST['speedfactor'];
|
||||||
|
$AllFleetSpeed = GetFleetMaxSpeed ($fleetarray, 0, $user);
|
||||||
|
$GenFleetSpeed = $_POST['speed'];
|
||||||
|
$MaxFleetSpeed = min($AllFleetSpeed);
|
||||||
|
|
||||||
|
$distance = GetTargetDistance ( $_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet'] );
|
||||||
|
$duration = GetMissionDuration ( $GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor );
|
||||||
|
$consumption = GetFleetConsumption ( $fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
|
||||||
|
|
||||||
|
$MissionSelector = "";
|
||||||
|
if (count($missiontype) > 0) {
|
||||||
|
if ($planet == 16) {
|
||||||
|
$MissionSelector .= "<tr height=\"20\">";
|
||||||
|
$MissionSelector .= "<th>";
|
||||||
|
$MissionSelector .= "<input type=\"radio\" name=\"mission\" value=\"15\" checked=\"checked\">". $lang['type_mission'][15] ."<br /><br />";
|
||||||
|
$MissionSelector .= "<font color=\"red\">". $lang['fl_expe_warning'] ."</font>";
|
||||||
|
$MissionSelector .= "</th>";
|
||||||
|
$MissionSelector .= "</tr>";
|
||||||
|
} else {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($missiontype as $a => $b) {
|
||||||
|
$MissionSelector .= "<tr height=\"20\">";
|
||||||
|
$MissionSelector .= "<th>";
|
||||||
|
$MissionSelector .= "<input id=\"inpuT_".$i."\" type=\"radio\" name=\"mission\" value=\"".$a."\"". ($mission == $a ? " checked=\"checked\"":"") .">";
|
||||||
|
$MissionSelector .= "<label for=\"inpuT_".$i."\">".$b."</label><br>";
|
||||||
|
$MissionSelector .= "</th>";
|
||||||
|
$MissionSelector .= "</tr>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$MissionSelector .= "<tr height=\"20\">";
|
||||||
|
$MissionSelector .= "<th>";
|
||||||
|
$MissionSelector .= "<font color=\"red\">". $lang['fl_bad_mission'] ."</font>";
|
||||||
|
$MissionSelector .= "</th>";
|
||||||
|
$MissionSelector .= "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['thisplanettype'] == 1) {
|
||||||
|
$TableTitle = "". $_POST['thisgalaxy'] .":". $_POST['thissystem'] .":". $_POST['thisplanet'] ." - ". $lang['fl_planet'] ."";
|
||||||
|
} elseif ($_POST['thisplanettype'] == 3) {
|
||||||
|
$TableTitle = "". $_POST['thisgalaxy'] .":". $_POST['thissystem'] .":". $_POST['thisplanet'] ." - ". $lang['fl_moon'] ."";
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = "<script type=\"text/javascript\" src=\"scripts/flotten.js\">\n</script>";
|
||||||
|
$page .= "<script type=\"text/javascript\">\n";
|
||||||
|
$page .= "function getStorageFaktor() {\n";
|
||||||
|
$page .= " return 1;\n";
|
||||||
|
$page .= "}\n";
|
||||||
|
$page .= "</script>\n";
|
||||||
|
$page .= "<br><center>";
|
||||||
|
$page .= "<form action=\"floten3.php\" method=\"post\">\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow["metal"]) ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow["crystal"]) ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow["deuterium"]) ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"consumption\" value=\"". $consumption ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"dist\" value=\"". $distance ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $_POST['speedfactor'] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $_POST["thisgalaxy"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $_POST["thissystem"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $_POST["thisplanet"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $_POST["galaxy"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"system\" value=\"". $_POST["system"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"planet\" value=\"". $_POST["planet"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $_POST["thisplanettype"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"planettype\" value=\"". $_POST["planettype"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $_POST["speedallsmin"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speed\" value=\"". $_POST['speed'] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $_POST["speedfactor"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". $_POST["usedfleet"] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $_POST['maxepedition'] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $_POST['curepedition'] ."\" />\n";
|
||||||
|
foreach ($fleetarray as $Ship => $Count) {
|
||||||
|
$page .= "<input type=\"hidden\" name=\"ship". $Ship ."\" value=\"". $Count ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"capacity". $Ship ."\" value=\"". $pricelist[$Ship]['capacity'] ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"consumption". $Ship ."\" value=\"". GetShipConsumption ( $Ship, $user ) ."\" />\n";
|
||||||
|
$page .= "<input type=\"hidden\" name=\"speed". $Ship ."\" value=\"". GetFleetMaxSpeed ( "", $Ship, $user ) ."\" />\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">\n";
|
||||||
|
$page .= "<tbody>\n";
|
||||||
|
$page .= "<tr align=\"left\" height=\"20\">\n";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"2\">". $TableTitle ."</td>\n";
|
||||||
|
$page .= "</tr>\n";
|
||||||
|
$page .= "<tr align=\"left\" valign=\"top\">\n";
|
||||||
|
$page .= "<th width=\"50%\">\n";
|
||||||
|
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"259\">\n";
|
||||||
|
$page .= "<tbody>\n";
|
||||||
|
$page .= "<tr height=\"20\">\n";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_mission'] ."</td>\n";
|
||||||
|
$page .= "</tr>\n";
|
||||||
|
$page .= $MissionSelector;
|
||||||
|
$page .= "</tbody>\n";
|
||||||
|
$page .= "</table>\n";
|
||||||
|
$page .= "</th>\n";
|
||||||
|
$page .= "<th>\n";
|
||||||
|
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"259\">\n";
|
||||||
|
$page .= "<tbody>\n";
|
||||||
|
$page .= "<tr height=\"20\">\n";
|
||||||
|
$page .= "<td colspan=\"3\" class=\"c\">". $lang['fl_ressources'] ."</td>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th>". $lang['Metal'] ."</th>\n";
|
||||||
|
$page .= "<th><a href=\"javascript:maxResource('1');\">". $lang['fl_selmax'] ."</a></th>\n";
|
||||||
|
$page .= "<th><input name=\"resource1\" alt=\"". $lang['Metal'] ." ". floor($planetrow["metal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th>". $lang['Crystal'] ."</th>\n";
|
||||||
|
$page .= "<th><a href=\"javascript:maxResource('2');\">". $lang['fl_selmax'] ."</a></th>\n";
|
||||||
|
$page .= "<th><input name=\"resource2\" alt=\"". $lang['Crystal'] ." ". floor($planetrow["crystal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th>". $lang['Deuterium'] ."</th>\n";
|
||||||
|
$page .= "<th><a href=\"javascript:maxResource('3');\">". $lang['fl_selmax'] ."</a></th>\n";
|
||||||
|
$page .= "<th><input name=\"resource3\" alt=\"". $lang['Deuterium'] ." ". floor($planetrow["deuterium"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th>". $lang['fl_space_left'] ."</th>\n";
|
||||||
|
$page .= "<th colspan=\"2\"><div id=\"remainingresources\">-</div></th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th colspan=\"3\"><a href=\"javascript:maxResources()\">". $lang['fl_allressources'] ."</a></th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th colspan=\"3\"> </th>\n";
|
||||||
|
$page .= "</tr>\n";
|
||||||
|
if ($planet == 16) {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th colspan=\"3\">";
|
||||||
|
$page .= "<select name=\"expeditiontime\" >";
|
||||||
|
$page .= "<option value=\"1\">1</option>";
|
||||||
|
$page .= "<option value=\"2\">2</option>";
|
||||||
|
$page .= "</select>";
|
||||||
|
$page .= $lang['fl_expe_hours'];
|
||||||
|
$page .= "</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
} elseif ( $missiontype[5] != '' ) {
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<th colspan=\"3\">";
|
||||||
|
$page .= "<select name=\"holdingtime\" >";
|
||||||
|
$page .= "<option value=\"0\">0</option>";
|
||||||
|
$page .= "<option value=\"1\">1</option>";
|
||||||
|
$page .= "<option value=\"2\">2</option>";
|
||||||
|
$page .= "<option value=\"4\">4</option>";
|
||||||
|
$page .= "<option value=\"8\">8</option>";
|
||||||
|
$page .= "<option value=\"16\">16</option>";
|
||||||
|
$page .= "<option value=\"32\">32</option>";
|
||||||
|
$page .= "</select>";
|
||||||
|
$page .= $lang['fl_expe_hours'];
|
||||||
|
$page .= "</th>";
|
||||||
|
$page .= "</tr>";
|
||||||
|
}
|
||||||
|
$page .= "</tbody>\n";
|
||||||
|
$page .= "</table>\n";
|
||||||
|
$page .= "</th>\n";
|
||||||
|
$page .= "</tr><tr height=\"20\">\n";
|
||||||
|
$page .= "<th colspan=\"2\"><input accesskey=\"z\" value=\"". $lang['fl_continue'] ."\" type=\"submit\"></th>\n";
|
||||||
|
$page .= "</tr>\n";
|
||||||
|
$page .= "</tbody>\n";
|
||||||
|
$page .= "</table>\n";
|
||||||
|
$page .= "</form></center>\n";
|
||||||
|
|
||||||
|
display($page, $lang['fl_title']);
|
||||||
|
|
||||||
|
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation)
|
||||||
|
// Created by Perberos. All rights reversed (C) 2006
|
||||||
|
?>
|
||||||
539
floten3.php
Normal file
|
|
@ -0,0 +1,539 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
|
||||||
|
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."'", 'planets', true);
|
||||||
|
$TargetPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '". $_POST['galaxy'] ."' AND `system` = '". $_POST['system'] ."' AND `planet` = '". $_POST['planet'] ."' AND `planet_type` = '". $_POST['planettype'] ."';", 'planets', true);
|
||||||
|
$MyDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['id']."';", 'users', true);
|
||||||
|
|
||||||
|
$protection = $gameConfig['noobprotection'];
|
||||||
|
$protectiontime = $gameConfig['noobprotectiontime'];
|
||||||
|
$protectionmulti = $gameConfig['noobprotectionmulti'];
|
||||||
|
if ($protectiontime < 1) {
|
||||||
|
$protectiontime = 9999999999999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
|
||||||
|
|
||||||
|
if (!is_array($fleetarray)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// On verifie s'il y a assez de vaisseaux sur la planete !
|
||||||
|
foreach ($fleetarray as $Ship => $Count) {
|
||||||
|
if ($Count > $CurrentPlanet[$resource[$Ship]]) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_fleet_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
$galaxy = intval($_POST['galaxy']);
|
||||||
|
$system = intval($_POST['system']);
|
||||||
|
$planet = intval($_POST['planet']);
|
||||||
|
$planettype = intval($_POST['planettype']);
|
||||||
|
$fleetmission = $_POST['mission'];
|
||||||
|
|
||||||
|
if ($planettype != 1 && $planettype != 2 && $planettype != 3) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_fleet_err_pl'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fleetmission == 8) {
|
||||||
|
$YourPlanet = false;
|
||||||
|
$UsedPlanet = false;
|
||||||
|
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."'", "planets");
|
||||||
|
} else {
|
||||||
|
$YourPlanet = false;
|
||||||
|
$UsedPlanet = false;
|
||||||
|
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '". $galaxy ."' AND system = '". $system ."' AND planet = '". $planet ."' AND planet_type = '". $planettype ."'", "planets");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($CurrentPlanet['galaxy'] == $galaxy &&
|
||||||
|
$CurrentPlanet['system'] == $system &&
|
||||||
|
$CurrentPlanet['planet'] == $planet &&
|
||||||
|
$CurrentPlanet['planet_type'] == $planettype) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_ownpl_err'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test d'existance de l'enregistrement dans la gaalxie !
|
||||||
|
if ($_POST['mission'] != 15) {
|
||||||
|
if (mysql_num_rows($select) < 1 && $fleetmission != 7) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_unknow_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
} elseif ($fleetmission == 9 && mysql_num_rows($select) < 1) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_used_target'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$EnvoiMaxExpedition = $_POST['maxepedition'];
|
||||||
|
$Expedition = $_POST['curepedition'];
|
||||||
|
|
||||||
|
if ($EnvoiMaxExpedition == 0 ) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_expe_notech'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
} elseif ($Expedition >= $EnvoiMaxExpedition ) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_expe_max'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$select = mysql_fetch_array($select);
|
||||||
|
|
||||||
|
if ($select['id_owner'] == $user['id']) {
|
||||||
|
$YourPlanet = true;
|
||||||
|
$UsedPlanet = true;
|
||||||
|
} elseif (!empty($select['id_owner'])) {
|
||||||
|
$YourPlanet = false;
|
||||||
|
$UsedPlanet = true;
|
||||||
|
} else {
|
||||||
|
$YourPlanet = false;
|
||||||
|
$UsedPlanet = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determinons les type de missions possibles par rapport a la planete cible
|
||||||
|
if ($fleetmission == 15) {
|
||||||
|
// Gestion des Exp<78>ditions
|
||||||
|
$missiontype = array(15 => $lang['type_mission'][15]);
|
||||||
|
} else {
|
||||||
|
if ($_POST['planettype'] == "2") {
|
||||||
|
if ($_POST['ship209'] >= 1) {
|
||||||
|
$missiontype = array(8 => $lang['type_mission'][8]);
|
||||||
|
} else {
|
||||||
|
$missiontype = array();
|
||||||
|
}
|
||||||
|
} elseif ($_POST['planettype'] == "1" || $_POST['planettype'] == "3") {
|
||||||
|
if ($_POST['ship208'] >= 1 && !$UsedPlanet) {
|
||||||
|
$missiontype = array(7 => $lang['type_mission'][7]);
|
||||||
|
} elseif ($_POST['ship210'] >= 1 && !$YourPlanet) {
|
||||||
|
$missiontype = array(6 => $lang['type_mission'][6]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['ship202'] >= 1 ||
|
||||||
|
$_POST['ship203'] >= 1 ||
|
||||||
|
$_POST['ship204'] >= 1 ||
|
||||||
|
$_POST['ship205'] >= 1 ||
|
||||||
|
$_POST['ship206'] >= 1 ||
|
||||||
|
$_POST['ship207'] >= 1 ||
|
||||||
|
$_POST['ship210'] >= 1 ||
|
||||||
|
$_POST['ship211'] >= 1 ||
|
||||||
|
$_POST['ship213'] >= 1 ||
|
||||||
|
$_POST['ship214'] >= 1 ||
|
||||||
|
$_POST['ship215'] >= 1 ||
|
||||||
|
$_POST['ship216'] >= 1) {
|
||||||
|
if (!$YourPlanet) {
|
||||||
|
$missiontype[1] = $lang['type_mission'][1];
|
||||||
|
$missiontype[5] = $lang['type_mission'][5];
|
||||||
|
}
|
||||||
|
$missiontype[3] = $lang['type_mission'][3];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} elseif ($_POST['ship209'] >= 1 || $_POST['ship208'] >= 1) {
|
||||||
|
$missiontype[3] = $lang['type_mission'][3];
|
||||||
|
}
|
||||||
|
if ($YourPlanet)
|
||||||
|
$missiontype[4] = $lang['type_mission'][4];
|
||||||
|
|
||||||
|
if ( $_POST['planettype'] == 3 &&
|
||||||
|
($_POST['ship214'] ||
|
||||||
|
$_POST['ship213']) &&
|
||||||
|
!$YourPlanet &&
|
||||||
|
$UsedPlanet) {
|
||||||
|
$missiontype[2] = $lang['type_mission'][2];
|
||||||
|
}
|
||||||
|
if ($_POST['planettype'] == 3 &&
|
||||||
|
($_POST['ship214'] >= 1 || $_POST['ship216'] >= 1) &&
|
||||||
|
!$YourPlanet && $UsedPlanet) {
|
||||||
|
$missiontype[9] = $lang['type_mission'][9];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($missiontype[$fleetmission])) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_bad_mission'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckPlanetUsedFields($CurrentPlanet);
|
||||||
|
|
||||||
|
if ($TargetPlanet['id_owner'] == '') {
|
||||||
|
$HeDBRec = $MyDBRec;
|
||||||
|
} elseif ($TargetPlanet['id_owner'] != '') {
|
||||||
|
$HeDBRec = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetPlanet['id_owner'] ."';", 'users', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $MyDBRec['id'] ."';", 'statpoints', true);
|
||||||
|
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $HeDBRec['id'] ."';", 'statpoints', true);
|
||||||
|
|
||||||
|
$MyGameLevel = $UserPoints['total_points'];
|
||||||
|
$HeGameLevel = $User2Points['total_points'];
|
||||||
|
$VacationMode = $HeDBRec['urlaubs_modus'];
|
||||||
|
|
||||||
|
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 1 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$HeGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 5 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$HeGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($MyGameLevel > ($HeGameLevel * $protectionmulti) AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 6 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$HeGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 1 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$MyGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 5 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$MyGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($MyGameLevel * $protectionmulti) < $HeGameLevel AND
|
||||||
|
$TargetPlanet['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 6 AND
|
||||||
|
$protection == 1 AND
|
||||||
|
$MyGameLevel < ($protectiontime * 1000)) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noob_mess_n']."</b></font>", $lang['fl_noob_title'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($VacationMode AND $_POST['mission'] != 8) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_vacation_pla']."</b></font>", $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$FlyingFleets = mysql_fetch_assoc(doquery("SELECT COUNT(fleet_id) as Number FROM {{table}} WHERE `fleet_owner`='{$user['id']}'", 'fleets'));
|
||||||
|
$ActualFleets = $FlyingFleets["Number"];
|
||||||
|
if (($user[$resource[108]] + 1) <= $ActualFleets) {
|
||||||
|
message("Pas de slot disponible", "Erreur", "fleet." . PHPEXT, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['resource1'] + $_POST['resource2'] + $_POST['resource3'] < 1 AND $_POST['mission'] == 3) {
|
||||||
|
message("<font color=\"lime\"><b>".$lang['fl_noenoughtgoods']."</b></font>", $lang['type_mission'][3], "fleet." . PHPEXT, 1);
|
||||||
|
}
|
||||||
|
if ($_POST['mission'] != 15) {
|
||||||
|
if ($TargetPlanet['id_owner'] == '' AND $_POST['mission'] < 7) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_bad_planet01'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if ($TargetPlanet['id_owner'] != '' AND $_POST['mission'] == 7) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_bad_planet02'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if ($HeDBRec['ally_id'] != $MyDBRec['ally_id'] AND $_POST['mission'] == 4) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_dont_stay_here'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if ($TargetPlanet['ally_deposit'] < 1 AND $HeDBRec != $MyDBRec AND $_POST['mission'] == 5) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_no_allydeposit'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 1)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_no_self_attack'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if (($TargetPlanet["id_owner"] == $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 6)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_no_self_spy'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
if (($TargetPlanet["id_owner"] != $CurrentPlanet["id_owner"]) AND ($_POST["mission"] == 4)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_only_stay_at_home'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$missiontype = array(
|
||||||
|
1 => $lang['type_mission'][1],
|
||||||
|
2 => $lang['type_mission'][2],
|
||||||
|
3 => $lang['type_mission'][3],
|
||||||
|
4 => $lang['type_mission'][4],
|
||||||
|
5 => $lang['type_mission'][5],
|
||||||
|
6 => $lang['type_mission'][6],
|
||||||
|
7 => $lang['type_mission'][7],
|
||||||
|
8 => $lang['type_mission'][8],
|
||||||
|
9 => $lang['type_mission'][9],
|
||||||
|
15 => $lang['type_mission'][15],
|
||||||
|
);
|
||||||
|
|
||||||
|
$speed_possible = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
|
||||||
|
|
||||||
|
$AllFleetSpeed = GetFleetMaxSpeed ($fleetarray, 0, $user);
|
||||||
|
$GenFleetSpeed = $_POST['speed'];
|
||||||
|
$SpeedFactor = $_POST['speedfactor'];
|
||||||
|
$MaxFleetSpeed = min($AllFleetSpeed);
|
||||||
|
|
||||||
|
if (!in_array($GenFleetSpeed, $speed_possible)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '".$user['current_planet']."';", 'planets', true);
|
||||||
|
|
||||||
|
if ($MaxFleetSpeed != $_POST['speedallsmin']) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_cheat_speed'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$_POST['planettype']) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu
|
||||||
|
$error = 0;
|
||||||
|
$errorlist = "";
|
||||||
|
if (!$_POST['galaxy'] || !is_numeric($_POST['galaxy']) || $_POST['galaxy'] > MAX_GALAXY_IN_WORLD || $_POST['galaxy'] < 1) {
|
||||||
|
$error++;
|
||||||
|
$errorlist .= $lang['fl_limit_galaxy'];
|
||||||
|
}
|
||||||
|
if (!$_POST['system'] || !is_numeric($_POST['system']) || $_POST['system'] > MAX_SYSTEM_IN_GALAXY || $_POST['system'] < 1) {
|
||||||
|
$error++;
|
||||||
|
$errorlist .= $lang['fl_limit_system'];
|
||||||
|
}
|
||||||
|
if (!$_POST['planet'] || !is_numeric($_POST['planet']) || $_POST['planet'] > MAX_PLANET_IN_SYSTEM+1 || $_POST['planet'] < 1) {
|
||||||
|
$error++;
|
||||||
|
$errorlist .= $lang['fl_limit_planet'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error > 0) {
|
||||||
|
message ("<font color=\"red\"><ul>" . $errorlist . "</ul></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// La flotte part bien de la planete courrante ??
|
||||||
|
if ($_POST['thisgalaxy'] != $CurrentPlanet['galaxy'] |
|
||||||
|
$_POST['thissystem'] != $CurrentPlanet['system'] |
|
||||||
|
$_POST['thisplanet'] != $CurrentPlanet['planet'] |
|
||||||
|
$_POST['thisplanettype'] != $CurrentPlanet['planet_type']) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_cheat_origine'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($fleetarray)) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_no_fleetarray'] ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$distance = GetTargetDistance ( $_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet'] );
|
||||||
|
$duration = GetMissionDuration ( $GenFleetSpeed, $MaxFleetSpeed, $distance, $SpeedFactor );
|
||||||
|
$consumption = GetFleetConsumption ( $fleetarray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
|
||||||
|
|
||||||
|
$fleet['start_time'] = $duration + time();
|
||||||
|
if ($_POST['mission'] == 15) {
|
||||||
|
$StayDuration = $_POST['expeditiontime'] * 3600;
|
||||||
|
$StayTime = $fleet['start_time'] + $_POST['expeditiontime'] * 3600;
|
||||||
|
} elseif ($_POST['mission'] == 5) {
|
||||||
|
$StayDuration = $_POST['holdingtime'] * 3600;
|
||||||
|
$StayTime = $fleet['start_time'] + $_POST['holdingtime'] * 3600;
|
||||||
|
} else {
|
||||||
|
$StayDuration = 0;
|
||||||
|
$StayTime = 0;
|
||||||
|
}
|
||||||
|
$fleet['end_time'] = $StayDuration + (2 * $duration) + time();
|
||||||
|
$FleetStorage = 0;
|
||||||
|
$FleetShipCount = 0;
|
||||||
|
$fleet_array = "";
|
||||||
|
$FleetSubQRY = "";
|
||||||
|
|
||||||
|
foreach ($fleetarray as $Ship => $Count) {
|
||||||
|
$FleetStorage += $pricelist[$Ship]["capacity"] * $Count;
|
||||||
|
$FleetShipCount += $Count;
|
||||||
|
$fleet_array .= $Ship .",". $Count .";";
|
||||||
|
$FleetSubQRY .= "`".$resource[$Ship] . "` = `" . $resource[$Ship] . "` - " . $Count . " , ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$FleetStorage -= $consumption;
|
||||||
|
$StorageNeeded = 0;
|
||||||
|
if ($_POST['resource1'] < 1) {
|
||||||
|
$TransMetal = 0;
|
||||||
|
} else {
|
||||||
|
$TransMetal = $_POST['resource1'];
|
||||||
|
$StorageNeeded += $TransMetal;
|
||||||
|
}
|
||||||
|
if ($_POST['resource2'] < 1) {
|
||||||
|
$TransCrystal = 0;
|
||||||
|
} else {
|
||||||
|
$TransCrystal = $_POST['resource2'];
|
||||||
|
$StorageNeeded += $TransCrystal;
|
||||||
|
}
|
||||||
|
if ($_POST['resource3'] < 1) {
|
||||||
|
$TransDeuterium = 0;
|
||||||
|
} else {
|
||||||
|
$TransDeuterium = $_POST['resource3'];
|
||||||
|
$StorageNeeded += $TransDeuterium;
|
||||||
|
}
|
||||||
|
|
||||||
|
$StockMetal = $CurrentPlanet['metal'];
|
||||||
|
$StockCrystal = $CurrentPlanet['crystal'];
|
||||||
|
$StockDeuterium = $CurrentPlanet['deuterium'];
|
||||||
|
$StockDeuterium -= $consumption;
|
||||||
|
|
||||||
|
$StockOk = false;
|
||||||
|
if ($StockMetal >= $TransMetal) {
|
||||||
|
if ($StockCrystal >= $TransCrystal) {
|
||||||
|
if ($StockDeuterium >= $TransDeuterium) {
|
||||||
|
$StockOk = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !$StockOk ) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_noressources'] . pretty_number($consumption) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $StorageNeeded > $FleetStorage) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage) ."</b></font>", $lang['fl_error'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($TargetPlanet['id_level'] > $user['authlevel']) {
|
||||||
|
$Allowed = true;
|
||||||
|
switch ($_POST['mission']){
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 6:
|
||||||
|
case 9:
|
||||||
|
$Allowed = false;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
if ($Allowed == false) {
|
||||||
|
message ("<font color=\"red\"><b>". $lang['fl_adm_attak'] ."</b></font>", $lang['fl_warning'], "fleet." . PHPEXT, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ecriture de l'enregistrement de flotte (a partir de l<>, y a quelque chose qui vole et c'est toujours sur la planete d'origine)
|
||||||
|
$QryInsertFleet = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertFleet .= "`fleet_owner` = '". $user['id'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_mission` = '". $_POST['mission'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_amount` = '". $FleetShipCount ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_array` = '". $fleet_array ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_time` = '". $fleet['start_time'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_galaxy` = '". intval($_POST['thisgalaxy']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_system` = '". intval($_POST['thissystem']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_planet` = '". intval($_POST['thisplanet']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_type` = '". intval($_POST['thisplanettype']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_time` = '". $fleet['end_time'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_stay` = '". $StayTime ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_galaxy` = '". intval($_POST['galaxy']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_system` = '". intval($_POST['system']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_planet` = '". intval($_POST['planet']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_type` = '". intval($_POST['planettype']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_resource_metal` = '". intval($TransMetal) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_resource_crystal` = '". intval($TransCrystal) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_resource_deuterium` = '". intval($TransDeuterium) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_target_owner` = '". $TargetPlanet['id_owner'] ."', ";
|
||||||
|
$QryInsertFleet .= "`start_time` = '". time() ."';";
|
||||||
|
doquery( $QryInsertFleet, 'fleets');
|
||||||
|
|
||||||
|
|
||||||
|
$CurrentPlanet["metal"] = $CurrentPlanet["metal"] - $TransMetal;
|
||||||
|
$CurrentPlanet["crystal"] = $CurrentPlanet["crystal"] - $TransCrystal;
|
||||||
|
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $TransDeuterium;
|
||||||
|
$CurrentPlanet["deuterium"] = $CurrentPlanet["deuterium"] - $consumption;
|
||||||
|
|
||||||
|
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdatePlanet .= $FleetSubQRY;
|
||||||
|
$QryUpdatePlanet .= "`metal` = '". $CurrentPlanet["metal"] ."', ";
|
||||||
|
$QryUpdatePlanet .= "`crystal` = '". $CurrentPlanet["crystal"] ."', ";
|
||||||
|
$QryUpdatePlanet .= "`deuterium` = '". $CurrentPlanet["deuterium"] ."' ";
|
||||||
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
|
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."'";
|
||||||
|
|
||||||
|
// Mise a jours de l'enregistrement de la planete de depart (a partir de là, y a quelque chose qui vole et ce n'est plus sur la planete de depart)
|
||||||
|
doquery("LOCK TABLE {{table}} WRITE", 'planets');
|
||||||
|
doquery ($QryUpdatePlanet, "planets");
|
||||||
|
doquery("UNLOCK TABLES", '');
|
||||||
|
// doquery("FLUSH TABLES", '');
|
||||||
|
|
||||||
|
// Un peu de blabla pour l'utilisateur, affichage d'un joli tableau de la flotte expedi<64>e
|
||||||
|
$page = "<br><div><center>";
|
||||||
|
$page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"519\">";
|
||||||
|
$page .= "<tr height=\"20\">";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"2\"><span class=\"success\">". $lang['fl_fleet_send'] ."</span></td>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_mission'] ."</th>";
|
||||||
|
$page .= "<th>". $missiontype[$_POST['mission']] ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||||
|
$page .= "<th>". pretty_number($distance) ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||||
|
$page .= "<th>". pretty_number($_POST['speedallsmin']) ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||||
|
$page .= "<th>". pretty_number($consumption) ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_from'] ."</th>";
|
||||||
|
$page .= "<th>". $_POST['thisgalaxy'] .":". $_POST['thissystem']. ":". $_POST['thisplanet'] ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_dest'] ."</th>";
|
||||||
|
$page .= "<th>". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||||
|
$page .= "<th>". date("M D d H:i:s", $fleet['start_time']) ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||||
|
$page .= "<th>". date("M D d H:i:s", $fleet['end_time']) ."</th>";
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<td class=\"c\" colspan=\"2\">". $lang['fl_title'] ."</td>";
|
||||||
|
|
||||||
|
foreach ($fleetarray as $Ship => $Count) {
|
||||||
|
$page .= "</tr><tr height=\"20\">";
|
||||||
|
$page .= "<th>". $lang['tech'][$Ship] ."</th>";
|
||||||
|
$page .= "<th>". pretty_number($Count) ."</th>";
|
||||||
|
}
|
||||||
|
$page .= "</tr></table></div></center>";
|
||||||
|
|
||||||
|
// Provisoire
|
||||||
|
sleep (1);
|
||||||
|
|
||||||
|
$planetrow = doquery ("SELECT * FROM {{table}} WHERE `id` = '". $CurrentPlanet['id'] ."';", 'planets', true);
|
||||||
|
|
||||||
|
display($page, $lang['fl_title']);
|
||||||
|
|
||||||
|
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
|
||||||
|
// Updated by -= MoF =- for Deutsches Ugamela Forum
|
||||||
|
// 06.12.2007 - 08:39
|
||||||
|
// Open Source
|
||||||
|
// (c) by MoF
|
||||||
|
|
||||||
|
?>
|
||||||
278
flotenajax.php
Normal file
|
|
@ -0,0 +1,278 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('galaxy');
|
||||||
|
includeLang('fleet');
|
||||||
|
|
||||||
|
$UserSpyProbes = $planetrow['spy_sonde'];
|
||||||
|
$UserRecycles = $planetrow['recycler'];
|
||||||
|
$UserDeuterium = $planetrow['deuterium'];
|
||||||
|
$UserMissiles = $planetrow['interplanetary_misil'];
|
||||||
|
|
||||||
|
$fleet = array();
|
||||||
|
$speedalls = array();
|
||||||
|
$PartialFleet = false; // 610
|
||||||
|
$PartialCount = 0;
|
||||||
|
|
||||||
|
foreach ($reslist['fleet'] as $Node => $ShipID) {
|
||||||
|
$TName = "ship".$ShipID;
|
||||||
|
if ($ShipID > 200 && $ShipID < 300 && $_POST[$TName] > 0) {
|
||||||
|
if ($_POST[$TName] > $planetrow[$resource[$ShipID]]) {
|
||||||
|
$fleet['fleetarray'][$ShipID] = $planetrow[$resource[$ShipID]];
|
||||||
|
$fleet['fleetlist'] .= $ShipID .",". $planetrow[$resource[$ShipID]] .";";
|
||||||
|
$fleet['amount'] += $planetrow[$resource[$ShipID]];
|
||||||
|
$PartialCount += $planetrow[$resource[$ShipID]];
|
||||||
|
$PartialFleet = true;
|
||||||
|
} else {
|
||||||
|
$fleet['fleetarray'][$ShipID] = $_POST[$TName];
|
||||||
|
$fleet['fleetlist'] .= $ShipID .",". $_POST[$TName] .";";
|
||||||
|
$fleet['amount'] += $_POST[$TName];
|
||||||
|
$speedalls[$ShipID] = $_POST[$TName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($PartialFleet == true) {
|
||||||
|
if ( $PartialCount < 1 ) {
|
||||||
|
$ResultMessage = "610;".$lang['gs_c610a']. $PartialCount .$lang['gs_c610b']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$PrNoob = $gameConfig['noobprotection'];
|
||||||
|
$PrNoobTime = $gameConfig['noobprotectiontime'];
|
||||||
|
$PrNoobMulti = $gameConfig['noobprotectionmulti'];
|
||||||
|
|
||||||
|
// Petit Test de coherance
|
||||||
|
$galaxy = intval($_POST['galaxy']);
|
||||||
|
if ($galaxy > 9 || $galaxy < 1) {
|
||||||
|
$ResultMessage = "602;".$lang['gs_c602']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
$system = intval($_POST['system']);
|
||||||
|
if ($system > 499 || $system < 1) {
|
||||||
|
$ResultMessage = "602;".$lang['gs_c602']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
$planet = intval($_POST['planet']);
|
||||||
|
if ($planet > 15 || $planet < 1) {
|
||||||
|
$ResultMessage = "602;".$lang['gs_c602']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
$FleetArray = $fleet['fleetarray'];
|
||||||
|
|
||||||
|
$CurrentFlyingFleets = doquery("SELECT COUNT(fleet_id) AS `Nbre` FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets', true);
|
||||||
|
$CurrentFlyingFleets = $CurrentFlyingFleets["Nbre"];
|
||||||
|
|
||||||
|
$QrySelectEnemy = "SELECT * FROM {{table}} ";
|
||||||
|
$QrySelectEnemy .= "WHERE ";
|
||||||
|
$QrySelectEnemy .= "`galaxy` = '". $_POST['galaxy'] ."' AND ";
|
||||||
|
$QrySelectEnemy .= "`system` = '". $_POST['system'] ."' AND ";
|
||||||
|
$QrySelectEnemy .= "`planet` = '". $_POST['planet'] ."' AND ";
|
||||||
|
$QrySelectEnemy .= "`planet_type` = '". $_POST['planettype'] ."';";
|
||||||
|
$TargetRow = doquery( $QrySelectEnemy, 'planets', true);
|
||||||
|
|
||||||
|
if ($TargetRow['id_owner'] == '') {
|
||||||
|
$TargetUser = $user;
|
||||||
|
} elseif ($TargetRow['id_owner'] != '') {
|
||||||
|
$TargetUser = doquery("SELECT * FROM {{table}} WHERE `id` = '". $TargetRow['id_owner'] ."';", 'users', true);
|
||||||
|
}
|
||||||
|
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $user['id'] ."';", 'statpoints', true);
|
||||||
|
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TargetUser['id'] ."';", 'statpoints', true);
|
||||||
|
|
||||||
|
$CurrentPoints = $UserPoints['total_points'];
|
||||||
|
$TargetPoints = $User2Points['total_points'];
|
||||||
|
$TargetVacat = $TargetUser['urlaubs_modus'];
|
||||||
|
|
||||||
|
// Test s'il y a un slot de libre au moins !
|
||||||
|
if (($user[$resource[108]] + 1) <= $CurrentFlyingFleets) {
|
||||||
|
$ResultMessage = "612;".$lang['gs_c612']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Y a une flotte dans la variable ??
|
||||||
|
if (!is_array($FleetArray)) {
|
||||||
|
$ResultMessage = "618;".$lang['gs_c618']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Faut pas deconner non plus ... c'est Espionnage OU Recyclage .... Pour le café vous repasserez !!
|
||||||
|
if (! (($_POST["mission"] == 6) OR
|
||||||
|
($_POST["mission"] == 8)) ) {
|
||||||
|
$ResultMessage = "618;".$lang['gs_c618']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
// On teste une derniere fois s'il nous reste des billes ...
|
||||||
|
foreach ($FleetArray as $Ships => $Count) {
|
||||||
|
if ($Count > $planetrow[$resource[$Ships]]) {
|
||||||
|
$ResultMessage = "611;".$lang['gs_c611']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($PrNoobTime < 1) {
|
||||||
|
$PrNoobTime = 9999999999999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($TargetVacat && $_POST['mission'] != 8) {
|
||||||
|
$ResultMessage = "605;".$lang['gs_c605']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($CurrentPoints > ($TargetPoints * $PrNoobMulti) AND
|
||||||
|
$TargetRow['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 6 AND
|
||||||
|
$PrNoob == 1 AND
|
||||||
|
$TargetPoints < ($PrNoobTime * 1000)) {
|
||||||
|
$ResultMessage = "603;".$lang['gs_c603']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($TargetPoints > ($CurrentPoints * $PrNoobMulti) AND
|
||||||
|
$TargetRow['id_owner'] != '' AND
|
||||||
|
$_POST['mission'] == 6 AND
|
||||||
|
$PrNoob == 1 AND
|
||||||
|
$CurrentPoints < ($PrNoobTime * 1000)) {
|
||||||
|
$ResultMessage = "604;".$lang['gs_c604']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($TargetRow['id_owner'] == '' AND
|
||||||
|
$_POST['mission'] != 8 ) {
|
||||||
|
$ResultMessage = "601;".$lang['gs_c601']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($TargetRow["id_owner"] == $planetrow["id_owner"]) AND
|
||||||
|
($_POST["mission"] == 6)) {
|
||||||
|
$ResultMessage = "618;".$lang['gs_c618']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['thisgalaxy'] != $planetrow['galaxy'] |
|
||||||
|
$_POST['thissystem'] != $planetrow['system'] |
|
||||||
|
$_POST['thisplanet'] != $planetrow['planet'] |
|
||||||
|
$_POST['thisplanettype'] != $planetrow['planet_type']) {
|
||||||
|
$ResultMessage = "618;".$lang['gs_c618']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
$Distance = GetTargetDistance ($_POST['thisgalaxy'], $_POST['galaxy'], $_POST['thissystem'], $_POST['system'], $_POST['thisplanet'], $_POST['planet']);
|
||||||
|
$speedall = GetFleetMaxSpeed ($FleetArray, 0, $user);
|
||||||
|
$SpeedAllMin = min($speedall);
|
||||||
|
$Duration = GetMissionDuration ( 10, $SpeedAllMin, $Distance, GetGameSpeedFactor ());
|
||||||
|
|
||||||
|
$fleet['fly_time'] = $Duration;
|
||||||
|
$fleet['start_time'] = $Duration + time();
|
||||||
|
$fleet['end_time'] = ($Duration * 2) + time();
|
||||||
|
|
||||||
|
$FleetShipCount = 0;
|
||||||
|
$FleetDBArray = "";
|
||||||
|
$FleetSubQRY = "";
|
||||||
|
$consumption = 0;
|
||||||
|
$SpeedFactor = GetGameSpeedFactor ();
|
||||||
|
foreach ($FleetArray as $Ship => $Count) {
|
||||||
|
$ShipSpeed = $pricelist[$Ship]["speed"];
|
||||||
|
$spd = 35000 / ($Duration * $SpeedFactor - 10) * sqrt($Distance * 10 / $ShipSpeed);
|
||||||
|
$basicConsumption = $pricelist[$Ship]["consumption"] * $Count ;
|
||||||
|
$consumption += $basicConsumption * $Distance / 35000 * (($spd / 10) + 1) * (($spd / 10) + 1);
|
||||||
|
$FleetShipCount += $Count;
|
||||||
|
$FleetDBArray .= $Ship .",". $Count .";";
|
||||||
|
$FleetSubQRY .= "`".$resource[$Ship] . "` = `" . $resource[$Ship] . "` - " . $Count . " , ";
|
||||||
|
}
|
||||||
|
$consumption = round($consumption) + 1;
|
||||||
|
|
||||||
|
if ($TargetRow['id_level'] > $user['authlevel']) {
|
||||||
|
$Allowed = true;
|
||||||
|
switch ($_POST['mission']){
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 6:
|
||||||
|
case 9:
|
||||||
|
$Allowed = false;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
if ($Allowed == false) {
|
||||||
|
$ResultMessage = "619;".$lang['gs_c619']."|".$CurrentFlyingFleets." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
die ( $ResultMessage );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$QryInsertFleet = "INSERT INTO {{table}} SET ";
|
||||||
|
$QryInsertFleet .= "`fleet_owner` = '". $user['id'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_mission` = '". intval($_POST['mission']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_amount` = '". $FleetShipCount ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_array` = '". $FleetDBArray ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_time` = '". $fleet['start_time']. "', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_galaxy` = '". intval($_POST['thisgalaxy']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_system` = '". intval($_POST['thissystem']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_planet` = '". intval($_POST['thisplanet']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_start_type` = '". intval($_POST['thisplanettype']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_time` = '". $fleet['end_time'] ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_galaxy` = '". intval($_POST['galaxy']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_system` = '". intval($_POST['system']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_planet` = '". intval($_POST['planet']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_end_type` = '". intval($_POST['planettype']) ."', ";
|
||||||
|
$QryInsertFleet .= "`fleet_target_owner` = '". $TargetRow['id_owner'] ."', ";
|
||||||
|
$QryInsertFleet .= "`start_time` = '" . time() . "';";
|
||||||
|
doquery( $QryInsertFleet, 'fleets');
|
||||||
|
|
||||||
|
$UserDeuterium -= $consumption;
|
||||||
|
$QryUpdatePlanet = "UPDATE {{table}} SET ";
|
||||||
|
$QryUpdatePlanet .= $FleetSubQRY;
|
||||||
|
$QryUpdatePlanet .= "`deuterium` = '".$UserDeuterium."' " ;
|
||||||
|
$QryUpdatePlanet .= "WHERE ";
|
||||||
|
$QryUpdatePlanet .= "`id` = '". $planetrow['id'] ."';";
|
||||||
|
doquery( $QryUpdatePlanet, 'planets');
|
||||||
|
|
||||||
|
$CurrentFlyingFleets++;
|
||||||
|
|
||||||
|
$planetrow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', true);
|
||||||
|
$ResultMessage = "600;". $lang['gs_sending'] ." ". $FleetShipCount ." ". $lang['tech'][$Ship] ." ". $lang['gs_to'] ." ". $_POST['galaxy'] .":". $_POST['system'] .":". $_POST['planet'] ."...|";
|
||||||
|
$ResultMessage .= $CurrentFlyingFleets ." ".$UserSpyProbes." ".$UserRecycles." ".$UserMissiles;
|
||||||
|
|
||||||
|
die ( $ResultMessage );
|
||||||
|
?>
|
||||||
64
frames.php
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
|
||||||
|
$XNova_Host = $_SERVER['HTTP_HOST'];
|
||||||
|
$XNova_Script = $_SERVER['SCRIPT_NAME'];
|
||||||
|
$Uri_Array = explode ('/', $XNova_Script);
|
||||||
|
// On vire le script
|
||||||
|
array_pop($Uri_Array);
|
||||||
|
$XNova_URI = implode ('/', $Uri_Array);
|
||||||
|
|
||||||
|
$XNovaRootURL = "http://". $XNova_Host ."/". $XNova_URI ."/";
|
||||||
|
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
$page = "<html>";
|
||||||
|
$page .= "<head>";
|
||||||
|
$page .= "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=". $langInfos['ENCODING']."\">";
|
||||||
|
$page .= "<link rel=\"shortcut icon\" href=\"favicon.ico\">";
|
||||||
|
$page .= "<title>". $gameConfig['game_name'] ."</title>";
|
||||||
|
$page .= "</head>";
|
||||||
|
|
||||||
|
$page .= "<frameset framespacing=\"0\" border=\"0\" cols=\"190,*\" frameborder=\"0\">";
|
||||||
|
$page .= "<frame name=\"LeftMenu\" target=\"Mainframe\" src=\"leftmenu.php\" noresize scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\">";
|
||||||
|
$page .= "<frame name=\"Hauptframe\" src=\"overview.php\">";
|
||||||
|
$page .= "<noframes>";
|
||||||
|
$page .= "<body>";
|
||||||
|
$page .= "<p>Votre navigateur ne gère pas les frames.</p>";
|
||||||
|
$page .= "</noframes>";
|
||||||
|
$page .= "</frameset>";
|
||||||
|
$page .= "</body>";
|
||||||
|
$page .= "</html>";
|
||||||
|
|
||||||
|
echo $page;
|
||||||
|
|
||||||
163
galaxy.php
Normal file
|
|
@ -0,0 +1,163 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of XNova:Legacies
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
* @see http://www.xnova-ng.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* --> NOTICE <--
|
||||||
|
* This file is part of the core development branch, changing its contents will
|
||||||
|
* make you unable to use the automatic updates manager. Please refer to the
|
||||||
|
* documentation for further information about customizing XNova.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('INSIDE' , true);
|
||||||
|
define('INSTALL' , false);
|
||||||
|
require_once dirname(__FILE__) .'/common.php';
|
||||||
|
|
||||||
|
includeLang('galaxy');
|
||||||
|
|
||||||
|
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', true);
|
||||||
|
$lunarow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_luna'] ."';", 'lunas', true);
|
||||||
|
$galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '". $CurrentPlanet['id'] ."';", 'galaxy', true);
|
||||||
|
|
||||||
|
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
|
||||||
|
$fleetmax = $user['computer_tech'] + 1;
|
||||||
|
$CurrentPlID = $CurrentPlanet['id'];
|
||||||
|
$CurrentMIP = $CurrentPlanet['interplanetary_misil'];
|
||||||
|
$CurrentRC = $CurrentPlanet['recycler'];
|
||||||
|
$CurrentSP = $CurrentPlanet['spy_sonde'];
|
||||||
|
$HavePhalanx = $CurrentPlanet['phalanx'];
|
||||||
|
$CurrentSystem = $CurrentPlanet['system'];
|
||||||
|
$CurrentGalaxy = $CurrentPlanet['galaxy'];
|
||||||
|
$CanDestroy = $CurrentPlanet[$resource[213]] + $CurrentPlanet[$resource[214]];
|
||||||
|
|
||||||
|
$maxfleet = doquery("SELECT * FROM {{table}} WHERE `fleet_owner` = '". $user['id'] ."';", 'fleets');
|
||||||
|
$maxfleet_count = mysql_num_rows($maxfleet);
|
||||||
|
|
||||||
|
CheckPlanetUsedFields($CurrentPlanet);
|
||||||
|
CheckPlanetUsedFields($lunarow);
|
||||||
|
|
||||||
|
if (!isset($mode)) {
|
||||||
|
if (isset($_GET['mode'])) {
|
||||||
|
$mode = intval($_GET['mode']);
|
||||||
|
} else {
|
||||||
|
$mode = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$galaxy = 1;
|
||||||
|
$system = 1;
|
||||||
|
$planet = null;
|
||||||
|
|
||||||
|
if ($mode == 0) {
|
||||||
|
$galaxy = $CurrentGalaxy;
|
||||||
|
$system = $CurrentSystem;
|
||||||
|
} elseif ($mode == 1 || $mode == 3) {
|
||||||
|
if (isset($_POST["galaxyLeft"])) {
|
||||||
|
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
|
||||||
|
$galaxy = 1;
|
||||||
|
} else {
|
||||||
|
$galaxy = intval($_POST["galaxy"]) - 1;
|
||||||
|
}
|
||||||
|
} elseif (isset($_POST["galaxyRight"])) {
|
||||||
|
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
|
||||||
|
$galaxy = MAX_GALAXY_IN_WORLD;
|
||||||
|
} else {
|
||||||
|
$galaxy = intval($_POST["galaxy"]) + 1;
|
||||||
|
}
|
||||||
|
} else if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 1 || $_POST["galaxy"] > MAX_GALAXY_IN_WORLD) {
|
||||||
|
$galaxy = 1;
|
||||||
|
} else {
|
||||||
|
$galaxy = intval($_POST["galaxy"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST["systemLeft"])) {
|
||||||
|
if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
|
||||||
|
$system = 1;
|
||||||
|
} else {
|
||||||
|
$system = intval($_POST["system"]) - 1;
|
||||||
|
}
|
||||||
|
} elseif (isset($_POST["systemRight"])) {
|
||||||
|
if (!isset($_POST["system"]) || $_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
|
||||||
|
$system = MAX_SYSTEM_IN_GALAXY;
|
||||||
|
} else {
|
||||||
|
$system = intval($_POST["system"]) + 1;
|
||||||
|
}
|
||||||
|
} else if (!isset($_POST["system"]) || $_POST["system"] <= 1 || $_POST["system"] > MAX_SYSTEM_IN_GALAXY) {
|
||||||
|
$system = 1;
|
||||||
|
} else {
|
||||||
|
$system = intval($_POST["system"]);
|
||||||
|
}
|
||||||
|
} elseif ($mode == 2) {
|
||||||
|
if (!isset($_POST["galaxy"]) || $_POST["galaxy"] <= 0) {
|
||||||
|
$galaxy = 1;
|
||||||
|
} else if ($_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
|
||||||
|
$galaxy = MAX_GALAXY_IN_WORLD;
|
||||||
|
} else {
|
||||||
|
$galaxy = intval($_POST["galaxy"]) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($_POST["system"]) || $_POST["system"] <= 0) {
|
||||||
|
$system = 1;
|
||||||
|
} else if ($_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
|
||||||
|
$system = MAX_SYSTEM_IN_GALAXY;
|
||||||
|
} else {
|
||||||
|
$system = intval($_POST["system"]) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($_POST["planet"]) || $_POST["planet"] <= 0) {
|
||||||
|
$planet = 1;
|
||||||
|
} else if ($_POST["planet"] >= MAX_PLANET_IN_SYSTEM) {
|
||||||
|
$planet = MAX_PLANET_IN_SYSTEM;
|
||||||
|
} else {
|
||||||
|
$planet = intval($_POST["planet"]) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$planetcount = 0;
|
||||||
|
$lunacount = 0;
|
||||||
|
|
||||||
|
$page = InsertGalaxyScripts($CurrentPlanet);
|
||||||
|
|
||||||
|
$page .= "<body style=\"overflow: hidden;\" onUnload=\"\"><br><br>";
|
||||||
|
$page .= ShowGalaxySelector ( $galaxy, $system );
|
||||||
|
|
||||||
|
if ($mode == 2) {
|
||||||
|
$page .= ShowGalaxyMISelector($galaxy, $system, $planet, $CurrentPlanet['id'], $CurrentMIP);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page .= "<table width=569><tbody>";
|
||||||
|
|
||||||
|
$page .= ShowGalaxyTitles($galaxy, $system);
|
||||||
|
$page .= ShowGalaxyRows($galaxy, $system);
|
||||||
|
$page .= ShowGalaxyFooter($galaxy, $system, $CurrentMIP, $CurrentRC, $CurrentSP);
|
||||||
|
|
||||||
|
$page .= "</tbody></table></div>";
|
||||||
|
|
||||||
|
display ($page, $lang[''], false, '', false);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
// History version
|
||||||
|
// 1.0 - Created by Perberos
|
||||||
|
// 1.1 - Modified by -MoF- (UGamela germany)
|
||||||
|
// 1.2 - 1er Nettoyage Chlorel ...
|
||||||
|
// 1.3 - 2eme Nettoyage Chlorel ... Mise en fonction et debuging complet
|
||||||
|
?>
|
||||||
BIN
images/abort.gif
Normal file
|
After Width: | Height: | Size: 842 B |
BIN
images/bann.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
images/banned.png
Normal file
|
After Width: | Height: | Size: 769 B |
BIN
images/false.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
images/female.gif
Normal file
|
After Width: | Height: | Size: 141 B |
BIN
images/icon_latest_reply.gif
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
images/loadingAnimation.gif
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
images/male.gif
Normal file
|
After Width: | Height: | Size: 143 B |
BIN
images/officiers/601.jpg
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
images/officiers/602.jpg
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
images/officiers/603.jpg
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
images/officiers/604.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
images/officiers/605.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
images/officiers/606.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
images/officiers/607.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
images/officiers/608.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
images/officiers/609.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
images/officiers/610.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
images/officiers/611.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
images/officiers/612.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
images/officiers/613.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
images/officiers/614.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
images/officiers/615.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
images/progress.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/progressbar.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/r1.png
Normal file
|
After Width: | Height: | Size: 466 B |
BIN
images/r2.png
Normal file
|
After Width: | Height: | Size: 729 B |