Initial Commit
674
GNU-GPL.txt
Normal file
|
@ -0,0 +1,674 @@
|
||||||
|
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>.
|
124
classes/admin.php
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_Admin' ) ){
|
||||||
|
class SM_Admin{
|
||||||
|
|
||||||
|
// Init the admin menu and pages
|
||||||
|
function sm_admin(){
|
||||||
|
add_action( 'admin_menu', array( &$this, 'menu_shuffle' ), 20 );
|
||||||
|
add_action( 'admin_head', array( &$this, 'load_admin_scripts' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove Menu added by WordPress UI and add my own as a subpage
|
||||||
|
function menu_shuffle(){
|
||||||
|
global $menu,$simple_map,$sm_options,$sm_help,$sm_import_export;
|
||||||
|
|
||||||
|
// Get options
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
// loop through menu and find the one I need to disable
|
||||||
|
foreach( $menu as $key => $value ) {
|
||||||
|
if ( in_array( 'edit.php?post_type=sm-location' , $value ) ) {
|
||||||
|
unset( $menu[$key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_menu_page(__('SimpleMap Options', 'SimpleMap'), 'SimpleMap', apply_filters( 'sm-admin-permissions-sm-options', 'publish_posts' ), 'simplemap', array( &$sm_options, 'print_page' ), SIMPLEMAP_URL.'/inc/images/icon.png' );
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: General Options', 'SimpleMap'), __( 'General Options', 'SimpleMap'), apply_filters( 'sm-admin-permissions-sm-options', 'manage_options' ), 'simplemap', array( &$sm_options, 'print_page' ) );
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: Add Location', 'SimpleMap'), __( 'Add Location', 'SimpleMap' ), apply_filters( 'sm-admin-permissions-sm-add-locations', 'publish_posts' ), 'post-new.php?post_type=sm-location' );
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: Edit Locations', 'SimpleMap'), __( 'Edit Locations', 'SimpleMap' ), apply_filters( 'sm-admin-permissions-sm-edit-locations', 'publish_posts' ), 'edit.php?post_type=sm-location' );
|
||||||
|
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: Location ' . $tax_info['plural'], 'SimpleMap'), __( 'Location ' . $tax_info['plural'], 'SimpleMap' ), 'publish_posts', 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=sm-location' );
|
||||||
|
}
|
||||||
|
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: Import / Export CSV', 'SimpleMap'), __('Import / Export CSV', 'SimpleMap'), 'publish_posts', 'simplemap-import-export', array( &$sm_import_export, 'print_page' ) );
|
||||||
|
add_submenu_page( 'simplemap', __('SimpleMap: Premium Support', 'SimpleMap'), __('Premium Support', 'SimpleMap'), 'publish_posts', 'simplemap-help', array( &$sm_help, 'print_page' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print admin scripts
|
||||||
|
function load_admin_scripts(){
|
||||||
|
global $current_screen;
|
||||||
|
|
||||||
|
#### GENERAL OPTIONS PAGE ####
|
||||||
|
if ( 'toplevel_page_simplemap' == $current_screen->id ) :
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function($) {
|
||||||
|
if ($(document).width() < 1300) {
|
||||||
|
$('.postbox-container').css({'width': '99%'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.postbox-container').css({'width': '49%'});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#autoload').val() == 'none') {
|
||||||
|
$('#lock_default_location').attr('checked', false);
|
||||||
|
$('#lock_default_location').attr('disabled', true);
|
||||||
|
$('#lock_default_location_label').addClass('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#autoload').change(function() {
|
||||||
|
if ($(this).val() != 'none') {
|
||||||
|
$('#lock_default_location').attr('disabled', false);
|
||||||
|
$('#lock_default_location_label').removeClass('disabled');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#lock_default_location').attr('checked', false);
|
||||||
|
$('#lock_default_location').attr('disabled', true);
|
||||||
|
$('#lock_default_location_label').addClass('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#address_format').siblings().addClass('hidden');
|
||||||
|
if ($('#address_format').val() == 'town, province postalcode')
|
||||||
|
$('#order_1').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'town province postalcode')
|
||||||
|
$('#order_2').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'town-province postalcode')
|
||||||
|
$('#order_3').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'postalcode town-province')
|
||||||
|
$('#order_4').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'postalcode town, province')
|
||||||
|
$('#order_5').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'postalcode town')
|
||||||
|
$('#order_6').removeClass('hidden');
|
||||||
|
else if ($('#address_format').val() == 'town postalcode')
|
||||||
|
$('#order_7').removeClass('hidden');
|
||||||
|
|
||||||
|
$('#address_format').change(function() {
|
||||||
|
$(this).siblings().addClass('hidden');
|
||||||
|
if ($(this).val() == 'town, province postalcode')
|
||||||
|
$('#order_1').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'town province postalcode')
|
||||||
|
$('#order_2').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'town-province postalcode')
|
||||||
|
$('#order_3').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'postalcode town-province')
|
||||||
|
$('#order_4').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'postalcode town, province')
|
||||||
|
$('#order_5').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'postalcode town')
|
||||||
|
$('#order_6').removeClass('hidden');
|
||||||
|
else if ($(this).val() == 'town postalcode')
|
||||||
|
$('#order_7').removeClass('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
// #autoload, #lock_default_location
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
}
|
||||||
|
|
||||||
|
function on_activate() {
|
||||||
|
//$current = get_site_transient( 'update_plugins' );
|
||||||
|
//if ( !isset( $current->checked[SIMPLEMAP_FILE] ) ) {
|
||||||
|
return; // <--- Remove to enable
|
||||||
|
$options = get_option( 'SimpleMap_options' );
|
||||||
|
if ( empty( $options ) ) {
|
||||||
|
$options = array( 'auto_locate' => 'html5' );
|
||||||
|
update_option( 'SimpleMap_options', $options );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
827
classes/ft-ps-client.php
Normal file
|
@ -0,0 +1,827 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* FullThrottle Premium Support Client
|
||||||
|
* Curious? Send me an email and you can beta it for me (glenn@fullthrottledevelopment.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! class_exists( 'FT_Premium_Support_Client' ) ) {
|
||||||
|
|
||||||
|
class FT_Premium_Support_Client {
|
||||||
|
|
||||||
|
var $server_url;
|
||||||
|
var $product_id;
|
||||||
|
var $plugin_support_page_ids;
|
||||||
|
var $confirming_request;
|
||||||
|
var $receiving_sso;
|
||||||
|
var $learn_more_link;
|
||||||
|
var $ps_status = false;
|
||||||
|
var $sso_status = false;
|
||||||
|
var $paypal_button = false;
|
||||||
|
var $site_url;
|
||||||
|
var $plugin_basename = false;
|
||||||
|
var $plugin_slug = false;
|
||||||
|
|
||||||
|
// Constructer fires on admin page loads
|
||||||
|
function ft_premium_support_client( $config=array() ) {
|
||||||
|
|
||||||
|
// Populate properties
|
||||||
|
$this->server_url = isset( $config['server_url'] ) ? $config['server_url'] : false;
|
||||||
|
$this->product_id = isset( $config['product_id'] ) ? $config['product_id'] : false;
|
||||||
|
$this->plugin_support_page_ids = isset( $config['plugin_support_page_ids'] ) ? $config['plugin_support_page_ids'] : false;
|
||||||
|
$this->plugin_basename = isset( $config['plugin_basename'] ) ? $config['plugin_basename'] : false;
|
||||||
|
$this->plugin_slug = isset( $config['plugin_slug'] ) ? $config['plugin_slug'] : false;
|
||||||
|
$this->learn_more_link = isset( $config['learn_more_link'] ) ? $config['learn_more_link'] : false;
|
||||||
|
$this->confirming_request = isset( $_GET['ft-ps-confirm-request'] ) ? $_GET['ft-ps-confirm-request'] : false;
|
||||||
|
$this->receiving_sso = isset( $_POST['ft-ps-receiving-sso'] ) ? $_POST['ft-ps-receiving-sso'] : false;
|
||||||
|
$this->site_url = site_url();
|
||||||
|
|
||||||
|
// Register actions
|
||||||
|
add_action( 'admin_head', array( &$this, 'init' ) );
|
||||||
|
add_action( 'init', array( &$this, 'check_premium_upgrades' ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks for premium upgrades
|
||||||
|
function check_premium_upgrades() {
|
||||||
|
// Build key
|
||||||
|
$exp_option_key = '_ftpssu_' . md5( 'ftpssue-' . $this->product_id . '-' . sanitize_title_with_dashes( $this->site_url ) . '-' . sanitize_title_with_dashes( $this->server_url ) );
|
||||||
|
|
||||||
|
// Check server for auto update?
|
||||||
|
if ( $expires = get_option( $exp_option_key ) ) {
|
||||||
|
|
||||||
|
if ( $expires > strtotime( 'now' ) )
|
||||||
|
$ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-upgrade-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url . '&exp=' . $expires, $this->plugin_basename, $this->plugin_slug, 1 );
|
||||||
|
else
|
||||||
|
delete_option( 'external_updates-' . $this->plugin_slug );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inits the client if we're on the support page or receiving a request from the server
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
global $current_screen;
|
||||||
|
|
||||||
|
// Return false if we don't have initial config settings and this isn't a request from the host server
|
||||||
|
if ( ( ! $this->server_url || ! $this->product_id || ! isset( $this->plugin_support_page_ids ) ) && ( ! $this->confirming_request || ! $this->receiving_sso ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Fire in the hole!
|
||||||
|
if ( $this->receiving_sso )
|
||||||
|
$this->receive_sso();
|
||||||
|
elseif ( $this->confirming_request )
|
||||||
|
$this->confirm_request();
|
||||||
|
elseif ( in_array( $current_screen->id, $this->plugin_support_page_ids ) )
|
||||||
|
$this->init_premium_support();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function inits premium support process
|
||||||
|
function init_premium_support() {
|
||||||
|
|
||||||
|
global $current_user;
|
||||||
|
wp_get_current_user();
|
||||||
|
|
||||||
|
// Check for premium support, sso, and paypal button transients
|
||||||
|
$status_key = md5( 'ft_premium_support_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) ) ;
|
||||||
|
$sso_key = md5( 'ft_premium_sso_' . $current_user->ID . '_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) );
|
||||||
|
$paypal_button_key = md5( 'ft_premium_signup_' . $this->product_id . '_' . sanitize_title_with_dashes( $this->site_url ) . '_' . sanitize_title_with_dashes( $this->server_url ) );
|
||||||
|
$exp_option_key = '_ftpssu_' . md5( 'ftpssue-' . $this->product_id . '-' . sanitize_title_with_dashes( $this->site_url ) . '-' . sanitize_title_with_dashes( $this->server_url ) );
|
||||||
|
|
||||||
|
// If we haven't set the status in the last 24 hours, or we haven't set a SSO for the current user in the last 3 hours, do it now.
|
||||||
|
if ( false === ( $ps_status = get_transient( $status_key ) ) || false === ( $sso_status = get_transient( $sso_key ) ) ) {
|
||||||
|
|
||||||
|
$body['ft-ps-status-request'] = true;
|
||||||
|
$body['site'] = urlencode( $this->site_url );
|
||||||
|
$body['user'] = $current_user->ID;
|
||||||
|
$body['product'] = $this->product_id;
|
||||||
|
$body['email'] = urlencode( $current_user->user_email );
|
||||||
|
$body['nicename'] = urlencode( $current_user->user_nicename );
|
||||||
|
|
||||||
|
// Ping server for response
|
||||||
|
if ( $request = wp_remote_post( $this->server_url, array( 'body' => $body, 'timeout' => 20 ) ) ) {
|
||||||
|
|
||||||
|
if ( isset( $request['response']['code'] ) && 200 == $request['response']['code'] ) {
|
||||||
|
|
||||||
|
// Response found a server, lets see if it hit a script we recognize
|
||||||
|
$response = json_decode( $request['body'] );
|
||||||
|
|
||||||
|
// Set the paypal button
|
||||||
|
if ( ! empty( $response->paypal_button->args ) && ! empty( $response->paypal_button->base) )
|
||||||
|
$this->paypal_button = add_query_arg( get_object_vars( $response->paypal_button->args ), $response->paypal_button->base );
|
||||||
|
|
||||||
|
// Set the expired flag
|
||||||
|
$this->support_expired = isset( $response->support_expired ) ? $response->support_expired : false;
|
||||||
|
|
||||||
|
// Do we have a premium status?
|
||||||
|
if ( isset( $response->support_status ) && $response->support_status ) {
|
||||||
|
|
||||||
|
// We have a premium support license for this domain / product combination. Set the transient and property
|
||||||
|
set_transient( $status_key, $response->support_status, 60*60*24 );
|
||||||
|
//set_transient( $status_key, $response->support_status, 60 );
|
||||||
|
$this->ps_status = $response->support_status;
|
||||||
|
|
||||||
|
// Did we get a user sso back as well? Set the property if we did
|
||||||
|
if ( isset( $response->user_sso ) && '' != $response->user_sso ) {
|
||||||
|
set_transient( $sso_key, $response->user_sso, 60*60*2.9 );
|
||||||
|
//set_transient( $sso_key, $response->user_sso, 60 );
|
||||||
|
$this->sso_status = $response->user_sso;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set an auto update option with expiration date
|
||||||
|
if ( isset( $response->support_status->exp_date ) && ! empty( $response->support_status->exp_date ) ) {
|
||||||
|
update_option( $exp_option_key, $response->support_status->exp_date );
|
||||||
|
|
||||||
|
// Check server for auto update?
|
||||||
|
if ( $this->ps_status ) {
|
||||||
|
delete_option( 'external_updates-' . $this->plugin_slug );
|
||||||
|
$ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-premium-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url . '&exp=' . $response->support_status->exp_date, SIMPLEMAP_PATH, $this->plugin_slug, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// No premium support so lets delete the keys
|
||||||
|
delete_option( 'external_updates-' . $this->plugin_slug );
|
||||||
|
delete_option( $exp_option_key );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Transients exist, therefore permission exists, set properties
|
||||||
|
$this->ps_status = $ps_status;
|
||||||
|
$this->sso_status = $sso_status;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check server for auto update?
|
||||||
|
if ( $this->ps_status )
|
||||||
|
$ft_ps_client_auto_update = new FT_Premium_Support_PluginUpdate_Checker( $this->server_url . '?ft-pss-upgrade-request=1&ft-pss-upgrade-request-product-id=' . $this->product_id . '&ft-pss-upgrade-request-site=' . $this->site_url, $this->plugin_basename, 'simplemap', 1 );
|
||||||
|
|
||||||
|
// Maybe Nag Renewal
|
||||||
|
$this->maybe_trigger_renewal_nag();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybe_trigger_renewal_nag() {
|
||||||
|
// Has support expired?
|
||||||
|
if ( ! empty( $this->support_expired ) && ! is_object( $this->support_expired ) ) {
|
||||||
|
add_action( 'admin_notices', array( $this, 'support_expired' ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $this->ps_status->exp_date ) ) {
|
||||||
|
$onemonthout = $this->ps_status->exp_date - 2628000;
|
||||||
|
// If we are within a month of expiration date
|
||||||
|
if ( $onemonthout <= strtotime( 'now' ) ) {
|
||||||
|
add_action( 'admin_notices', array( $this, 'renew_soon' ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function support_expired() {
|
||||||
|
$link = ( $this->paypal_button ) ? esc_url( $this->paypal_button ) : 'http://simplemap-plugin.com';
|
||||||
|
echo "<div class='update-nag'>" . sprintf( __( "<strong style='color:red;'>Your license for SimpleMap has expired!</strong><br />You need to renew your license now for continued support and upgrades: <a href='%s' target='_blank'>Renew my license now</a>." ), $link ) . "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function renew_soon() {
|
||||||
|
$link = ( $this->paypal_button ) ? esc_url( $this->paypal_button ) : 'http://simplemap-plugin.com';
|
||||||
|
echo "<div class='update-nag'>" . sprintf( __( "<strong style='color:red;'>SimpleMap is expiring soon!</strong><br />You will need to renew your license for continued support and upgrades: <a href='%s' target='_blank'>Renew my license now</a>." ), $link ) . "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !class_exists( 'FT_Premium_Support_PluginUpdate_Checker' ) ) :
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A custom plugin update checker.
|
||||||
|
*
|
||||||
|
* @author Janis Elsts
|
||||||
|
* @copyright 2010
|
||||||
|
* @version 1.0
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
class FT_Premium_Support_PluginUpdate_Checker {
|
||||||
|
|
||||||
|
var $metadataUrl = ''; //The URL of the plugin's metadata file.
|
||||||
|
var $pluginFile = ''; //Plugin filename relative to the plugins directory.
|
||||||
|
var $slug = ''; //Plugin slug.
|
||||||
|
var $checkPeriod = 12; //How often to check for updates (in hours).
|
||||||
|
var $optionName = ''; //Where to store the update info.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class constructor.
|
||||||
|
*
|
||||||
|
* @param string $metadataUrl The URL of the plugin's metadata file.
|
||||||
|
* @param string $pluginFile Fully qualified path to the main plugin file.
|
||||||
|
* @param string $slug The plugin's 'slug'. If not specified, the filename part of $pluginFile sans '.php' will be used as the slug.
|
||||||
|
* @param integer $checkPeriod How often to check for updates (in hours). Defaults to checking every 12 hours. Set to 0 to disable automatic update checks.
|
||||||
|
* @param string $optionName Where to store book-keeping info about update checks. Defaults to 'external_updates-$slug'.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function __construct( $metadataUrl, $pluginFile, $slug = '', $checkPeriod = 12, $optionName = '' ){
|
||||||
|
|
||||||
|
$this->metadataUrl = $metadataUrl;
|
||||||
|
$this->pluginFile = $pluginFile;
|
||||||
|
$this->checkPeriod = $checkPeriod;
|
||||||
|
$this->slug = $slug;
|
||||||
|
|
||||||
|
//If no slug is specified, use the name of the main plugin file as the slug.
|
||||||
|
//For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'.
|
||||||
|
if ( empty( $this->slug ) ){
|
||||||
|
$this->slug = basename( $this->pluginFile, '.php' );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( empty( $this->optionName ) ) {
|
||||||
|
$this->optionName = 'external_updates-' . $this->slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( '' == $optionName )
|
||||||
|
$this->optionName = 'external_updates-' . $this->slug;
|
||||||
|
else
|
||||||
|
$this->optionName = $optionName;
|
||||||
|
|
||||||
|
$this->installHooks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Install the hooks required to run periodic update checks and inject update info
|
||||||
|
* into WP data structures.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function installHooks(){
|
||||||
|
|
||||||
|
//Override requests for plugin information
|
||||||
|
add_filter( 'plugins_api', array( &$this, 'injectInfo' ), 10, 3 );
|
||||||
|
|
||||||
|
//Insert our update info into the update array maintained by WP
|
||||||
|
add_filter( 'site_transient_update_plugins', array( &$this,'injectUpdate' )); //WP 3.0+
|
||||||
|
add_filter( 'transient_update_plugins', array( &$this,'injectUpdate' ) ); //WP 2.8+
|
||||||
|
|
||||||
|
//Set up the periodic update checks
|
||||||
|
$cronHook = 'check_plugin_updates-' . $this->slug;
|
||||||
|
|
||||||
|
if ( $this->checkPeriod > 0 ) {
|
||||||
|
|
||||||
|
//Trigger the check via Cron
|
||||||
|
add_filter( 'cron_schedules', array( &$this, '_addCustomSchedule' ) );
|
||||||
|
|
||||||
|
if ( ! wp_next_scheduled( $cronHook ) && ! defined( 'WP_INSTALLING' ) ) {
|
||||||
|
|
||||||
|
$scheduleName = 'every' . $this->checkPeriod . 'hours';
|
||||||
|
wp_schedule_event( time(), $scheduleName, $cronHook );
|
||||||
|
|
||||||
|
}
|
||||||
|
add_action( $cronHook, array( &$this, 'checkForUpdates' ) );
|
||||||
|
|
||||||
|
//In case Cron is disabled or unreliable, we also manually trigger
|
||||||
|
//the periodic checks while the user is browsing the Dashboard.
|
||||||
|
add_action( 'admin_init', array( &$this, 'maybeCheckForUpdates' ) );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//Periodic checks are disabled.
|
||||||
|
wp_clear_scheduled_hook( $cronHook );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add our custom schedule to the array of Cron schedules used by WP.
|
||||||
|
*
|
||||||
|
* @param array $schedules
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function _addCustomSchedule( $schedules ) {
|
||||||
|
|
||||||
|
if ( $this->checkPeriod && ( $this->checkPeriod > 0 ) ) {
|
||||||
|
$scheduleName = 'every' . $this->checkPeriod . 'hours';
|
||||||
|
$schedules[$scheduleName] = array(
|
||||||
|
'interval' => $this->checkPeriod * 3600,
|
||||||
|
'display' => sprintf( 'Every %d hours', $this->checkPeriod ),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $schedules;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve plugin info from the configured API endpoint.
|
||||||
|
*
|
||||||
|
* @uses wp_remote_get()
|
||||||
|
*
|
||||||
|
* @param array $queryArgs Additional query arguments to append to the request. Optional.
|
||||||
|
* @return PluginInfo
|
||||||
|
*/
|
||||||
|
function requestInfo( $queryArgs = array() ) {
|
||||||
|
//Query args to append to the URL. Plugins can add their own by using a filter callback (see addQueryArgFilter()).
|
||||||
|
$queryArgs['installed_version'] = $this->getInstalledVersion();
|
||||||
|
$queryArgs = apply_filters( 'puc_request_info_query_args-' . $this->slug, $queryArgs );
|
||||||
|
|
||||||
|
//Various options for the wp_remote_get() call. Plugins can filter these, too.
|
||||||
|
$options = array(
|
||||||
|
'timeout' => 10, //seconds
|
||||||
|
'headers' => array(
|
||||||
|
'Accept' => 'application/json'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$options = apply_filters( 'puc_request_info_options-' . $this->slug, $options );
|
||||||
|
|
||||||
|
//The plugin info should be at 'http://your-api.com/url/here/$slug/info.json'
|
||||||
|
$url = $this->metadataUrl;
|
||||||
|
if ( ! empty( $queryArgs ) ){
|
||||||
|
$url = add_query_arg( $queryArgs, $url );
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = wp_remote_get(
|
||||||
|
$url,
|
||||||
|
$options
|
||||||
|
);
|
||||||
|
|
||||||
|
//Try to parse the response
|
||||||
|
$ft_premium_support_plugin_info = null;
|
||||||
|
if ( !is_wp_error( $result ) && isset( $result['response']['code'] ) && ( $result['response']['code'] == 200 ) && !empty( $result['body'] ) ){
|
||||||
|
$ft_premium_support_plugin_info = FT_Premium_Support_PluginInfo::fromJson( $result['body'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
$ft_premium_support_plugin_info = apply_filters( 'puc_request_info_result-' . $this->slug, $ft_premium_support_plugin_info, $result );
|
||||||
|
|
||||||
|
return $ft_premium_support_plugin_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the latest update (if any) from the configured API endpoint.
|
||||||
|
*
|
||||||
|
* @uses PluginUpdateChecker::requestInfo()
|
||||||
|
*
|
||||||
|
* @return PluginUpdate An instance of PluginUpdate, or NULL when no updates are available.
|
||||||
|
*/
|
||||||
|
function requestUpdate() {
|
||||||
|
//For the sake of simplicity, this function just calls requestInfo()
|
||||||
|
//and transforms the result accordingly.
|
||||||
|
$ft_premium_support_plugin_info = $this->requestInfo( array( 'checking_for_updates' => '1' ) );
|
||||||
|
|
||||||
|
if ( $ft_premium_support_plugin_info == null )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return FT_Premium_Support_PluginUpdate::fromPluginInfo( $ft_premium_support_plugin_info );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the currently installed version of the plugin.
|
||||||
|
*
|
||||||
|
* @return string Version number.
|
||||||
|
*/
|
||||||
|
function getInstalledVersion() {
|
||||||
|
|
||||||
|
if ( ! function_exists( 'get_plugins' ) )
|
||||||
|
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||||
|
|
||||||
|
$allPlugins = get_plugins();
|
||||||
|
|
||||||
|
if ( array_key_exists( $this->pluginFile, $allPlugins ) && array_key_exists( 'Version', $allPlugins[$this->pluginFile] ) )
|
||||||
|
return $allPlugins[$this->pluginFile]['Version'];
|
||||||
|
else
|
||||||
|
return ''; //This should never happen.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for plugin updates.
|
||||||
|
* The results are stored in the DB option specified in $optionName.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function checkForUpdates(){
|
||||||
|
$state = get_option( $this->optionName );
|
||||||
|
|
||||||
|
if ( empty($state) ){
|
||||||
|
$state = new StdClass;
|
||||||
|
$state->lastCheck = 0;
|
||||||
|
$state->checkedVersion = '';
|
||||||
|
$state->update = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$state->lastCheck = time();
|
||||||
|
$state->checkedVersion = $this->getInstalledVersion();
|
||||||
|
update_option( $this->optionName, $state ); //Save before checking in case something goes wrong
|
||||||
|
|
||||||
|
$state->update = $this->requestUpdate();
|
||||||
|
update_option( $this->optionName, $state );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for updates only if the configured check interval has already elapsed.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function maybeCheckForUpdates(){
|
||||||
|
|
||||||
|
if ( empty( $this->checkPeriod ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$state = get_option( $this->optionName );
|
||||||
|
|
||||||
|
$shouldCheck =
|
||||||
|
empty( $state ) ||
|
||||||
|
! isset( $state->lastCheck ) ||
|
||||||
|
( ( time() - $state->lastCheck ) >= $this->checkPeriod*3600 );
|
||||||
|
|
||||||
|
if ( $shouldCheck ){
|
||||||
|
$this->checkForUpdates();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intercept plugins_api() calls that request information about our plugin and
|
||||||
|
* use the configured API endpoint to satisfy them.
|
||||||
|
*
|
||||||
|
* @see plugins_api()
|
||||||
|
*
|
||||||
|
* @param mixed $result
|
||||||
|
* @param string $action
|
||||||
|
* @param array|object $args
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function injectInfo( $result, $action = null, $args = null ) {
|
||||||
|
|
||||||
|
$relevant = ( $action == 'plugin_information') && isset( $args->slug ) && ( $args->slug == $this->slug );
|
||||||
|
|
||||||
|
if ( !$relevant ){
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ft_premium_support_plugin_info = $this->requestInfo();
|
||||||
|
|
||||||
|
if ( $ft_premium_support_plugin_info )
|
||||||
|
return $ft_premium_support_plugin_info->toWpFormat();
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert the latest update (if any) into the update list maintained by WP.
|
||||||
|
*
|
||||||
|
* @param array $updates Update list.
|
||||||
|
* @return array Modified update list.
|
||||||
|
*/
|
||||||
|
function injectUpdate( $updates ){
|
||||||
|
|
||||||
|
$state = get_option( $this->optionName );
|
||||||
|
|
||||||
|
//Is there an update to insert?
|
||||||
|
if ( ! empty( $state ) && isset( $state->update ) && ! empty( $state->update ) ) {
|
||||||
|
|
||||||
|
//Only insert updates that are actually newer than the currently installed version.
|
||||||
|
if ( version_compare( $state->update->version, $this->getInstalledVersion(), '>' ) )
|
||||||
|
$updates->response[$this->pluginFile] = $state->update->toWpFormat();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $updates;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a callback for filtering query arguments.
|
||||||
|
*
|
||||||
|
* The callback function should take one argument - an associative array of query arguments.
|
||||||
|
* It should return a modified array of query arguments.
|
||||||
|
*
|
||||||
|
* @uses add_filter() This method is a convenience wrapper for add_filter().
|
||||||
|
*
|
||||||
|
* @param callback $callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function addQueryArgFilter( $callback ) {
|
||||||
|
add_filter( 'puc_request_info_query_args-' . $this->slug, $callback );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a callback for filtering arguments passed to wp_remote_get().
|
||||||
|
*
|
||||||
|
* The callback function should take one argument - an associative array of arguments -
|
||||||
|
* and return a modified array or arguments. See the WP documentation on wp_remote_get()
|
||||||
|
* for details on what arguments are available and how they work.
|
||||||
|
*
|
||||||
|
* @uses add_filter() This method is a convenience wrapper for add_filter().
|
||||||
|
*
|
||||||
|
* @param callback $callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function addHttpRequestArgFilter($callback) {
|
||||||
|
add_filter( 'puc_request_info_options-' . $this->slug, $callback );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a callback for filtering the plugin info retrieved from the external API.
|
||||||
|
*
|
||||||
|
* The callback function should take two arguments. If the plugin info was retrieved
|
||||||
|
* successfully, the first argument passed will be an instance of PluginInfo. Otherwise,
|
||||||
|
* it will be NULL. The second argument will be the corresponding return value of
|
||||||
|
* wp_remote_get (see WP docs for details).
|
||||||
|
*
|
||||||
|
* The callback function should return a new or modified instance of PluginInfo or NULL.
|
||||||
|
*
|
||||||
|
* @uses add_filter() This method is a convenience wrapper for add_filter().
|
||||||
|
*
|
||||||
|
* @param callback $callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function addResultFilter( $callback ) {
|
||||||
|
add_filter( 'puc_request_info_result-' . $this->slug, $callback, 10, 2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! class_exists( 'FT_Premium_Support_PluginInfo' ) ) :
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A container class for holding and transforming various plugin metadata.
|
||||||
|
*
|
||||||
|
* @author Janis Elsts
|
||||||
|
* @copyright 2010
|
||||||
|
* @version 1.0
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
class FT_Premium_Support_PluginInfo {
|
||||||
|
|
||||||
|
//Most fields map directly to the contents of the plugin's info.json file.
|
||||||
|
//See the relevant docs for a description of their meaning.
|
||||||
|
var $name;
|
||||||
|
var $slug;
|
||||||
|
var $version;
|
||||||
|
var $homepage;
|
||||||
|
var $sections;
|
||||||
|
var $download_url;
|
||||||
|
|
||||||
|
var $author;
|
||||||
|
var $author_homepage;
|
||||||
|
|
||||||
|
var $requires;
|
||||||
|
var $tested;
|
||||||
|
var $upgrade_notice;
|
||||||
|
|
||||||
|
var $rating;
|
||||||
|
var $num_ratings;
|
||||||
|
var $downloaded;
|
||||||
|
var $last_updated;
|
||||||
|
|
||||||
|
var $id = 0; //The native WP.org API returns numeric plugin IDs, but they're not used for anything.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance of PluginInfo from JSON-encoded plugin info
|
||||||
|
* returned by an external update API.
|
||||||
|
*
|
||||||
|
* @param string $json Valid JSON string representing plugin info.
|
||||||
|
* @return PluginInfo New instance of PluginInfo, or NULL on error.
|
||||||
|
*/
|
||||||
|
function fromJson( $json ){
|
||||||
|
$apiResponse = json_decode( $json );
|
||||||
|
if ( empty( $apiResponse ) || !is_object( $apiResponse ) )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
//Very, very basic validation.
|
||||||
|
$valid = isset( $apiResponse->name ) && ! empty( $apiResponse->name ) && isset( $apiResponse->version ) && ! empty( $apiResponse->version );
|
||||||
|
if ( ! $valid )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
$info = new FT_Premium_Support_PluginInfo();
|
||||||
|
foreach( get_object_vars( $apiResponse ) as $key => $value ) {
|
||||||
|
$info->$key = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform plugin info into the format used by the native WordPress.org API
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
function toWpFormat(){
|
||||||
|
$info = new StdClass;
|
||||||
|
|
||||||
|
//The custom update API is built so that many fields have the same name and format
|
||||||
|
//as those returned by the native WordPress.org API. These can be assigned directly.
|
||||||
|
$sameFormat = array(
|
||||||
|
'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice',
|
||||||
|
'num_ratings', 'downloaded', 'homepage', 'last_updated',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach( $sameFormat as $field ){
|
||||||
|
if ( isset( $this->$field ) )
|
||||||
|
$info->$field = $this->$field;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Other fields need to be renamed and/or transformed.
|
||||||
|
$info->download_link = $this->download_url;
|
||||||
|
|
||||||
|
if ( ! empty( $this->author_homepage ) )
|
||||||
|
$info->author = sprintf( '<a href="%s">%s</a>', $this->author_homepage, $this->author );
|
||||||
|
else
|
||||||
|
$info->author = $this->author;
|
||||||
|
|
||||||
|
if ( is_object( $this->sections ) ){
|
||||||
|
$info->sections = get_object_vars( $this->sections );
|
||||||
|
} elseif ( is_array( $this->sections ) ) {
|
||||||
|
$info->sections = $this->sections;
|
||||||
|
} else {
|
||||||
|
$info->sections = array( 'description' => '' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( ! class_exists( 'FT_Premium_Support_PluginUpdate' ) ):
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple container class for holding information about an available update.
|
||||||
|
*
|
||||||
|
* @author Janis Elsts
|
||||||
|
* @copyright 2010
|
||||||
|
* @version 1.0
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
class FT_Premium_Support_PluginUpdate {
|
||||||
|
|
||||||
|
var $id = 0;
|
||||||
|
var $slug;
|
||||||
|
var $version;
|
||||||
|
var $homepage;
|
||||||
|
var $download_url;
|
||||||
|
var $upgrade_notice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance of PluginUpdate from its JSON-encoded representation.
|
||||||
|
*
|
||||||
|
* @param string $json
|
||||||
|
* @return PluginUpdate
|
||||||
|
*/
|
||||||
|
function fromJson( $json ){
|
||||||
|
//Since update-related information is simply a subset of the full plugin info,
|
||||||
|
//we can parse the update JSON as if it was a plugin info string, then copy over
|
||||||
|
//the parts that we care about.
|
||||||
|
$ft_premium_support_plugin_info = FT_Premium_Support_PluginInfo::fromJson( $json );
|
||||||
|
if ( $ft_premium_support_plugin_info != null )
|
||||||
|
return FT_Premium_Support_PluginUpdate::fromPluginInfo( $ft_premium_support_plugin_info );
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance of PluginUpdate based on an instance of PluginInfo.
|
||||||
|
* Basically, this just copies a subset of fields from one object to another.
|
||||||
|
*
|
||||||
|
* @param PluginInfo $info
|
||||||
|
* @return PluginUpdate
|
||||||
|
*/
|
||||||
|
function fromPluginInfo( $info ){
|
||||||
|
|
||||||
|
$update = new FT_Premium_Support_PluginUpdate();
|
||||||
|
$copyFields = array( 'id', 'slug', 'version', 'homepage', 'download_url', 'upgrade_notice' );
|
||||||
|
foreach( $copyFields as $field ) {
|
||||||
|
$update->$field = $info->$field;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $update;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform the update into the format used by WordPress native plugin API.
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
function toWpFormat(){
|
||||||
|
|
||||||
|
$update = new StdClass;
|
||||||
|
|
||||||
|
$update->id = $this->id;
|
||||||
|
$update->slug = $this->slug;
|
||||||
|
$update->new_version = $this->version;
|
||||||
|
$update->url = $this->homepage;
|
||||||
|
$update->package = $this->download_url;
|
||||||
|
|
||||||
|
if ( ! empty( $this->upgrade_notice ) )
|
||||||
|
$update->upgrade_notice = $this->upgrade_notice;
|
||||||
|
|
||||||
|
return $update;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks for premium support
|
||||||
|
*/
|
||||||
|
function url_has_ftps_for_item( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && $ps_object->ps_status )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return paypal button
|
||||||
|
*/
|
||||||
|
function get_ftps_paypal_button( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->paypal_button ) )
|
||||||
|
return $ps_object->paypal_button;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return learn more link
|
||||||
|
*/
|
||||||
|
function get_ftps_learn_more_link( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->learn_more_link ) )
|
||||||
|
return $ps_object->learn_more_link;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return SSO key
|
||||||
|
*/
|
||||||
|
function get_ftps_sso_key( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->sso_status ) )
|
||||||
|
return $ps_object->sso_status;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this site URL that has premium support
|
||||||
|
*/
|
||||||
|
function get_ftps_site( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->ps_status->site ) )
|
||||||
|
return $ps_object->ps_status->site;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return purchase date
|
||||||
|
*/
|
||||||
|
function get_ftps_purchase_date( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->ps_status->purchase_date ) )
|
||||||
|
return $ps_object->ps_status->purchase_date;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return expiration date
|
||||||
|
*/
|
||||||
|
function get_ftps_exp_date( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->ps_status->exp_date ) )
|
||||||
|
return $ps_object->ps_status->exp_date;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return email of person who purchased premium support
|
||||||
|
*/
|
||||||
|
function get_ftps_email( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->ps_status->email ) )
|
||||||
|
return $ps_object->ps_status->email;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return name of person who purchased premium support
|
||||||
|
*/
|
||||||
|
function get_ftps_name( &$ps_object ) {
|
||||||
|
|
||||||
|
if ( is_object( $ps_object ) && isset( $ps_object->ps_status->name ) )
|
||||||
|
return $ps_object->ps_status->name;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
250
classes/help.php
Normal file
|
@ -0,0 +1,250 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_Help' ) ) {
|
||||||
|
class SM_Help {
|
||||||
|
// Prints the options page
|
||||||
|
function print_page(){
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
extract( $options );
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Title
|
||||||
|
$sm_page_title = 'SimpleMap: Premium Support';
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
$simple_map->show_toolbar( $sm_page_title );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div><p><?php _e( 'Jump to a section:', 'SimpleMap' ); ?> <a href="#displaying_your_map"><?php _e( 'Displaying Your Map', 'SimpleMap' ); ?></a> | <a href="#general_options"><?php _e( 'General Options', 'SimpleMap' ); ?></a> | <a href="#adding_a_location"><?php _e( 'Adding a Location', 'SimpleMap' ); ?></a> | <a href="#everything_else"><?php _e( 'Everything Else', 'SimpleMap' ); ?></a></p></div>
|
||||||
|
|
||||||
|
<div id="dashboard-widgets-wrap" class="clear">
|
||||||
|
|
||||||
|
<div id='dashboard-widgets' class='metabox-holder'>
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%;'>
|
||||||
|
|
||||||
|
<div id='normal-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<a name="premium_features"></a>
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Premium Features', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'Custom category markers can now be used. Login to Premium support and look for the KB article for instructions.', 'SimpleMap' ); ?></td></tr>
|
||||||
|
<tr><td><?php _e( 'We now have a search widget. Login to Premium support and look for the KB article for instructions.', 'SimpleMap' ); ?></td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
<a name="displaying_your_map"></a>
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Displaying Your Map', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'To show your map on any post or page, insert the shortcode in the body:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'If you want only certain categories or tags to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories and tags:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap categories=2,5,14 tags=3,6,15]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'If you want to hide the category or tag filters on the search form, insert shortcode like this:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap show_categories_filter=false show_tags_filter=false]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'If you want to hide the map, insert shortcode like this:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap hide_map=true]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'If you want to hide the list of results, insert shortcode like this:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap hide_list=true]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'If you want to override the default lat / lng for a specific map, insert shortcode like this:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap default_lat='34.1346702' default_lng='-118.4389877']</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'You can combine tag attributes as needed:', 'SimpleMap' ); ?> <code style="font-size: 1.2em; background: #ffffe0;">[simplemap categories=2,5,14 show_tags_filter=false]</code></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php _e( 'You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme).', 'SimpleMap' ); ?></td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php printf( __( 'Configure the appearance of your map on the %s General Options page.%s', 'SimpleMap'), '<a href="' . esc_url( admin_url( 'admin.php?page=simplemap' ) ) . '">', '</a>' ); ?></td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
<a name="general_options"></a>
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'General Options', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><strong><?php _e( 'Starting Location', 'SimpleMap' ); ?></strong></td>
|
||||||
|
<td><?php _e( 'Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press "Geocode Address."', 'SimpleMap' ); ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><strong><?php _e('Auto-Load Database', 'SimpleMap'); ?></strong></td>
|
||||||
|
<td>
|
||||||
|
<?php printf( __( '%s No auto-load:%s Locations will not load automatically.', 'SimpleMap' ), '<strong>', '</strong>'); ?><br />
|
||||||
|
<?php printf( __( '%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set.', 'SimpleMap' ), '<strong>', '</strong>' ); ?><br />
|
||||||
|
<?php printf( __( '%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s', 'SimpleMap' ), '<strong>', '</strong>', '<em>', '</em>' ); ?><br /><br />
|
||||||
|
|
||||||
|
<?php _e( 'If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading.', 'SimpleMap' ); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><strong><?php _e( 'Special Location Label', 'SimpleMap' ); ?></strong></td>
|
||||||
|
<td><?php _e( 'This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for "Favorite Spots," or "Free Wi-Fi," or anything you want. You can also leave it blank to disable it.', 'SimpleMap' ); ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
<a name="adding_a_location"></a>
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Adding a Location', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr><td>
|
||||||
|
<?php _e( 'To properly add a new location, you must enter one or both of the following:', 'SimpleMap' ); ?><br />
|
||||||
|
<span style="padding-left: 20px;"><?php _e( '1. A full address', 'SimpleMap'); ?></span><br />
|
||||||
|
<span style="padding-left: 20px;"><?php _e( '2. A latitude and longitude', 'SimpleMap' ); ?></span><br />
|
||||||
|
<?php _e( 'If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database.', 'SimpleMap' ); ?>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
|
<tr><td>
|
||||||
|
<?php _e( 'You must also enter a name for every location.', 'SimpleMap' ); ?>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
</div> <!-- meta-box-sortables -->
|
||||||
|
|
||||||
|
</div> <!-- postbox-container -->
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%;'>
|
||||||
|
|
||||||
|
<div id='side-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-help-side-sortables-top' ); ?>
|
||||||
|
|
||||||
|
<!-- #### PREMIUM SUPPORT #### -->
|
||||||
|
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3 style='color:#fff;text-shadow:0 1px 0 #000;background: #fff url( <?php echo SIMPLEMAP_URL; ?>/inc/images/blue-grad.png ) top left repeat-x;'><?php _e( 'Premium Support and Features', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style='padding: 0pt 10px 10px;' >
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Check for premium support status
|
||||||
|
global $simplemap_ps;
|
||||||
|
|
||||||
|
if ( ! url_has_ftps_for_item( $simplemap_ps ) ) : ?>
|
||||||
|
|
||||||
|
<h4><?php printf( __( 'SimpleMap Premium Support Benefits', 'SimpleMap' ), esc_attr( site_url() ) ); ?></h4>
|
||||||
|
<p>
|
||||||
|
<?php printf( __( 'SimpleMap now offers a premium support package for the low cost of %s per year per domain.', 'SimpleMap' ), '$30.00 USD' ); ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?php _e( 'By signing up for SimpleMap premium support, you help to ensure future enhancements to this excellent project as well as the following benefits:', 'SimpleMap' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:disc'>
|
||||||
|
<li><?php _e( 'Around the clock access to our extensive knowledge base and support forum from within your WordPress dashboard', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'Professional and timely response times to all your questions from the SimpleMap team', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 10% discount for any custom functionality you request from the SimpleMap developers', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 6-12 month advance access to new features integrated into the auto upgrade functionality of WordPress', 'SimpleMap' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:none'>
|
||||||
|
<li><a href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'SimpleMap' ); ?></a></li>
|
||||||
|
<li><a target='_blank' href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'SimpleMap' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<p class='howto'><?php printf( "Your premium support for <code>%s</code> was purchased on <code>%s</code> by <code>%s</code> (%s). It will remain valid for this URL until <code>%s</code>.", get_ftps_site( $simplemap_ps ), date( "F d, Y", get_ftps_purchase_date( $simplemap_ps ) ), get_ftps_name( $simplemap_ps ), get_ftps_email( $simplemap_ps ), date( "F d, Y", get_ftps_exp_date( $simplemap_ps ) ) ); ?></p>
|
||||||
|
<p><a href='#' id='premium_help'><?php _e( 'Launch Premium Support widget', 'SimpleMap' ); ?></a> | <a target="blank" href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'SimpleMap' );?></a></p>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
Tender = {
|
||||||
|
hideToggle: true,
|
||||||
|
sso: "<?php echo get_ftps_sso_key( $simplemap_ps ); ?>",
|
||||||
|
widgetToggles: [document.getElementById('premium_help')]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="https://simplemap.tenderapp.com/tender_widget.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<?php do_action( 'sm-help-side-sortables-bottom' ); ?>
|
||||||
|
|
||||||
|
</div> <!-- meta-box-sortables -->
|
||||||
|
</div> <!-- postbox-container -->
|
||||||
|
|
||||||
|
</div> <!-- dashboard-widgets -->
|
||||||
|
|
||||||
|
<div class="clear">
|
||||||
|
</div>
|
||||||
|
</div><!-- dashboard-widgets-wrap -->
|
||||||
|
</div> <!-- wrap -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
803
classes/import-export.php
Normal file
|
@ -0,0 +1,803 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_Import_Export' ) ){
|
||||||
|
class SM_Import_Export{
|
||||||
|
|
||||||
|
// update options of form submission
|
||||||
|
function sm_import_export() {
|
||||||
|
//add_action( 'admin_init', array( &$this, 'import_csv' ) );
|
||||||
|
add_action( 'admin_init', array( &$this, 'export_csv' ) );
|
||||||
|
add_action( 'admin_init', array( &$this, 'export_legacy_csv' ) );
|
||||||
|
add_action( 'admin_init', array( &$this, 'delete_legacy_tables' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exports a CSV file to WordPress
|
||||||
|
function export_csv() {
|
||||||
|
global $simple_map, $sm_locations;
|
||||||
|
|
||||||
|
if ( isset( $_POST['sm-action'] ) && 'export-csv' == $_POST['sm-action'] ) {
|
||||||
|
// Grab locations
|
||||||
|
$content = array();
|
||||||
|
set_time_limit( 0 );
|
||||||
|
$locations = query_posts( array( 'post_status' => 'publish', 'post_type' => 'sm-location', 'posts_per_page' => -1 ) );
|
||||||
|
// Include CSV library
|
||||||
|
require_once( SIMPLEMAP_PATH . '/classes/parsecsv.lib.php' );
|
||||||
|
$taxonomies = get_object_taxonomies( 'sm-location' );
|
||||||
|
|
||||||
|
foreach ( $locations as $key => $location ) {
|
||||||
|
$location_data = array(
|
||||||
|
'name' => esc_attr( $location->post_title ),
|
||||||
|
'address' => esc_attr( get_post_meta( $location->ID, 'location_address', true ) ),
|
||||||
|
'address2' => esc_attr( get_post_meta( $location->ID, 'location_address2', true ) ),
|
||||||
|
'city' => esc_attr( get_post_meta( $location->ID, 'location_city', true ) ),
|
||||||
|
'state' => esc_attr( get_post_meta( $location->ID, 'location_state', true ) ),
|
||||||
|
'zip' => esc_attr( get_post_meta( $location->ID, 'location_zip', true ) ),
|
||||||
|
'country' => esc_attr( get_post_meta( $location->ID, 'location_country', true ) ),
|
||||||
|
'phone' => esc_attr( get_post_meta( $location->ID, 'location_phone', true ) ),
|
||||||
|
'email' => esc_attr( get_post_meta( $location->ID, 'location_email', true ) ),
|
||||||
|
'fax' => esc_attr( get_post_meta( $location->ID, 'location_fax', true ) ),
|
||||||
|
'url' => esc_attr( get_post_meta( $location->ID, 'location_url', true ) ),
|
||||||
|
'description' => esc_attr( $location->post_content ),
|
||||||
|
'special' => esc_attr( get_post_meta( $location->ID, 'location_special', true ) ),
|
||||||
|
'lat' => esc_attr( get_post_meta( $location->ID, 'location_lat', true ) ),
|
||||||
|
'lng' => esc_attr( get_post_meta( $location->ID, 'location_lng', true ) ),
|
||||||
|
'dateUpdated' => esc_attr( $location->post_modified )
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ( $taxonomies as $tax ) {
|
||||||
|
$term_value = '';
|
||||||
|
if ( $terms = wp_get_object_terms( $location->ID, $tax, array( 'fields' => 'names' ) ) ) {
|
||||||
|
$term_value = implode( ',', $terms );
|
||||||
|
}
|
||||||
|
$location_data["tax_$tax"] = esc_attr( $term_value );
|
||||||
|
}
|
||||||
|
|
||||||
|
$content[] = $location_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $content ) ) {
|
||||||
|
$csv = new smParseCSV();
|
||||||
|
$csv->output( true, 'simplemap.csv', $content, array_keys( reset( $content ) ) );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exports a LEGACY SimpleMap CSV file to WordPress
|
||||||
|
function export_legacy_csv() {
|
||||||
|
global $simple_map, $sm_locations,$wpdb;
|
||||||
|
|
||||||
|
if ( isset( $_GET['sm-action'] ) && 'export-legacy-csv' == $_GET['sm-action'] ) {
|
||||||
|
|
||||||
|
// Include CSV library
|
||||||
|
include_once( SIMPLEMAP_PATH . '/classes/parsecsv.lib.php' );
|
||||||
|
|
||||||
|
// Grab Categories
|
||||||
|
if ( $categories = $wpdb->get_results( "SELECT * FROM `" . $wpdb->prefix . "simple_map_cats`" ) ) {
|
||||||
|
foreach ( $categories as $key => $value ) {
|
||||||
|
$cats[$value->id] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Grab locations
|
||||||
|
if ( $locations = $wpdb->get_results( "SELECT * FROM `" . $wpdb->prefix . "simple_map`" ) ) {
|
||||||
|
|
||||||
|
foreach( $locations as $key => $location ) {
|
||||||
|
|
||||||
|
$catnames = '';
|
||||||
|
|
||||||
|
// Do Cats
|
||||||
|
if ( isset( $location->category ) && 0 != $location->category ) {
|
||||||
|
if ( isset( $cats[$location->category] ) )
|
||||||
|
$catnames = $cats[$location->category]->name;
|
||||||
|
}
|
||||||
|
$content[] = array(
|
||||||
|
'name' => esc_attr( $location->name ),
|
||||||
|
'address' => esc_attr( $location->address ),
|
||||||
|
'address2' => esc_attr( $location->address2 ),
|
||||||
|
'city' => esc_attr( $location->city ),
|
||||||
|
'state' => esc_attr( $location->state ),
|
||||||
|
'zip' => esc_attr( $location->zip ),
|
||||||
|
'country' => esc_attr( $location->country ),
|
||||||
|
'phone' => esc_attr( $location->phone ),
|
||||||
|
'fax' => esc_attr( $location->fax ),
|
||||||
|
'url' => esc_attr( $location->url ),
|
||||||
|
'description' => esc_attr( $location->description ),
|
||||||
|
'category' => esc_attr( $catnames ),
|
||||||
|
'tags' => esc_attr( $location->tags ),
|
||||||
|
'special' => esc_attr( $location->special ),
|
||||||
|
'lat' => esc_attr( $location->lat ),
|
||||||
|
'lng' => esc_attr( $location->lng ),
|
||||||
|
'dateUpdated' => esc_attr( $location->dateUpdated )
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$csv = new smParseCSV();
|
||||||
|
$csv->output (true, 'simplemap.csv', $content, array('name','address','address2','city','state','zip','country','phone','fax','url','description','category','tags','special','lat','lng','dateUpdated' ) );
|
||||||
|
die();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$csv = new smParseCSV();
|
||||||
|
$csv->output (true, 'simplemap.csv', array( array( 'You have no locations in your legacy database' ) ) );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deletes legacy tables
|
||||||
|
function delete_legacy_tables() {
|
||||||
|
global $wpdb, $simple_map;
|
||||||
|
|
||||||
|
if ( isset( $_GET['sm-action'] ) && 'delete-legacy-simplemap' == $_GET['sm-action'] ) {
|
||||||
|
|
||||||
|
// Confirm we have both permisssion to do this and we have intent to do this.
|
||||||
|
if ( current_user_can( 'manage_options' ) && check_admin_referer( 'delete-legacy-simplemap' ) ) {
|
||||||
|
|
||||||
|
$drop_sm = 'DROP TABLE `' . $wpdb->prefix. 'simple_map`;';
|
||||||
|
$drop_cats = 'DROP TABLE `' . $wpdb->prefix . 'simple_map_cats`;';
|
||||||
|
|
||||||
|
$wpdb->query( $drop_sm );
|
||||||
|
$wpdb->query( $drop_cats );
|
||||||
|
|
||||||
|
if ( $simple_map->legacy_tables_exist() ) {
|
||||||
|
wp_redirect( admin_url( 'admin.php?page=simplemap-import-export&sm-msg=3' ) );
|
||||||
|
die();
|
||||||
|
} else {
|
||||||
|
wp_redirect( admin_url( 'admin.php?page=simplemap-import-export&sm-msg=2' ) );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// All location data
|
||||||
|
function get_location_data_types( $init = array() ) {
|
||||||
|
static $types = null;
|
||||||
|
|
||||||
|
if ( empty( $types ) ) {
|
||||||
|
$types = array(
|
||||||
|
'name' => __( 'Name', 'SimpleMap' ),
|
||||||
|
'address' => __( 'Address', 'SimpleMap' ),
|
||||||
|
'address2' => __( 'Address 2', 'SimpleMap' ),
|
||||||
|
'city' => __( 'City', 'SimpleMap' ),
|
||||||
|
'state' => __( 'State', 'SimpleMap' ),
|
||||||
|
'zip' => __( 'Zip', 'SimpleMap' ),
|
||||||
|
'country' => __( 'Country', 'SimpleMap' ),
|
||||||
|
'phone' => __( 'Phone', 'SimpleMap' ),
|
||||||
|
'fax' => __( 'Fax', 'SimpleMap' ),
|
||||||
|
'email' => __( 'Email', 'SimpleMap' ),
|
||||||
|
'url' => __( 'URL', 'SimpleMap' ),
|
||||||
|
'description' => __( 'Description', 'SimpleMap' ),
|
||||||
|
'special' => __( 'Special', 'SimpleMap' ),
|
||||||
|
'lat' => __( 'Lat', 'SimpleMap' ),
|
||||||
|
'lng' => __( 'Lng', 'SimpleMap' ),
|
||||||
|
);
|
||||||
|
|
||||||
|
$legacy_types = array(
|
||||||
|
'category' => __( 'Legacy Taxonomy: Categories', 'SimpleMap' ),
|
||||||
|
'tags' => __( 'Legacy Taxonomy: Tags', 'SimpleMap' ),
|
||||||
|
'days' => __( 'Legacy Taxonomy: Days', 'SimpleMap' ),
|
||||||
|
'times' => __( 'Legacy Taxonomy: Times', 'SimpleMap' ),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ( get_object_taxonomies( 'sm-location', 'objects' ) as $taxonomy => $tax_info ) {
|
||||||
|
$types['tax_' . $taxonomy] = __( 'Taxonomy: ' . $tax_info->label, 'SimpleMap' );
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $init as $key => $value ) {
|
||||||
|
if ( substr( $key, 0, 4 ) === 'tax_' ) {
|
||||||
|
$types[$key] = __( 'Taxonomy: ' . ucwords( substr( $key, strpos( $key, '-' ) + 1 ) ), 'SimpleMap' );
|
||||||
|
} elseif ( isset( $legacy_types[$key] ) ) {
|
||||||
|
$types[$key] = $legacy_types[$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$types = apply_filters( 'sm-data-types', $types );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Imports a CSV file to WordPress
|
||||||
|
function import_csv() {
|
||||||
|
global $simple_map, $sm_locations, $wpdb, $current_user, $blog_id;
|
||||||
|
|
||||||
|
// Define Importing Constant
|
||||||
|
define( 'WP_IMPORTING', true );
|
||||||
|
|
||||||
|
if ( isset( $_POST['sm-action'] ) && 'import-csv' == $_POST['sm-action'] && isset( $_POST['step'] ) && 2 == $_POST['step'] ) {
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Title
|
||||||
|
$sm_page_title = apply_filters( 'sm-import-export-page-title', 'SimpleMap: Import. Step One' );
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
$simple_map->show_toolbar( $sm_page_title );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="dashboard-widgets-wrap" class="clear">
|
||||||
|
|
||||||
|
<div id="dashboard-widgets" class="metabox-holder">
|
||||||
|
|
||||||
|
<div class="postbox-container" >
|
||||||
|
|
||||||
|
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
|
||||||
|
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e('CSV Import: Step Two: Importing CSV', 'SimpleMap'); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Include CSV library
|
||||||
|
require_once( SIMPLEMAP_PATH . '/classes/parsecsv.lib.php' );
|
||||||
|
|
||||||
|
$file_location = WP_PLUGIN_DIR . '/sm-temp-csv-' . $blog_id . '.csv';
|
||||||
|
|
||||||
|
if ( file_exists( $file_location ) && $csv = new smParseCSV() ) {
|
||||||
|
$csv->auto( $file_location );
|
||||||
|
|
||||||
|
if ( isset( $csv->data ) ) {
|
||||||
|
echo '<ol style="list-style-type:decimal">';
|
||||||
|
|
||||||
|
/* We're going to do some pre-processing to prevent WP's wp_get_unique_slug from pinging the database
|
||||||
|
* a ridiculous amount of times in the event that this file is importing several thousand locations with
|
||||||
|
* same name (like a franchise).
|
||||||
|
*/
|
||||||
|
$post_names = array();
|
||||||
|
|
||||||
|
$taxes = $simple_map->get_taxonomy_settings();
|
||||||
|
foreach ( $taxes as $taxonomy => $tax_info ) {
|
||||||
|
$taxes[$taxonomy] = $tax_info['field'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$types = $this->get_location_data_types( current( $csv->data ) );
|
||||||
|
$columns = array();
|
||||||
|
foreach ( $types as $key => $value ) {
|
||||||
|
$taxonomy = null;
|
||||||
|
|
||||||
|
// If custom taxonomies don't exist, register them temporarily in the event that we need to import them.
|
||||||
|
if ( substr( $key, 0, 7 ) === 'tax_sm-' ) {
|
||||||
|
$taxonomy = substr( $key, 4 );
|
||||||
|
$taxes[$taxonomy] = $key;
|
||||||
|
}
|
||||||
|
// Allow legacy taxonomy column names
|
||||||
|
elseif ( array_search( $key, $taxes ) ) {
|
||||||
|
$taxonomy = $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $taxonomy ) ) {
|
||||||
|
$sm_locations->register_location_taxonomy( $taxonomy, $simple_map->get_taxonomy_settings( $taxonomy ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
$columns[$key] = str_replace( 'col_', '', array_search( $key, $_POST ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
$active_taxes = get_object_taxonomies( 'sm-location' );
|
||||||
|
$taxes = array_intersect_key( $taxes, array_flip( $active_taxes ) );
|
||||||
|
|
||||||
|
foreach ( $csv->data as $row => $location ) {
|
||||||
|
// Give me 20 seconds for each location. That should be more than enough time.
|
||||||
|
set_time_limit ( 20 );
|
||||||
|
|
||||||
|
// Convert assoc to int array since I can't trust the headings from the user
|
||||||
|
$location = array_values( $location );
|
||||||
|
|
||||||
|
// Use the information the user gave me via select boxes to map columns to correct attributes
|
||||||
|
foreach ( $columns as $key => $column ) {
|
||||||
|
if ( isset( $location[$column] ) ) {
|
||||||
|
$to_insert[$key] = trim( $location[$column] );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$to_insert[$key] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine legacy taxonomy fields into new taxonomy fields.
|
||||||
|
$legacy_taxes = $simple_map->get_taxonomy_settings();
|
||||||
|
foreach ( $legacy_taxes as $taxonomy => $legacy_taxonomy ) {
|
||||||
|
$old_key = $legacy_taxonomy['field'];
|
||||||
|
$key = 'tax_' . $taxonomy;
|
||||||
|
if ( isset( $to_insert[$old_key] ) ) {
|
||||||
|
$to_insert += array( $key => '' );
|
||||||
|
$to_insert[$key] = implode( ',', array_filter( array( $to_insert[$key], $to_insert[$old_key] ) ) );
|
||||||
|
unset( $to_insert[$old_key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prep and insert
|
||||||
|
if ( isset( $to_insert ) ) {
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
$geocoded = '';
|
||||||
|
|
||||||
|
// Maybe geo encode
|
||||||
|
if ( ( empty( $to_insert['lat'] ) || empty( $to_insert['lng'] ) ) ) {
|
||||||
|
if ( $geo = $simple_map->geocode_location( $to_insert['address'], $to_insert['city'], $to_insert['state'], $to_insert['zip'], $to_insert['country'], '' ) ) {
|
||||||
|
$geocoded = __( 'geocoded and ', 'SimpleMap' );
|
||||||
|
|
||||||
|
if ( isset( $geo['lat'] ) ) {
|
||||||
|
$to_insert['lat'] = $geo['lat'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $geo['lng'] ) ) {
|
||||||
|
$to_insert['lng'] = $geo['lng'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent dup names before getting to wp_unique_slug function
|
||||||
|
$clean_name = sanitize_title( $to_insert['name'] );
|
||||||
|
|
||||||
|
// Start by check to see if this post's name has been used before
|
||||||
|
if ( isset( $post_names[$clean_name] ) ) {
|
||||||
|
|
||||||
|
// Set the int to the value of the post_name key (this is set the first time we import a post with this title).
|
||||||
|
$post_names_int = $post_names[$clean_name];
|
||||||
|
|
||||||
|
// Just to be safe, lets make sure the incremented name doesn't exist. Loop till we find one available.
|
||||||
|
while( isset( $post_names[$clean_name . '-' . $post_names_int] ) ) {
|
||||||
|
$post_names_int++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the new unique slug
|
||||||
|
$unique_title = $clean_name . '-' . $post_names_int;
|
||||||
|
|
||||||
|
// Add the post_name to the post attributes array we're about to insert
|
||||||
|
$vars['post_name'] = $unique_title;
|
||||||
|
|
||||||
|
// Update the original slug for this title with the new int
|
||||||
|
$post_names[$clean_name] = $post_names[$unique_title] = $post_names_int;
|
||||||
|
} else {
|
||||||
|
// If we made it here, its the first time we're inserting a post with this title (this import anyway).
|
||||||
|
// Add it to the post attributes array we're about to send to wp_insert_post
|
||||||
|
$vars['post_name'] = $clean_name;
|
||||||
|
|
||||||
|
// Log this title as used in the post_names array with an int of 1
|
||||||
|
$post_names[$clean_name] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prep for WordPress function
|
||||||
|
wp_get_current_user();
|
||||||
|
$vars['post_title'] = $to_insert['name'];
|
||||||
|
$vars['post_author'] = $current_user->ID;
|
||||||
|
$vars['post_type'] = 'sm-location';
|
||||||
|
$vars['post_status'] = 'publish';
|
||||||
|
$vars['post_content'] = $to_insert['description'];
|
||||||
|
|
||||||
|
// Insert into WordPress post table
|
||||||
|
if ( $id = wp_insert_post( $vars ) ) {
|
||||||
|
update_post_meta( $id, 'location_address', $to_insert['address'] );
|
||||||
|
update_post_meta( $id, 'location_address2', $to_insert['address2'] );
|
||||||
|
update_post_meta( $id, 'location_city', $to_insert['city'] );
|
||||||
|
update_post_meta( $id, 'location_state', $to_insert['state'] );
|
||||||
|
update_post_meta( $id, 'location_zip', $to_insert['zip'] );
|
||||||
|
update_post_meta( $id, 'location_country', $to_insert['country'] );
|
||||||
|
update_post_meta( $id, 'location_phone', $to_insert['phone'] );
|
||||||
|
update_post_meta( $id, 'location_fax', $to_insert['fax'] );
|
||||||
|
update_post_meta( $id, 'location_email', $to_insert['email'] );
|
||||||
|
update_post_meta( $id, 'location_url', $to_insert['url'] );
|
||||||
|
update_post_meta( $id, 'location_special', $to_insert['special'] );
|
||||||
|
update_post_meta( $id, 'location_lat', $to_insert['lat'] );
|
||||||
|
update_post_meta( $id, 'location_lng', $to_insert['lng'] );
|
||||||
|
|
||||||
|
foreach ( $taxes as $taxonomy => $tax_field ) {
|
||||||
|
if ( isset( $to_insert[$tax_field] ) ) {
|
||||||
|
// Place comma separated values into array
|
||||||
|
$terms = explode( ',', $to_insert[$tax_field] );
|
||||||
|
|
||||||
|
// Loop through array. If term does not exist, create it.
|
||||||
|
// Then associate the term with the location.
|
||||||
|
foreach ( (array) $terms as $key => $name ) {
|
||||||
|
$name = trim( $name );
|
||||||
|
|
||||||
|
// Skip it if we have bad data
|
||||||
|
if ( empty( $name ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grab or create and grab the category ID
|
||||||
|
if ( $term_obj = get_term_by( 'name', $name, $taxonomy ) ) {
|
||||||
|
$term_id = $term_obj->term_id;
|
||||||
|
} else {
|
||||||
|
$term_array = wp_insert_term( $name, $taxonomy );
|
||||||
|
if ( is_wp_error( $term_array ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$term_id = $term_array['term_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is just a failsafe. It also gives us access to vars the WP API created rather than from the CSV
|
||||||
|
if ( ! is_wp_error( $term_id ) && $term = get_term( (int) $term_id, $taxonomy ) ) {
|
||||||
|
if ( ! is_wp_error( $term ) ) {
|
||||||
|
// Associate (last var appends term to rather than replaces existing terms)
|
||||||
|
wp_set_object_terms( $id, $term->name, $taxonomy, true );
|
||||||
|
unset( $term );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<li>" . sprintf( esc_attr( $to_insert['name'] ) . __( ' was successfully %simported', 'SimpleMap' ), $geocoded ) . "</li>";
|
||||||
|
} else {
|
||||||
|
echo "<li>" . esc_attr( $to_insert['name'] ) . __( ' failed to import properly', 'SimpleMap' ) . "</li>";
|
||||||
|
}
|
||||||
|
|
||||||
|
unset( $to_insert );
|
||||||
|
unset( $geocoded );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</ul>";
|
||||||
|
echo "<h2>" . sprintf( __( 'View them <a href="%s">here</a>', 'SimpleMap' ), admin_url( 'edit.php?post_type=sm-location' ) ) . "</h2>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Import is finished, delete csv and redirect to edit locaitons page
|
||||||
|
if ( file_exists( $file_location ) ) {
|
||||||
|
unlink( $file_location );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates the CSV Preview
|
||||||
|
function do_csv_preview() {
|
||||||
|
global $simple_map, $blog_id;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ( !isset( $options['api_key'] ) )
|
||||||
|
$options['api_key'] = '';
|
||||||
|
*/
|
||||||
|
|
||||||
|
extract( $options );
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Title
|
||||||
|
$sm_page_title = apply_filters( 'sm-import-export-page-title', 'SimpleMap: Import. Step One' );
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
$simple_map->show_toolbar( $sm_page_title );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="dashboard-widgets-wrap" class="clear">
|
||||||
|
|
||||||
|
<div id='dashboard-widgets' class='metabox-holder'>
|
||||||
|
|
||||||
|
<div class='postbox-container' >
|
||||||
|
|
||||||
|
<div id='normal-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e('CSV Import: Step One', 'SimpleMap'); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<p class='howto'><?php printf( __( 'The first step is to confirm that we importing the data correctly. %sPlease match the following sample data%s from your CSV to the correct data type by selecting an attributes form the downdown boxes.', 'SimpleMap' ), '<strong><span style="color:red;">', '</span></strong>' );?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Include CSV library
|
||||||
|
include_once( SIMPLEMAP_PATH . '/classes/parsecsv.lib.php' );
|
||||||
|
|
||||||
|
$file_location = WP_PLUGIN_DIR . '/sm-temp-csv-'. $blog_id . '.csv';
|
||||||
|
if ( move_uploaded_file( $_FILES['simplemap-csv-upload']['tmp_name'], $file_location ) ) {
|
||||||
|
if ( $csv = new smParseCSV( $file_location ) ) {
|
||||||
|
?>
|
||||||
|
<form action="" method="post">
|
||||||
|
<input type="hidden" name="sm-action" value="import-csv" />
|
||||||
|
<input type="hidden" name="step" value="2" />
|
||||||
|
<p><input type="submit" class="button-primary" value="<?php _e( 'Import CSV', 'SimpleMap' ); ?>" /> | <a href=''><?php _e( 'Cancel', 'SimpleMap' ); ?></a></p>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<?php
|
||||||
|
$this->get_location_data_types( current($csv->data) );
|
||||||
|
foreach( $csv->titles as $col => $title ) {
|
||||||
|
echo "<td>" . $this->column_select( $col, $title ) . "</td>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</form>
|
||||||
|
</tr>
|
||||||
|
<?php // Grab some random rows to display as a sample
|
||||||
|
$row_count = count( $csv->data );
|
||||||
|
if ( $row_count < 50 ) {
|
||||||
|
foreach( $csv->data as $csv_row => $csv_row_data ) {
|
||||||
|
?><tr><?php
|
||||||
|
foreach ( $csv_row_data as $td => $tdv ) {
|
||||||
|
?><td><?php echo esc_attr( $tdv ); ?></td><?php
|
||||||
|
}
|
||||||
|
?></tr><?php
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for( $i=0;$i<=50;$i++ ) {
|
||||||
|
$numb = rand( 1, $row_count -1 );
|
||||||
|
?><tr><?php
|
||||||
|
foreach ( $csv->data[$numb] as $td => $tdv ) {
|
||||||
|
?><td><?php echo esc_attr( $tdv ); ?></td><?php
|
||||||
|
}
|
||||||
|
?></tr><?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_e( sprintf( 'Please make the following directory <a href="%s">writable by WordPress</a>: %s', 'http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress', '<code>' . WP_PLUGIN_DIR . '</code>' ), 'SimpleMap' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function creates a select box of all my data types to assign to this column
|
||||||
|
function column_select( $col, $title ) {
|
||||||
|
$select = "<select name='col_" . esc_attr( $col ) . "'>";
|
||||||
|
|
||||||
|
$select .= "<option value='-1' >Don't Import</option>";
|
||||||
|
|
||||||
|
|
||||||
|
foreach( $this->get_location_data_types() as $type => $label ) {
|
||||||
|
$select .= "<option value='" . $type . "' " . selected( trim( $type ), trim( $title ), false ) . " >" . $label . "</option>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$select .= "</select>";
|
||||||
|
|
||||||
|
return $select;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prints the options page
|
||||||
|
function print_page() {
|
||||||
|
if ( isset( $_POST['sm-action'] ) && 'import-csv' == $_POST['sm-action'] ) {
|
||||||
|
$step = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : 1;
|
||||||
|
|
||||||
|
// Check for uploaded file with no errors.
|
||||||
|
if ( ( 1 == $step && isset( $_FILES['simplemap-csv-upload'] ) && ! $_FILES['simplemap-csv-upload']['error'] > 0 ) || 2 == $step ) {
|
||||||
|
|
||||||
|
switch( $step ) {
|
||||||
|
case 2:
|
||||||
|
$this->import_csv();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
default :
|
||||||
|
$this->do_csv_preview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ( !isset( $options['api_key'] ) )
|
||||||
|
$options['api_key'] = '';
|
||||||
|
*/
|
||||||
|
|
||||||
|
extract( $options );
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Title
|
||||||
|
$sm_page_title = apply_filters( 'sm-import-export-page-title', 'SimpleMap: Import/Export CSV' );
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
$simple_map->show_toolbar( $sm_page_title );
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
if ( isset( $_GET['sm-msg'] ) && '2' == $_GET['sm-msg'] )
|
||||||
|
echo '<div class="updated fade"><p>'.__('Legacy SimpleMap settings deleted.', 'SimpleMap').'</p></div>';
|
||||||
|
|
||||||
|
if ( isset( $_GET['sm-msg'] ) && '3' == $_GET['sm-msg'] )
|
||||||
|
echo '<div class="error fade"><p>'.__('Legacy SimpleMap NOT settings deleted.', 'SimpleMap').'</p></div>';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="dashboard-widgets-wrap" class="clear">
|
||||||
|
|
||||||
|
<div id='dashboard-widgets' class='metabox-holder'>
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%'>
|
||||||
|
|
||||||
|
<div id='normal-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e('Import From File', 'SimpleMap'); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 0 10px 10px 10px;">
|
||||||
|
|
||||||
|
<h4><?php _e('If your file has fewer than 100 records and does not have latitude/longitude data:', 'SimpleMap'); ?></h4>
|
||||||
|
|
||||||
|
<p><?php _e('Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:', 'SimpleMap'); ?></p>
|
||||||
|
|
||||||
|
<p><em style="color: #777; font: italic 1.1em Georgia;"><?php _e('Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Days, Times, Description, Special (1 or 0), Latitude, Longitude', 'SimpleMap'); ?></em></p>
|
||||||
|
|
||||||
|
<p><?php _e('You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( \' ) or double ( " ) quotation marks will work.', 'SimpleMap') ?></p>
|
||||||
|
|
||||||
|
<h4><?php _e('If your file has more than 100 records:', 'SimpleMap'); ?></h4>
|
||||||
|
|
||||||
|
<p><?php _e('If you have more than 100 records to import, it is best to do one of the following:', 'SimpleMap'); ?></p>
|
||||||
|
|
||||||
|
<ul style="list-style-type: disc; margin-left: 3em;">
|
||||||
|
<li><?php _e('Geocode your own data before importing it'); ?></li>
|
||||||
|
<li><?php _e('Split your file into multiple files with no more than 100 lines each'); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p><?php printf(__('Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s', 'SimpleMap'), '<a href="http://groups.google.com/group/Google-Maps-API/web/resources-non-google-geocoders" target="_blank">', '</a>'); ?></p>
|
||||||
|
|
||||||
|
<p><?php _e('If you are importing a file you exported from SimpleMap (and haven\'t changed since), be sure to check the box below since the locations are already geocoded.', 'SimpleMap'); ?></p>
|
||||||
|
|
||||||
|
<form name="import_form" method="post" action="<?php echo admin_url( 'admin.php?page=simplemap-import-export' ); ?>" enctype="multipart/form-data" class="inabox">
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo (2 * 1024 * 1024); ?>" />
|
||||||
|
<input type="hidden" name="sm-action" value="import-csv" />
|
||||||
|
|
||||||
|
<p style="margin-top: 0;"><label for="simplemap-csv-upload"><?php _e('File to import (maximum size 2MB):', 'SimpleMap'); ?></label><input type="file" style="padding-left: 10px; border: none; font-size: 0.9em;" id="simplemap-csv-upload" name="simplemap-csv-upload" />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Warn them if the simplemap path is not writable
|
||||||
|
if ( ! is_writable( WP_PLUGIN_DIR ) )
|
||||||
|
echo "<br />" . __( sprintf( 'Please make the following directory <a href="%s">writable by WordPress</a>: %s', 'http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress', '<code>' . WP_PLUGIN_DIR . '</code>' ), 'SimpleMap' );
|
||||||
|
?>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e('Import CSV File', 'SimpleMap'); ?>" />
|
||||||
|
<?php /* if ( '' == $options['api_key'] ) : ?>
|
||||||
|
<?php printf( __( "Warning: You still need to enter an <a href='%s'>API key</a> if you need your locaitons geocoded.", 'SimpleMap' ), admin_url( "admin.php?page=simplemap" ) ); ?>
|
||||||
|
<?php endif; */ ?>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p style="color: #777; font: italic 1.1em Georgia;"><?php _e('Importing a file may take several seconds; please be patient.', 'SimpleMap'); ?></p>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e('Export To File', 'SimpleMap'); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 10px;">
|
||||||
|
|
||||||
|
<form name="export_form" method="post" action="" >
|
||||||
|
|
||||||
|
<input type="hidden" name="sm-action" value="export-csv" />
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e('Export Database to CSV File', 'SimpleMap'); ?>" />
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- =========================================
|
||||||
|
==============================================
|
||||||
|
========================================== -->
|
||||||
|
|
||||||
|
</div> <!-- meta-box-sortables -->
|
||||||
|
</div> <!-- postbox-container -->
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%;'>
|
||||||
|
|
||||||
|
<div id='side-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-import-export-side-sortables-top' ); ?>
|
||||||
|
|
||||||
|
<!-- #### PREMIUM SUPPORT #### -->
|
||||||
|
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3 style='color:#fff;text-shadow:0 1px 0 #000;background: #fff url( <?php echo SIMPLEMAP_URL; ?>/inc/images/blue-grad.png ) top left repeat-x;'><?php _e( 'Premium Support and Features', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style='padding: 0pt 10px 10px;' >
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Check for premium support status
|
||||||
|
global $simplemap_ps;
|
||||||
|
|
||||||
|
if ( ! url_has_ftps_for_item( $simplemap_ps ) ) : ?>
|
||||||
|
|
||||||
|
<h4><?php printf( __( 'SimpleMap Premium Support Benefits', 'SimpleMap' ), esc_attr( site_url() ) ); ?></h4>
|
||||||
|
<p>
|
||||||
|
<?php printf( __( 'SimpleMap now offers a premium support package for the low cost of %s per year per domain.', 'SimpleMap' ), '$30.00 USD' ); ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?php _e( 'By signing up for SimpleMap premium support, you help to ensure future enhancements to this excellent project as well as the following benefits:', 'SimpleMap' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:disc'>
|
||||||
|
<li><?php _e( 'Around the clock access to our extensive knowledge base and support forum from within your WordPress dashboard', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'Professional and timely response times to all your questions from the SimpleMap team', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 10% discount for any custom functionality you request from the SimpleMap developers', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 6-12 month advance access to new features integrated into the auto upgrade functionality of WordPress', 'SimpleMap' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:none'>
|
||||||
|
<li><a href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'SimpleMap' ); ?></a></li>
|
||||||
|
<li><a target='_blank' href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'SimpleMap' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<p class='howto'><?php printf( "Your premium support for <code>%s</code> was purchased on <code>%s</code> by <code>%s</code> (%s). It will remain valid for this URL until <code>%s</code>.", get_ftps_site( $simplemap_ps ), date( "F d, Y", get_ftps_purchase_date( $simplemap_ps ) ), get_ftps_name( $simplemap_ps ), get_ftps_email( $simplemap_ps ), date( "F d, Y", get_ftps_exp_date( $simplemap_ps ) ) ); ?></p>
|
||||||
|
<p><a href='#' id='premium_help'><?php _e( 'Launch Premium Support widget', 'SimpleMap' ); ?></a> | <a target="blank" href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'SimpleMap' );?></a></p>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
Tender = {
|
||||||
|
hideToggle: true,
|
||||||
|
sso: "<?php echo get_ftps_sso_key( $simplemap_ps ); ?>",
|
||||||
|
widgetToggles: [document.getElementById('premium_help')]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="https://simplemap.tenderapp.com/tender_widget.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<?php if ( $simple_map->legacy_tables_exist() ) : ?>
|
||||||
|
<!-- #### LEGACY EXPORT #### -->
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3><?php _e( 'Legacy Data', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style="padding: 10px;">
|
||||||
|
<p class='howto'><?php _e( 'It appears that you have location data stored in legacy SimpleMap tables that existed prior to version 2.0. What would you like to do with that data?', 'SimpleMap' ); ?></p>
|
||||||
|
|
||||||
|
<ul style="list-style-type: disc; margin-left: 3em;">
|
||||||
|
<li><a href='<?php echo admin_url( 'admin.php?page=simplemap-import-export&sm-action=export-legacy-csv' ); ?>'><?php _e( 'Export legacy data as a CSV file', 'SimpleMap' ); ?></a></li>
|
||||||
|
<!--<li><a href=''><?php _e( 'Port all legacy data over to custom post types', 'SimpleMap' ); ?></a></li>-->
|
||||||
|
<li><a onClick="javascript:return confirm('<?php _e( 'Last chance! Pressing OK will delete all Legacy SimpleMap data.'); ?>')" href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=simplemap-import-export&sm-action=delete-legacy-simplemap' ), 'delete-legacy-simplemap' ); ?>" ><?php _e( 'Permanently delete the legacy data and tables', 'SimpleMap' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-import-export-side-sortables-bottom' ); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> <!-- dashboard-widgets -->
|
||||||
|
|
||||||
|
<div class="clear">
|
||||||
|
</div>
|
||||||
|
</div><!-- dashboard-widgets-wrap -->
|
||||||
|
</div> <!-- wrap -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
749
classes/locations.php
Normal file
|
@ -0,0 +1,749 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_Locations' ) ) {
|
||||||
|
class SM_Locations {
|
||||||
|
|
||||||
|
function sm_locations(){
|
||||||
|
// Register my locations on init hook
|
||||||
|
add_action( 'init', array( &$this, 'register_locations' ) );
|
||||||
|
add_action( 'init', array( &$this, 'register_location_taxonomies' ) );
|
||||||
|
|
||||||
|
// Queue my JS
|
||||||
|
add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_location_add_edit_js' ) );
|
||||||
|
add_action( 'init', array( &$this, 'location_add_edit_js' ) );
|
||||||
|
|
||||||
|
// Save post meta
|
||||||
|
add_action( 'save_post', array( &$this, 'save_post_meta' ) );
|
||||||
|
add_action( 'wp_ajax_ajax_save_lat_lng', array( &$this, 'ajax_save_lat_lng' ) );
|
||||||
|
|
||||||
|
// Limit pages called for dropdown parent selector in quick edit
|
||||||
|
add_filter( 'parse_request', array( &$this, 'limit_edit_query' ) );
|
||||||
|
add_filter( 'quick_edit_dropdown_pages_args', array( &$this, 'limit_wp_dropdown_pages' ) );
|
||||||
|
add_filter( 'wp_dropdown_pages', array( &$this, 'modify_empty_wp_dropdown_pages' ) );
|
||||||
|
|
||||||
|
// Flush cache on manual location updates
|
||||||
|
add_action( 'save_post', array( &$this, 'flush_cache_data' ) );
|
||||||
|
add_action( 'trash_post', array( &$this, 'flush_cache_data' ) );
|
||||||
|
add_action( 'untrash_post', array( &$this, 'flush_cache_data' ) );
|
||||||
|
add_action( 'edit_post', array( &$this, 'flush_cache_data' ) );
|
||||||
|
add_action( 'delete_post', array( &$this, 'flush_cache_data' ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register locations post type
|
||||||
|
function register_locations() {
|
||||||
|
global $simple_map;
|
||||||
|
|
||||||
|
$args = array();
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
if ( !empty( $options['enable_permalinks'] ) ) {
|
||||||
|
$args += array(
|
||||||
|
'publicly_queryable' => true,
|
||||||
|
'exclude_from_search' => false,
|
||||||
|
'rewrite' => array( 'slug' => $options['permalink_slug'] ),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$args += array(
|
||||||
|
'public' => true,
|
||||||
|
'publicly_queryable' => false,
|
||||||
|
'exclude_from_search' => true,
|
||||||
|
'show_ui' => true,
|
||||||
|
'capability_type' => 'post',
|
||||||
|
'hierarchical' => false,
|
||||||
|
'rewrite' => false,
|
||||||
|
'query_var' => 'sm-location',
|
||||||
|
'register_meta_box_cb' => array( &$this, 'location_meta_cb' ),
|
||||||
|
'supports' => array(),
|
||||||
|
'labels' => array(
|
||||||
|
'name' => 'Locations',
|
||||||
|
'singular_name' => 'Location',
|
||||||
|
'add_new_item' => 'Add New Location',
|
||||||
|
'edit_item' => 'Edit Location',
|
||||||
|
'new_item' => 'New Location',
|
||||||
|
'view_item' => 'View Locations',
|
||||||
|
'search_items' => 'Search Locations',
|
||||||
|
'not_found' => 'No Locations found',
|
||||||
|
'not_found_in_trash' => 'No Locations found in trash',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Register it
|
||||||
|
register_post_type( 'sm-location', $args );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register custom taxonomies for locations
|
||||||
|
function register_location_taxonomies() {
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
$this->register_location_taxonomy( $taxonomy, $tax_info );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register custom taxonomy for locations
|
||||||
|
function register_location_taxonomy( $taxonomy, $tax_info ) {
|
||||||
|
if ( taxonomy_exists( $taxonomy ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tax_info += array(
|
||||||
|
'singular' => $taxonomy,
|
||||||
|
'plural' => $taxonomy,
|
||||||
|
'hierarchical' => false,
|
||||||
|
);
|
||||||
|
|
||||||
|
$args = array(
|
||||||
|
'labels' => array(
|
||||||
|
'name' => 'Location ' . $tax_info['plural'],
|
||||||
|
'singular_name' => 'Location ' . $tax_info['singular'],
|
||||||
|
'search_items' => 'Search ' . $tax_info['plural'],
|
||||||
|
'popular_items' => 'Popular ' . $tax_info['plural'],
|
||||||
|
'all_items' => 'All ' . $tax_info['plural'],
|
||||||
|
'parent_item' => 'Parent ' . $tax_info['singular'],
|
||||||
|
'parent_item_colon' => 'Parent ' . $tax_info['singular'] . ':',
|
||||||
|
'edit_item' => 'Edit ' . $tax_info['singular'],
|
||||||
|
'update_item' => 'Update ' . $tax_info['singular'],
|
||||||
|
'add_new_item' => 'Add New ' . $tax_info['singular'],
|
||||||
|
'new_item_name' => 'New ' . $tax_info['singular'] . ' Name',
|
||||||
|
'separate_items_with_commas' => 'Separate ' . strtolower( $tax_info['plural'] ) . ' with commas',
|
||||||
|
'add_or_remove_items' => 'Add or remove ' . strtolower( $tax_info['plural'] ),
|
||||||
|
'choose_from_most_used' => 'Choose from the most used ' . strtolower( $tax_info['plural'] ),
|
||||||
|
),
|
||||||
|
'hierarchical' => $tax_info['hierarchical'],
|
||||||
|
'rewrite' => false,
|
||||||
|
'show_tagcloud' => false
|
||||||
|
);
|
||||||
|
|
||||||
|
register_taxonomy( $taxonomy, 'sm-location', $args );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add call back for meta box
|
||||||
|
function location_meta_cb(){
|
||||||
|
add_meta_box( 'sm-location-premium-support', __( 'Premium Support', 'SimpleMap' ), array( &$this, 'premium_support' ), 'sm-location', 'side', 'high' );
|
||||||
|
add_meta_box( 'sm-geo-location', __( 'Geographic Location', 'SimpleMap' ), array( &$this, 'geo_location' ), 'sm-location', 'normal' );
|
||||||
|
add_meta_box( 'sm-additional-information', __( 'Additional Information', 'SimpleMap' ), array( &$this, 'additional_information' ), 'sm-location', 'normal' );
|
||||||
|
add_meta_box( 'sm-location-drag-drop', __( 'Drag and Drop Location', 'SimpleMap' ), array( &$this, 'location_drag_drop' ), 'sm-location', 'side' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add premium support box
|
||||||
|
function premium_support() {
|
||||||
|
|
||||||
|
global $simplemap_ps, $current_user;
|
||||||
|
|
||||||
|
wp_get_current_user();
|
||||||
|
$status_key = md5( 'ft_premium_support_' . $simplemap_ps->product_id . '_' . sanitize_title_with_dashes( $simplemap_ps->site_url ) . '_' . sanitize_title_with_dashes( $simplemap_ps->server_url ) ) ;
|
||||||
|
$sso_key = md5( 'ft_premium_sso_' . $current_user->ID . '_' . $simplemap_ps->product_id . '_' . sanitize_title_with_dashes( $simplemap_ps->site_url ) . '_' . sanitize_title_with_dashes( $simplemap_ps->server_url ) );
|
||||||
|
|
||||||
|
// Set status from transient if not set via global
|
||||||
|
if ( '' == $simplemap_ps->ps_status && '' != get_transient( $status_key ) )
|
||||||
|
$simplemap_ps->ps_status = get_transient( $status_key );
|
||||||
|
|
||||||
|
// Set sso key from transient if not set via global
|
||||||
|
if ( '' == $simplemap_ps->sso_status && '' != get_transient( $sso_key ) )
|
||||||
|
$simplemap_ps->sso_status = get_transient( $sso_key );
|
||||||
|
|
||||||
|
|
||||||
|
//echo "<pre>";print_r( $simplemap_ps );echo "</pre>";
|
||||||
|
if ( ! url_has_ftps_for_item( $simplemap_ps ) ) :
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p>
|
||||||
|
<?php _e( 'By signing up for SimpleMap premium support, you help to ensure future enhancements to this excellent project as well as the following benefits:', 'SimpleMap' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:disc'>
|
||||||
|
<li><?php _e( 'Around the clock access to our extensive knowledge base and support forum from within your WordPress dashboard', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'Professional and timely response times to all your questions from the SimpleMap team', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 10% discount for any custom functionality you request from the SimpleMap developers', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 6-12 month advance access to new features integrated into the auto upgrade functionality of WordPress', 'SimpleMap' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:none'>
|
||||||
|
<li><a href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'SimpleMap' ); ?></a></li>
|
||||||
|
<li><a target='_blank' href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'SimpleMap' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
else :
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p class='howto aligncenter'><?php printf( __( 'Your premium support license for %s is valid until %s', 'SimpleMap' ), get_ftps_site( $simplemap_ps ), date( "F d, Y", get_ftps_exp_date( $simplemap_ps ) ) ); ?></p>
|
||||||
|
<ul style='margin-left:25px;list-style-type:disc'>
|
||||||
|
<li><a href="#" id="simplemap-pss"><?php _e( 'Launch Premium Support widget', 'SimpleMap' ); ?></a></li>
|
||||||
|
<li><a target='_blank' href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'SimpleMap' ); ?></a></li>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
Tender = {
|
||||||
|
hideToggle: true,
|
||||||
|
sso: "<?php echo get_ftps_sso_key( $simplemap_ps ); ?>",
|
||||||
|
widgetToggles: [document.getElementById('simplemap-pss')]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="https://simplemap.tenderapp.com/tender_widget.js" type="text/javascript"></script>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
endif;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Geographic Location Information
|
||||||
|
function geo_location( $post ){
|
||||||
|
global $simple_map, $hook_suffix;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
// Location data
|
||||||
|
$location_address = get_post_meta( $post->ID, 'location_address', true ) ? get_post_meta( $post->ID, 'location_address', true ) : '';
|
||||||
|
$location_address2 = get_post_meta( $post->ID, 'location_address2', true ) ? get_post_meta( $post->ID, 'location_address2', true ) : '';
|
||||||
|
$location_city = get_post_meta( $post->ID, 'location_city', true ) ? get_post_meta( $post->ID, 'location_city', true ) : '';
|
||||||
|
$location_state = get_post_meta( $post->ID, 'location_state', true ) ? get_post_meta( $post->ID, 'location_state', true ) : $options['default_state'];
|
||||||
|
$location_zip = get_post_meta( $post->ID, 'location_zip', true ) ? get_post_meta( $post->ID, 'location_zip', true ) : '';
|
||||||
|
$location_country = get_post_meta( $post->ID, 'location_country', true ) ? get_post_meta( $post->ID, 'location_country', true ) : $options['default_country'];
|
||||||
|
$location_lat = get_post_meta( $post->ID, 'location_lat', true ) ? get_post_meta( $post->ID, 'location_lat', true ) : '';
|
||||||
|
$location_lng = get_post_meta( $post->ID, 'location_lng', true ) ? get_post_meta( $post->ID, 'location_lng', true ) : '';
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p class="sub"><?php _e('You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact.', 'SimpleMap'); ?></p>
|
||||||
|
|
||||||
|
<div class='hidden updated below-h2' id='js-geo-encode-msg'>
|
||||||
|
<p><?php echo __( "Your Server's IP is over the geocode threshold set by Google so we had fallback to a Javascript function. <span id='sm_js_update_lat_lng_result'></span>", "SimpleMap" ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<!-- Store Address -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="location_address"><?php _e('Address', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_address" id="location_address" size="30" value="<?php echo esc_attr( $location_address ); ?>" /><br />
|
||||||
|
<input type="text" name="location_address2" size="30" value="<?php echo esc_attr( $location_address2 ); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- City / Town -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_city"><?php _e('City/Town', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_city" id="location_city" value="<?php echo esc_attr( $location_city ); ?>" size="30" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- State / Providence -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_state"><?php _e('State/Province', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_state" id="location_state" value="<?php echo esc_attr( $location_state ); ?>" size="30" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Zip / Postal Code -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_zip"><?php _e('Zip/Postal Code', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_zip" id="location_zip" value="<?php echo esc_attr( $location_zip ); ?>" size="30" maxlength="20" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Country -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_country"><?php _e('Country', 'SimpleMap'); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="location_country" id="location_country">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_country_options() as $key => $value ) {
|
||||||
|
echo '<option value="' . $key . '" ' . selected( $location_country, $key, false ) . '>' . $value . '</option>'."\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Lat / Lng -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_lat"><?php _e('Latitude/Longitude', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_lat" id="location_lat" size="14" value="<?php echo esc_attr( $location_lat ); ?>" />
|
||||||
|
<input type="text" name="location_lng" id="location_lng" size="14" value="<?php echo esc_attr( $location_lng ); ?>" /> <span id='latlng_updated' class='updated' style='display:none;color:#666666;font-style:italic;font-size:11px;'>Lat / Lng updated. Update address too? <a href='#' onclick="dragDropUpdateAddress();jQuery('#latlng_updated').hide();jQuery('#latlng_dontforget').fadeIn();return false;" >yes</a> | <a href='#' onclick="jQuery('#latlng_updated').hide();jQuery('#latlng_dontforget').fadeIn();return false;">no</a></span> <span id='latlng_dontforget' class='error' style='display:none;color:#666666;font-style:italic;font-size:11px;'>Changes aren't saved until you update or publish</span></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div> <!-- table -->
|
||||||
|
<div class="clear"></div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Additional Information
|
||||||
|
function additional_information( $post ){
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
$location_phone = get_post_meta( $post->ID, 'location_phone', true ) ? get_post_meta( $post->ID, 'location_phone', true ) : '';
|
||||||
|
$location_fax = get_post_meta( $post->ID, 'location_fax', true ) ? get_post_meta( $post->ID, 'location_fax', true ) : '';
|
||||||
|
$location_url = get_post_meta( $post->ID, 'location_url', true ) ? get_post_meta( $post->ID, 'location_url', true ) : '';
|
||||||
|
$location_email = get_post_meta( $post->ID, 'location_email', true ) ? get_post_meta( $post->ID, 'location_email', true ) : '';
|
||||||
|
$location_special = get_post_meta( $post->ID, 'location_special', true ) ? get_post_meta( $post->ID, 'location_special', true ) : '';
|
||||||
|
?>
|
||||||
|
<div class="table">
|
||||||
|
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<!-- Phone -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="location_phone"><?php _e('Phone', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" id="location_phone" name="location_phone" size="30" maxlength="28" value="<?php echo esc_attr( $location_phone ); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Email -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_email"><?php _e('Email', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_email" id="location_email" size="30" value="<?php echo esc_attr( $location_email ); ?>" />
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- URL -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_url"><?php _e('URL', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" name="location_url" id="location_url" size="30" value="<?php echo esc_attr( $location_url ); ?>" />
|
||||||
|
<br /><?php _e('Please include <strong>http://</strong>', 'SimpleMap'); ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Fax -->
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_fax"><?php _e('Fax', 'SimpleMap'); ?></label></td>
|
||||||
|
<td><input type="text" id="location_fax" name="location_fax" size="30" maxlength="28" value="<?php echo esc_attr( $location_fax ); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Store Special -->
|
||||||
|
<?php if ( $options['special_text'] != '' ) { ?>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="location_special"><?php echo $options['special_text']; ?></label></td>
|
||||||
|
<td><input type="checkbox" id="location_special" name="location_special" value="1" <?php checked( $location_special ); ?> /></td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div> <!-- table -->
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function contains the little map with the marker
|
||||||
|
function location_drag_drop( $post ) {
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
// Location data
|
||||||
|
$location_address = get_post_meta( $post->ID, 'location_address', true ) ? get_post_meta( $post->ID, 'location_address', true ) : '';
|
||||||
|
$location_address2 = get_post_meta( $post->ID, 'location_address2', true ) ? get_post_meta( $post->ID, 'location_address2', true ) : '';
|
||||||
|
$location_city = get_post_meta( $post->ID, 'location_city', true ) ? get_post_meta( $post->ID, 'location_city', true ) : '';
|
||||||
|
$location_state = get_post_meta( $post->ID, 'location_state', true ) ? get_post_meta( $post->ID, 'location_state', true ) : $options['default_state'];
|
||||||
|
$location_zip = get_post_meta( $post->ID, 'location_zip', true ) ? get_post_meta( $post->ID, 'location_zip', true ) : '';
|
||||||
|
$location_country = get_post_meta( $post->ID, 'location_country', true ) ? get_post_meta( $post->ID, 'location_country', true ) : $options['default_country'];
|
||||||
|
$location_lat = get_post_meta( $post->ID, 'location_lat', true ) ? get_post_meta( $post->ID, 'location_lat', true ) : '';
|
||||||
|
$location_lng = get_post_meta( $post->ID, 'location_lng', true ) ? get_post_meta( $post->ID, 'location_lng', true ) : '';
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p class='howto'>Drag the marker to fine tune your location's placement on the map</p>
|
||||||
|
<div id="dragdrop_map_canvas" style="width:267px;height:200px;"></div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enqueues the JS I need.
|
||||||
|
function enqueue_location_add_edit_js() {
|
||||||
|
global $current_screen, $post;
|
||||||
|
|
||||||
|
if ( ! is_admin() || 'sm-location' != $current_screen->id )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wp_enqueue_script( 'sm-drag-drop-location-js', site_url() . '/?sm-drag-drop-location-js=' . $post->ID, array( 'jquery' ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Javascript for add / edit location page
|
||||||
|
function location_add_edit_js() {
|
||||||
|
global $current_screen, $simple_map;
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
if ( !isset( $_GET['sm-drag-drop-location-js'] ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$postid = (int) $_GET['sm-drag-drop-location-js'];
|
||||||
|
|
||||||
|
$drag_drop_lat = get_post_meta( $postid, 'location_lat', true ) ? get_post_meta( $postid, 'location_lat', true ) : '40.730885';
|
||||||
|
$drag_drop_lng = get_post_meta( $postid, 'location_lng', true ) ? get_post_meta( $postid, 'location_lng', true ) : '-73.997383';
|
||||||
|
$drag_drop_zoom = ( $drag_drop_lat == '40.730885' ) ? 2 : 17;
|
||||||
|
|
||||||
|
header( "Content-type: application/x-javascript" );
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ( '' == $options['api_key'] ) {
|
||||||
|
die( "alert( '" . esc_js( __( "You will need to enter your API key in general options before your addresses will be coded properly.", 'SimpleMap' ) ) . "');" );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
var map;
|
||||||
|
var geocoder;
|
||||||
|
var address;
|
||||||
|
var marker;
|
||||||
|
var place;
|
||||||
|
|
||||||
|
function location_add_edit_js_init() {
|
||||||
|
var latlng = new google.maps.LatLng( <?php echo esc_js( $drag_drop_lat ); ?>, <?php echo esc_js( $drag_drop_lng ); ?> );
|
||||||
|
var myOptions = {
|
||||||
|
zoom: <?php echo esc_js( $drag_drop_zoom ); ?>,
|
||||||
|
center: latlng,
|
||||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
|
};
|
||||||
|
map = new google.maps.Map( document.getElementById( "dragdrop_map_canvas" ), myOptions );
|
||||||
|
|
||||||
|
marker = new google.maps.Marker({
|
||||||
|
position: latlng,
|
||||||
|
map: map,
|
||||||
|
draggable: true,
|
||||||
|
animation: google.maps.Animation.DROP
|
||||||
|
});
|
||||||
|
|
||||||
|
google.maps.event.addListener( map, 'click', dragDropGetAddress );
|
||||||
|
google.maps.event.addListener( marker, 'dragend', dragDropGetAddressTest );
|
||||||
|
|
||||||
|
geocoder = new google.maps.Geocoder();
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// If PHP Geocode failed, do the ajax update
|
||||||
|
if ( $sm_js_update = get_post_meta( $postid, 'sm-needs-js-geocode', true ) ) {
|
||||||
|
$location_address_data = get_post_custom( $postid );
|
||||||
|
?>
|
||||||
|
jQuery( '#js-geo-encode-msg' ).removeClass( 'hidden' );
|
||||||
|
|
||||||
|
// Do geocode
|
||||||
|
var geo_address = '<?php echo esc_js( $location_address_data['location_address'][0] . ' ' . $location_address_data['location_city'][0] . ' ' . $location_address_data['location_state'][0] . ' ' . $location_address_data['location_zip'][0] . ' ' . $location_address_data['location_country'][0] ); ?>';
|
||||||
|
geocoder.geocode( { 'address': geo_address }, function( results, status ) {
|
||||||
|
if ( status == google.maps.GeocoderStatus.OK ) {
|
||||||
|
var latlng = results[0].geometry.location;
|
||||||
|
jQuery( "#location_lat" ).attr( 'value', latlng.lat() );
|
||||||
|
jQuery( "#location_lng" ).attr( 'value', latlng.lng() );
|
||||||
|
|
||||||
|
var smdata = {
|
||||||
|
action: 'ajax_save_lat_lng',
|
||||||
|
sm_id: <?php echo esc_js( $postid ); ?>,
|
||||||
|
sm_lat: latlng.lat(),
|
||||||
|
sm_lng: latlng.lng()
|
||||||
|
};
|
||||||
|
|
||||||
|
jQuery.post( ajaxurl, smdata, function( response ) {
|
||||||
|
jQuery( '#sm_js_update_lat_lng_result' ).html( response );
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set drag/drop map to new location
|
||||||
|
map.setCenter( latlng );
|
||||||
|
map.setZoom( <?php echo esc_js( $drag_drop_zoom ); ?> );
|
||||||
|
marker = new google.maps.Marker({
|
||||||
|
map: map,
|
||||||
|
position: latlng,
|
||||||
|
draggable: true,
|
||||||
|
animation: google.maps.Animation.DROP
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery( '#js-geo-encode-msg' ).removeClass( 'hidden' );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Geocode was not successful for the following reason: " + status);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
<?php
|
||||||
|
delete_post_meta( $postid, 'sm-needs-js-geocode' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragDropGetAddressTest() {
|
||||||
|
var latlng = marker.getPosition();
|
||||||
|
geocoder.geocode( { 'latLng': latlng }, dragDropShowAddress );
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragDropGetAddress( event ) {
|
||||||
|
if ( event.latlng != null ) {
|
||||||
|
geocoder.geocode( { 'latLng': event.latlng }, dragDropShowAddress );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragDropShowAddress( results, status ) {
|
||||||
|
marker.setMap(null);
|
||||||
|
if ( status != google.maps.GeocoderStatus.OK ) {
|
||||||
|
alert("Geocoder failed due to: " + status);
|
||||||
|
map.addOverlay(marker);
|
||||||
|
} else {
|
||||||
|
var latlng = results[0].geometry.location;
|
||||||
|
marker = new google.maps.Marker({
|
||||||
|
map: map,
|
||||||
|
position: latlng,
|
||||||
|
draggable: true,
|
||||||
|
animation: google.maps.Animation.DROP
|
||||||
|
});
|
||||||
|
|
||||||
|
dragDropUpdateFormFields( latlng );
|
||||||
|
place = results[0];
|
||||||
|
|
||||||
|
google.maps.event.addListener( marker, 'dragend', dragDropGetAddressTest );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery(document).ready(function(){
|
||||||
|
location_add_edit_js_init();
|
||||||
|
});
|
||||||
|
|
||||||
|
function dragDropUpdateFormFields( latlng ) {
|
||||||
|
jQuery( "#location_lat" ).attr( 'value', latlng.lat() );
|
||||||
|
jQuery( "#location_lng" ).attr( 'value', latlng.lng() );
|
||||||
|
jQuery( "#latlng_dontforget" ).hide();
|
||||||
|
jQuery( "#latlng_updated" ).fadeIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragDropUpdateAddress() {
|
||||||
|
var newAddress = {};
|
||||||
|
for ( var i = 0; i < place.address_components.length; i++ ) {
|
||||||
|
var component = place.address_components[i];
|
||||||
|
newAddress[component.types[0]] = component.short_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newStreet = '';
|
||||||
|
var newCity = '';
|
||||||
|
var newState = '';
|
||||||
|
var newZip = '';
|
||||||
|
var newCountry = '';
|
||||||
|
|
||||||
|
if ( newAddress.street_number ) {
|
||||||
|
newStreet += newAddress.street_number;
|
||||||
|
}
|
||||||
|
if ( newAddress.route ) {
|
||||||
|
if ( newStreet != '' ) {
|
||||||
|
newStreet += ' ';
|
||||||
|
}
|
||||||
|
newStreet += newAddress.route;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newAddress.locality ) {
|
||||||
|
newCity += newAddress.locality;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newAddress.administrative_area_level_1 ) {
|
||||||
|
newState += newAddress.administrative_area_level_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newAddress.postal_code ) {
|
||||||
|
newZip += newAddress.postal_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newAddress.country ) {
|
||||||
|
newCountry += newAddress.country;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare != null )
|
||||||
|
newStreet = place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare.ThoroughfareName;
|
||||||
|
else if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.Locality.Thoroughfare != null )
|
||||||
|
newStreet = place.AddressDetails.Country.AdministrativeArea.Locality.Thoroughfare.ThoroughfareName;
|
||||||
|
|
||||||
|
if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName != null )
|
||||||
|
newCity = place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName;
|
||||||
|
else if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName != null )
|
||||||
|
newCity = place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName;
|
||||||
|
|
||||||
|
if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName != null )
|
||||||
|
newState = place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName;
|
||||||
|
|
||||||
|
if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode != null && place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber != null )
|
||||||
|
newZip = place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber;
|
||||||
|
if ( place.AddressDetails.Country.AdministrativeArea != null && place.AddressDetails.Country.AdministrativeArea.Locality != null && place.AddressDetails.Country.AdministrativeArea.Locality.PostalCode != null && place.AddressDetails.Country.AdministrativeArea.Locality.PostalCode.PostalCodeNumber != null )
|
||||||
|
newZip = place.AddressDetails.Country.AdministrativeArea.Locality.PostalCode.PostalCodeNumber;
|
||||||
|
|
||||||
|
if ( place.AddressDetails.Country != null && place.AddressDetails.Country.CountryNameCode != null )
|
||||||
|
newCountry = place.AddressDetails.Country.CountryNameCode;
|
||||||
|
|
||||||
|
oldStreet = jQuery("#location_address").attr( 'value' );
|
||||||
|
oldCity = jQuery("#location_address").attr( 'value' );
|
||||||
|
oldState = jQuery("#location_address").attr( 'value' );
|
||||||
|
oldZip = jQuery("#location_address").attr( 'value' );
|
||||||
|
oldCountry = jQuery("#location_address").attr( 'value' );
|
||||||
|
*/
|
||||||
|
|
||||||
|
jQuery("#location_address").attr( 'value', newStreet );
|
||||||
|
jQuery("#location_city").attr( 'value', newCity );
|
||||||
|
jQuery("#location_state").attr( 'value', newState );
|
||||||
|
jQuery("#location_zip").attr( 'value', newZip );
|
||||||
|
jQuery("#location_country").val( newCountry );
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function saves the geo data as well as the additional info
|
||||||
|
function save_post_meta( $post ) {
|
||||||
|
global $simple_map, $current_screen;
|
||||||
|
|
||||||
|
// Bail if we're not editing a location
|
||||||
|
if ( ! is_object( $current_screen ) || 'sm-location' != $current_screen->id || 'sm-location' != $current_screen->post_type )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
$post_object = get_post( $post );
|
||||||
|
|
||||||
|
//$api_key = ( isset( $options['api_key'] ) && !empty( $options['api_key'] ) ) ? $options['api_key'] : '';
|
||||||
|
|
||||||
|
// Grab old data
|
||||||
|
$location_address = get_post_meta( $post, 'location_address', true ) ? get_post_meta( $post, 'location_address', true ) : ' ';
|
||||||
|
$location_address2 = get_post_meta( $post, 'location_address2', true ) ? get_post_meta( $post, 'location_address2', true ) : ' ';
|
||||||
|
$location_city = get_post_meta( $post, 'location_city', true ) ? get_post_meta( $post, 'location_city', true ) : ' ';
|
||||||
|
$location_state = get_post_meta( $post, 'location_state', true ) ? get_post_meta( $post, 'location_state', true ) : $options['default_state'];
|
||||||
|
$location_zip = get_post_meta( $post, 'location_zip', true ) ? get_post_meta( $post, 'location_zip', true ) : ' ';
|
||||||
|
$location_country = get_post_meta( $post, 'location_country', true ) ? get_post_meta( $post, 'location_country', true ) : $options['default_country'];
|
||||||
|
$location_lat = get_post_meta( $post, 'location_lat', true ) ? get_post_meta( $post, 'location_lat', true ) : ' ';
|
||||||
|
$location_lng = get_post_meta( $post, 'location_lng', true ) ? get_post_meta( $post, 'location_lng', true ) : ' ';
|
||||||
|
$location_phone = get_post_meta( $post, 'location_phone', true ) ? get_post_meta( $post, 'location_phone', true ) : ' ';
|
||||||
|
$location_fax = get_post_meta( $post, 'location_fax', true ) ? get_post_meta( $post, 'location_fax', true ) : ' ';
|
||||||
|
$location_url = get_post_meta( $post, 'location_url', true ) ? get_post_meta( $post, 'location_url', true ) : ' ';
|
||||||
|
$location_email = get_post_meta( $post, 'location_email', true ) ? get_post_meta( $post, 'location_email', true ) : ' ';
|
||||||
|
$location_special = get_post_meta( $post, 'location_special', true ) ? get_post_meta( $post, 'location_special', true ) : ' ';
|
||||||
|
// If adding new field that has a default (like state and country above), you must modify the update section below accordingly!
|
||||||
|
|
||||||
|
// Grab new data
|
||||||
|
$new_address = isset( $_POST['location_address'] ) ? $_POST['location_address'] : '';
|
||||||
|
$new_address2 = isset( $_POST['location_address2'] ) ? $_POST['location_address2'] : '';
|
||||||
|
$new_city = isset( $_POST['location_city'] ) ? $_POST['location_city'] : '';
|
||||||
|
$new_state = isset( $_POST['location_state'] ) ? $_POST['location_state'] : '';
|
||||||
|
$new_zip = isset( $_POST['location_zip'] ) ? $_POST['location_zip'] : '';
|
||||||
|
$new_country = isset( $_POST['location_country'] ) ? $_POST['location_country'] : '';
|
||||||
|
$new_lat = isset( $_POST['location_lat'] ) ? $_POST['location_lat'] : '';
|
||||||
|
$new_lng = isset( $_POST['location_lng'] ) ? $_POST['location_lng'] : '';
|
||||||
|
$new_phone = isset( $_POST['location_phone'] ) ? $_POST['location_phone'] : '';
|
||||||
|
$new_fax = isset( $_POST['location_fax'] ) ? $_POST['location_fax'] : '';
|
||||||
|
$new_url = isset( $_POST['location_url'] ) ? $_POST['location_url'] : '';
|
||||||
|
$new_email = isset( $_POST['location_email'] ) ? $_POST['location_email'] : '';
|
||||||
|
$new_special = isset( $_POST['location_special'] ) ? $_POST['location_special'] : '';
|
||||||
|
|
||||||
|
// Update
|
||||||
|
if ( $location_address != $new_address ) update_post_meta( $post, 'location_address', $new_address );
|
||||||
|
if ( $location_address2 != $new_address2 ) update_post_meta( $post, 'location_address2', $new_address2 );
|
||||||
|
if ( $location_city != $new_city ) update_post_meta( $post, 'location_city', $new_city );
|
||||||
|
if ( $location_state != $new_state || ( $new_state == $options['default_state'] && ! get_post_meta( $post, 'location_state', true ) ) ) update_post_meta( $post, 'location_state', $new_state );
|
||||||
|
if ( $location_zip != $new_zip ) update_post_meta( $post, 'location_zip', $new_zip );
|
||||||
|
if ( $location_country != $new_country || ( $new_country == $options['default_country'] && ! get_post_meta( $post, 'location_country', true ) ) ) update_post_meta( $post, 'location_country', $new_country );
|
||||||
|
if ( $location_lat != $new_lat ) update_post_meta( $post, 'location_lat', $new_lat );
|
||||||
|
if ( $location_lng != $new_lng ) update_post_meta( $post, 'location_lng', $new_lng );
|
||||||
|
if ( $location_phone != $new_phone ) update_post_meta( $post, 'location_phone', $new_phone );
|
||||||
|
if ( $location_fax != $new_fax ) update_post_meta( $post, 'location_fax', $new_fax );
|
||||||
|
if ( $location_url != $new_url ) update_post_meta( $post, 'location_url', $new_url );
|
||||||
|
if ( $location_email != $new_email ) update_post_meta( $post, 'location_email', $new_email );
|
||||||
|
if ( $location_special != $new_special ) update_post_meta( $post, 'location_special', $new_special );
|
||||||
|
|
||||||
|
|
||||||
|
// Lets not geocode on auto-draft
|
||||||
|
if ( 'auto-draft' == $post_object->post_status )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Geocode here under the following conditions
|
||||||
|
* If address, city, state, or zip have changed
|
||||||
|
* If lat or lng is empty
|
||||||
|
*/
|
||||||
|
$updated_address = get_post_meta( $post, 'location_address', true );
|
||||||
|
$updated_city = get_post_meta( $post, 'location_city', true );
|
||||||
|
$updated_state = get_post_meta( $post, 'location_state', true );
|
||||||
|
$updated_zip = get_post_meta( $post, 'location_zip', true );
|
||||||
|
$updated_country = get_post_meta( $post, 'location_country', true );
|
||||||
|
$updated_lat = get_post_meta( $post, 'location_lat', true );
|
||||||
|
$updated_lng = get_post_meta( $post, 'location_lng', true );
|
||||||
|
|
||||||
|
if ( $location_address != $updated_address || $location_city != $updated_city || $location_state != $updated_state || $location_zip != $updated_zip || $location_country != $updated_country || '' == $updated_lat || '' == $updated_lng ) {
|
||||||
|
$geocode_result = $simple_map->geocode_location( $updated_address, $updated_city, $updated_state, $updated_zip, $updated_country, '' );
|
||||||
|
|
||||||
|
if ( $geocode_result && isset( $geocode_result['status'] ) && $geocode_result['status'] == 'OK' ) {
|
||||||
|
if ( isset( $geocode_result['lat'] ) && isset( $geocode_result['lng'] ) ) {
|
||||||
|
update_post_meta( $post, 'location_lat', $geocode_result['lat'] );
|
||||||
|
update_post_meta( $post, 'location_lng', $geocode_result['lng'] );
|
||||||
|
}
|
||||||
|
} else if ( $geocode_result && isset( $geocode_result['status'] ) ) {
|
||||||
|
// Parse response
|
||||||
|
switch( $geocode_result['status'] ) {
|
||||||
|
case 620 :
|
||||||
|
case 'OVER_QUERY_LIMIT' :
|
||||||
|
update_post_meta( $post, 'sm-needs-js-geocode', 'true' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter the main query run at top of edit.php
|
||||||
|
function limit_edit_query( $query ) {
|
||||||
|
global $current_screen, $wpdb;
|
||||||
|
|
||||||
|
if ( is_object( $current_screen ) && 'edit-sm-location' == $current_screen->id ) {
|
||||||
|
|
||||||
|
$sql = 'SELECT ID FROM `' . $wpdb->posts . '` WHERE post_type = "sm-location" AND post_status = "publish" LIMIT 10000';
|
||||||
|
if ( 10000 == count( $wpdb->get_results( $sql ) ) ) {
|
||||||
|
$query->query_vars['posts_per_page'] = $query->query_vars['posts_per_archive_page'] = 1000;
|
||||||
|
add_action( 'in_admin_footer', array( &$this, 'print_excessive_locations_message' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prints the excessive locations message
|
||||||
|
function print_excessive_locations_message() {
|
||||||
|
?>
|
||||||
|
<div id="message" class="error"><p><?php _e( '<strong>Warning</strong>: You have more than 10,000 locations in your database. We have limited the list here to 1,000. You may <strong>use the search field to access locations beyond the first 1,000</strong>.', 'SimpleMap' ); ?></p></div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Saves lat / lng data via ajax
|
||||||
|
function ajax_save_lat_lng() {
|
||||||
|
|
||||||
|
// If we're missing a var, return false
|
||||||
|
if ( empty( $_POST['sm_lat'] ) || empty( $_POST['sm_lng'] ) || empty( $_POST['sm_id'] ) )
|
||||||
|
die( __( "It doesn't look like that worked either. Please try again later.", "SimpleMap" ) );
|
||||||
|
|
||||||
|
// Save original lat for roleback if lng update fails
|
||||||
|
$orig_lat = get_post_meta( absint( $_POST['sm_id'] ), 'location_lat', esc_attr( $_POST['sm_lat'], true ) );
|
||||||
|
|
||||||
|
// Update or return false
|
||||||
|
if ( ! update_post_meta( absint( $_POST['sm_id'] ), 'location_lat', esc_attr( $_POST['sm_lat'] ) ) )
|
||||||
|
die( __( "It doesn't look like that worked either. Please try again later.", "SimpleMap" ) );
|
||||||
|
if ( ! update_post_meta( absint( $_POST['sm_id'] ), 'location_lng', esc_attr( $_POST['sm_lng'] ) ) ) {
|
||||||
|
update_post_meta( absint( $_POST['sm_id'] ), 'location_lat', esc_attr( $orig_lat ) );
|
||||||
|
die( __( "It doesn't look like that worked either. Please try again later.", "SimpleMap" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we made it here, we're golden
|
||||||
|
die( __( "It looks like that worked!", "SimpleMap" ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter get page dropdown if we have excessive locations
|
||||||
|
function limit_wp_dropdown_pages( $args ) {
|
||||||
|
global $current_screen;
|
||||||
|
|
||||||
|
if ( is_object( $current_screen ) && 'edit-sm-location' == $current_screen->id )
|
||||||
|
$args['include'] = 'This always returns an empty record set.';
|
||||||
|
|
||||||
|
return $args;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Related to limit_wp_dropdown_pages. Now fill in what I erased above with fake data
|
||||||
|
function modify_empty_wp_dropdown_pages( $output ) {
|
||||||
|
global $current_screen;
|
||||||
|
|
||||||
|
if ( is_object( $current_screen ) && 'edit-sm-location' == $current_screen->id )
|
||||||
|
$output = "<select ide='post_parent' name='post_parent'><option value='0'>" . __( 'Main Page (no parent)' ) . "</option></select>";
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flushes location cached data
|
||||||
|
function flush_cache_data( $id=0 ) {
|
||||||
|
|
||||||
|
if ( 'sm-location' == get_post_type( $id ) || 'force' == $id )
|
||||||
|
delete_transient( 'simplemap-queries-cache' );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
279
classes/maps.php
Normal file
|
@ -0,0 +1,279 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file creates maps for us. We're all about generating some maps.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SM_Map_Factory Class
|
||||||
|
*
|
||||||
|
* Handles all our map making duties (well it will be taking over shortly anyway).
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
if ( ! class_exists( 'SM_Map_Factory' ) ) {
|
||||||
|
|
||||||
|
class SM_Map_Factory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map attributes
|
||||||
|
*/
|
||||||
|
var $map_atts;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locations - An array of location data that we are adding to the map.
|
||||||
|
*/
|
||||||
|
var $locations;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inits the templating system. Don't init class prior to template_redirect hook
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
// Lets load the map with some defaults. This should be overwritten by calling the method directly
|
||||||
|
$this->set_map_atts();
|
||||||
|
|
||||||
|
// Prints the iframe
|
||||||
|
if ( isset( $_GET['sm_map_iframe'] ) ) {
|
||||||
|
add_action( 'template_redirect', array( &$this, 'add_iframe_locations' ), 2 );
|
||||||
|
add_action( 'template_redirect', array( &$this, 'generate_iframe' ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This loads all the attributes for the map itself
|
||||||
|
*
|
||||||
|
* 'map_width'
|
||||||
|
* 'map_height'
|
||||||
|
* 'default_lat'
|
||||||
|
* 'default_lng'
|
||||||
|
* 'zoom_level'
|
||||||
|
* 'default_radius'
|
||||||
|
* 'map_type'
|
||||||
|
* 'special_text'
|
||||||
|
* 'default_state'
|
||||||
|
* 'default_country'
|
||||||
|
* 'default_language'
|
||||||
|
* 'default_domain'
|
||||||
|
* 'map_stylesheet'
|
||||||
|
* 'units'
|
||||||
|
* 'autoload'
|
||||||
|
* 'lock_default_location'
|
||||||
|
* 'results_limit'
|
||||||
|
* 'address_format'
|
||||||
|
* 'powered_by'
|
||||||
|
* 'enable_permalinks'
|
||||||
|
* 'permalink_slug'
|
||||||
|
* 'display_search'
|
||||||
|
* 'map_pages'
|
||||||
|
* 'adsense_for_maps'
|
||||||
|
* 'adsense_pub_id'
|
||||||
|
* 'adsense_channel_id'
|
||||||
|
* 'adsense_max_ads'
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function set_map_atts( $atts=array() ) {
|
||||||
|
|
||||||
|
global $simple_map;
|
||||||
|
$locations = ! empty ( $_GET['location_ids'] ) ? explode( ',', $_GET['location_ids'] ) : array();
|
||||||
|
|
||||||
|
// Do atts for iframes
|
||||||
|
if ( isset( $_GET['sm_map_iframe'] ) ) {
|
||||||
|
// Set atts from GET vars
|
||||||
|
if ( ! empty( $_GET['map_width'] ) )
|
||||||
|
$atts['map_width'] = $_GET['map_width'];
|
||||||
|
if ( ! empty( $_GET['map_height'] ) )
|
||||||
|
$atts['map_height'] = $_GET['map_height'];
|
||||||
|
if ( ! empty( $_GET['pan_control'] ) )
|
||||||
|
$atts['panControl'] = $_GET['pan_control'];
|
||||||
|
if ( ! empty( $_GET['zoom_control'] ) )
|
||||||
|
$atts['zoomControl'] = $_GET['zoom_control'];
|
||||||
|
if ( ! empty( $_GET['scale_control'] ) )
|
||||||
|
$atts['scaleControl'] = $_GET['scale_control'];
|
||||||
|
if ( ! empty( $_GET['street_view_control'] ) )
|
||||||
|
$atts['streetViewControl'] = $_GET['street_view_control'];
|
||||||
|
if ( ! empty( $_GET['map_type_control'] ) )
|
||||||
|
$atts['mapTypeControl'] = $_GET['map_type_control'];
|
||||||
|
if ( ! empty( $_GET['map_type'] ) )
|
||||||
|
$atts['mapType'] = $_GET['map_type'];
|
||||||
|
if ( empty( $_GET['default_lat'] ) )
|
||||||
|
$atts['default_lat'] = get_post_meta( $locations[0], 'location_lat', true );
|
||||||
|
if ( empty( $_GET['default_lng'] ) )
|
||||||
|
$atts['default_lng'] = get_post_meta( $locations[0], 'location_lng', true );
|
||||||
|
if ( empty( $_GET['zoom_level'] ) )
|
||||||
|
$atts['zoom_level'] = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default Options
|
||||||
|
$defaults = $simple_map->get_options();
|
||||||
|
|
||||||
|
// Overwrite defaults with any vars passed in
|
||||||
|
$merged_atts = wp_parse_args( $atts, $defaults );
|
||||||
|
|
||||||
|
// Kick back to property
|
||||||
|
$this->map_atts = $merged_atts;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a location to the map
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function add_location( $location ) {
|
||||||
|
|
||||||
|
// $location can be a post object or a post ID. If its an object, grab the id
|
||||||
|
if ( is_object( $location ) )
|
||||||
|
$location = $location->ID;
|
||||||
|
|
||||||
|
// Build array of important post data
|
||||||
|
if ( $location_data = get_metadata( 'post', $location ) ) {
|
||||||
|
$location_array = array(
|
||||||
|
'id' => $location,
|
||||||
|
'lat' => ! empty( $location_data['location_lat'][0] ) ? $location_data['location_lat'][0] : false,
|
||||||
|
'lng' => ! empty( $location_data['location_lng'][0] ) ? $location_data['location_lng'][0] : false
|
||||||
|
);
|
||||||
|
|
||||||
|
if ( $location_array['lat'] && $location_array['lng'] )
|
||||||
|
$this->locations[$location] = $location_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A wrapper for add_location for use when loading an iframe
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function add_iframe_locations() {
|
||||||
|
|
||||||
|
// Add locations from GET string in iframe embed
|
||||||
|
$locations = ! empty ( $_GET['location_ids'] ) ? explode( ',', $_GET['location_ids'] ) : array();
|
||||||
|
foreach( $locations as $location ) {
|
||||||
|
$this->add_location( $location );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the map code
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function get_map() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the link for the iframe embed
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function get_iframe_embed() {
|
||||||
|
|
||||||
|
$atts = $this->map_atts;
|
||||||
|
$locations = array_keys( $this->locations );
|
||||||
|
|
||||||
|
$iframe = '<iframe width="' . $atts['map_width'] . '" height="' . $atts['map_height'] . '" frameborder=0 scrolling="no" src="' . esc_url( site_url() ) . '?sm_map_iframe=1&map_width=' . esc_attr( $atts['map_width'] ) . '&map_height=' . esc_attr( $atts['map_height'] ) . '&location_ids=' . esc_attr( implode( ',', $locations ) ) . '"></iframe>';
|
||||||
|
|
||||||
|
return $iframe;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the actual iframe
|
||||||
|
*
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
function generate_iframe() {
|
||||||
|
|
||||||
|
if ( ! empty( $_GET['sm_map_iframe'] ) ) {
|
||||||
|
global $simple_map;
|
||||||
|
$this->set_map_atts();
|
||||||
|
$atts = $this->map_atts;
|
||||||
|
|
||||||
|
wp_enqueue_script('jquery');
|
||||||
|
?>
|
||||||
|
<html style='margin-top:0 !important;padding-top:0 !important;'>
|
||||||
|
<head>
|
||||||
|
<?php wp_head(); ?>
|
||||||
|
<style type='text/css'>* { margin:0; padding:0; }</style>
|
||||||
|
<script src="<?php echo esc_url( SIMPLEMAP_MAPS_JS_API . '?v=3&sensor=false&language=' . $atts['default_language'] . '&region=' . $atts['default_country'] ); ?>" type="text/javascript"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var map = null;
|
||||||
|
var geocoder = null;
|
||||||
|
var latlng = new google.maps.LatLng( '<?php echo esc_js( $atts['default_lat'] ) ;?>', '<?php echo esc_js( $atts['default_lng'] ); ?>' );
|
||||||
|
|
||||||
|
function initialize() {
|
||||||
|
var myOptions = {
|
||||||
|
zoom: parseInt(<?php echo esc_js( $atts['zoom_level'] ); ?>),
|
||||||
|
center: latlng,
|
||||||
|
panControl: <?php echo ($atts['panControl']) ? 'true' : 'false'; ?>,
|
||||||
|
zoomControl: <?php echo ($atts['zoomControl']) ? 'true' : 'false'; ?>,
|
||||||
|
scaleControl: <?php echo ($atts['scaleControl']) ? 'true' : 'false'; ?>,
|
||||||
|
streetViewControl: <?php echo ($atts['streetViewControl']) ? 'true' : 'false'; ?>,
|
||||||
|
mapTypeControl: <?php echo ($atts['mapTypeControl']) ? 'true' : 'false'; ?>,
|
||||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
||||||
|
draggable: false
|
||||||
|
};
|
||||||
|
|
||||||
|
map = new google.maps.Map( document.getElementById( "map_canvas" ), myOptions );
|
||||||
|
geocoder = new google.maps.Geocoder();
|
||||||
|
}
|
||||||
|
|
||||||
|
function addMapMarkers() {
|
||||||
|
|
||||||
|
var markersArray = [];
|
||||||
|
<?php foreach( $this->locations as $location ) { ?>
|
||||||
|
|
||||||
|
<?php $customvals = get_metadata( 'post', $location['id'] ); ?>
|
||||||
|
|
||||||
|
var name = '<?php echo esc_js( get_the_title( $location['id'] ) ); ?>';
|
||||||
|
var address = '<?php echo esc_js( $customvals['location_address'][0] ); ?>';
|
||||||
|
var address2 = '<?php echo esc_js( $customvals['location_address2'][0] ); ?>';
|
||||||
|
var city = '<?php echo esc_js( $customvals['location_city'][0] ); ?>';
|
||||||
|
var state = '<?php echo esc_js( $customvals['location_state'][0] ); ?>';
|
||||||
|
var zip = '<?php echo esc_js( $customvals['location_zip'][0] ); ?>';
|
||||||
|
var country = '<?php echo esc_js( $customvals['location_country'][0] ); ?>';
|
||||||
|
var email = '<?php echo esc_js( $customvals['location_email'][0] ); ?>';
|
||||||
|
var url = '<?php echo esc_js( $customvals['location_url'][0] ); ?>';
|
||||||
|
var phone = '<?php echo esc_js( $customvals['location_phone'][0] ); ?>';
|
||||||
|
var fax = '<?php echo esc_js( $customvals['location_fax'][0] ); ?>';
|
||||||
|
var special = '<?php echo esc_js( $customvals['location_special'][0] ); ?>';
|
||||||
|
|
||||||
|
map.setCenter(latlng, 13);
|
||||||
|
var markerOptions = {};
|
||||||
|
if ( 'function' == typeof window.simplemapCustomMarkers ) {
|
||||||
|
markerOptions = simplemapCustomMarkers( name, address, address2, city, state, zip, country, '', url, phone, fax, email, special, '', '', '');
|
||||||
|
}
|
||||||
|
markerOptions.map = map;
|
||||||
|
|
||||||
|
markerOptions.position = new google.maps.LatLng( '<?php echo esc_js( $location['lat'] ) ;?>', '<?php echo esc_js( $location['lng'] ); ?>' );
|
||||||
|
var marker = new google.maps.Marker( markerOptions );
|
||||||
|
markersArray.push(marker);
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
}
|
||||||
|
jQuery(document).ready( function() { initialize(); addMapMarkers(); } );
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="map_canvas" style="height: <?php echo esc_attr( $_GET['map_height'] ); ?>; width: <?php echo esc_attr( $_GET['map_width'] ); ?>; border: 1px solid #eee; overflow: hidden"></div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?php
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
755
classes/options-general.php
Normal file
|
@ -0,0 +1,755 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_Options' ) ) {
|
||||||
|
class SM_Options{
|
||||||
|
|
||||||
|
// update options of form submission
|
||||||
|
function sm_options() {
|
||||||
|
add_action( 'admin_init', array( &$this, 'update_options' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Processes Options form if loaded
|
||||||
|
function update_options() {
|
||||||
|
global $simple_map, $sm_locations;
|
||||||
|
|
||||||
|
// Delete all SimpleMap data.
|
||||||
|
if ( isset( $_GET['sm-action'] ) && 'delete-simplemap' == $_GET['sm-action'] ) {
|
||||||
|
// Confirm we have both permisssion to do this and we have intent to do this.
|
||||||
|
if ( current_user_can( 'manage_options' ) && ( check_admin_referer( 'delete-simplemap-locations' ) || check_admin_referer( 'delete-simplemap' ) ) ) {
|
||||||
|
// Delete locations
|
||||||
|
while ( $locations = query_posts( array( 'post_type' => 'sm-location', 'posts_per_page' => 200 ) ) ) {
|
||||||
|
// Delete posts (and therby postmeta as well). Second arg bypasses trash
|
||||||
|
foreach ( $locations as $key => $location ) {
|
||||||
|
set_time_limit( 20 );
|
||||||
|
wp_delete_post( $location->ID, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
$taxonomies = $options['taxonomies'];
|
||||||
|
|
||||||
|
$original_taxonomies = array_keys( $simple_map->get_taxonomy_settings() );
|
||||||
|
|
||||||
|
if ( is_array( $original_taxonomies ) ) {
|
||||||
|
foreach ( $original_taxonomies as $taxonomy ) {
|
||||||
|
$taxonomies[$taxonomy] = true;
|
||||||
|
if ( ! taxonomy_exists( $taxonomy ) ) {
|
||||||
|
$sm_locations->register_location_taxonomy( $taxonomy, array() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete taxonomy terms
|
||||||
|
$args = array( 'hide_empty' => 0 );
|
||||||
|
if ( $terms = get_terms( array_keys( $taxonomies ), $args ) ) {
|
||||||
|
foreach ( $terms as $key => $term ) {
|
||||||
|
wp_delete_term( $term->term_id, $term->taxonomy );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete Options
|
||||||
|
if ( get_option( 'SimpleMap_options' ) && empty( $_GET['locations-only'] ) ) {
|
||||||
|
delete_option( 'SimpleMap_options' );
|
||||||
|
}
|
||||||
|
|
||||||
|
do_action( 'sm-delete-all-data' );
|
||||||
|
|
||||||
|
wp_safe_redirect( admin_url( 'admin.php?page=simplemap' ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
// Update Options if form was submitted or if WordPress options doesn't exist yet.
|
||||||
|
if ( isset( $_POST['sm_general_options_submitted'] ) ) {
|
||||||
|
check_admin_referer( 'sm-general-options' );
|
||||||
|
|
||||||
|
$new_options = $options;
|
||||||
|
|
||||||
|
// Validate POST Options
|
||||||
|
//$new_options['api_key'] = ( ! empty( $_POST['api_key'] ) ) ? $_POST['api_key'] : '';
|
||||||
|
$new_options['map_width'] = ( ! empty( $_POST['map_width'] ) ) ? $_POST['map_width'] : $options['map_width'];
|
||||||
|
$new_options['map_height'] = ( ! empty( $_POST['map_height'] ) ) ? $_POST['map_height'] : $options['map_height'];
|
||||||
|
$new_options['default_lat'] = ( ! empty( $_POST['default_lat'] ) ) ? $_POST['default_lat'] : $options['default_lat'] ;
|
||||||
|
$new_options['default_lng'] = ( ! empty( $_POST['default_lng'] ) ) ? $_POST['default_lng'] : $options['default_lng'] ;
|
||||||
|
$new_options['zoom_level'] = ( isset( $_POST['zoom_level'] ) ) ? absint( $_POST['zoom_level'] ) : $options['zoom_level'] ;
|
||||||
|
$new_options['default_radius'] = ( ! empty( $_POST['default_radius'] ) ) ? absint( $_POST['default_radius'] ) : $options['default_radius'] ;
|
||||||
|
$new_options['map_type'] = ( ! empty( $_POST['map_type'] ) ) ? $_POST['map_type'] : $options['map_type'];
|
||||||
|
$new_options['special_text'] = ( isset( $_POST['special_text'] ) ) ? $_POST['special_text'] : $options['special_text'];
|
||||||
|
$new_options['default_state'] = ( ! empty( $_POST['default_state'] ) ) ? $_POST['default_state'] : $options['default_state'];
|
||||||
|
$new_options['default_country'] = ( ! empty( $_POST['default_country'] ) ) ? esc_attr( $_POST['default_country'] ) : $options['default_country'];
|
||||||
|
$new_options['default_language'] = ( ! empty( $_POST['default_language'] ) ) ? esc_attr( $_POST['default_language'] ) : $options['default_language'];
|
||||||
|
$new_options['default_domain'] = ( ! empty( $_POST['default_domain'] ) ) ? $_POST['default_domain'] : $options['default_domain'];
|
||||||
|
$new_options['address_format'] = ( ! empty( $_POST['address_format'] ) ) ? $_POST['address_format'] : $options['address_format'];
|
||||||
|
$new_options['map_stylesheet'] = ( ! empty( $_POST['map_stylesheet'] ) ) ? $_POST['map_stylesheet'] : $options['map_stylesheet'];
|
||||||
|
$new_options['units'] = ( ! empty( $_POST['units'] ) ) ? $_POST['units'] : $options['units'];
|
||||||
|
$new_options['results_limit'] = ( isset( $_POST['results_limit'] ) ) ? absint( $_POST['results_limit'] ) : $options['results_limit'];
|
||||||
|
$new_options['autoload'] = ( ! empty( $_POST['autoload'] ) ) ? $_POST['autoload'] : $options['autoload'];
|
||||||
|
$new_options['map_pages'] = ( isset( $_POST['map_pages'] ) ) ? $_POST['map_pages'] : $options['map_pages'];
|
||||||
|
$new_options['lock_default_location'] = ( ! empty( $_POST['lock_default_location'] ) ) ? true : $options['lock_default_location'];
|
||||||
|
$new_options['powered_by'] = ( isset( $_POST['powered_by'] ) && 'on' == $_POST['powered_by'] ) ? 1 : 0;
|
||||||
|
$new_options['enable_permalinks'] = ( isset( $_POST['enable_permalinks'] ) && 'on' == $_POST['enable_permalinks'] ) ? 1 : 0;
|
||||||
|
$new_options['permalink_slug'] = ( ! empty( $_POST['permalink_slug'] ) ) ? $_POST['permalink_slug'] : $options['permalink_slug'];
|
||||||
|
$new_options['adsense_for_maps'] = ( isset( $_POST['adsense_for_maps'] ) && 'on' == $_POST['adsense_for_maps'] ) ? 1 : 0;
|
||||||
|
$new_options['adsense_pub_id'] = ( isset( $_POST['adsense_pub_id'] ) ) ? $_POST['adsense_pub_id'] : $options['adsense_pub_id'];
|
||||||
|
$new_options['adsense_channel_id'] = ( isset( $_POST['adsense_channel_id'] ) ) ? $_POST['adsense_channel_id'] : $options['adsense_channel_id'];
|
||||||
|
$new_options['adsense_max_ads'] = ( isset( $_POST['adsense_max_ads'] ) ) ? absint( $_POST['adsense_max_ads'] ) : $options['adsense_max_ads'];
|
||||||
|
$new_options['display_search'] = ( ! empty( $_POST['display_search'] ) ) ? $_POST['display_search'] : $options['display_search'];
|
||||||
|
$new_options['auto_locate'] = ( isset( $_POST['auto_locate'] ) ) ? $_POST['auto_locate'] : $options['auto_locate'];
|
||||||
|
|
||||||
|
foreach ( $new_options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
if ( isset( $_POST['taxonomies'][$taxonomy]['active'] ) ) {
|
||||||
|
$new_tax_options = $_POST['taxonomies'][$taxonomy];
|
||||||
|
unset($new_tax_options['active']);
|
||||||
|
//echo 'UPDATE(' . $taxonomy . ' - ' . json_encode( array_diff_assoc( array_filter( $new_tax_options ), $tax_info ) ) . ')' . PHP_EOL;
|
||||||
|
$new_options['taxonomies'][$taxonomy] = array_filter( $new_tax_options ) + $tax_info;
|
||||||
|
unset($_POST['taxonomies'][$taxonomy]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//echo 'DISABLE(' . $taxonomy . ')' . PHP_EOL;
|
||||||
|
unset($new_options['taxonomies'][$taxonomy]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $_POST['taxonomies'] ) ) {
|
||||||
|
foreach ( $_POST['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
if ( isset( $tax_info['active'] ) ) {
|
||||||
|
//echo 'ENABLE(' . $taxonomy . ')' . PHP_EOL;
|
||||||
|
$new_options['taxonomies'][$taxonomy] = $simple_map->get_taxonomy_settings( $taxonomy );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$new_options = apply_filters( 'sm-new-general-options', $new_options, $options );
|
||||||
|
|
||||||
|
if ( $new_options !== $options && update_option( 'SimpleMap_options', $new_options ) ) {
|
||||||
|
if ( $new_options['enable_permalinks'] !== $options['enable_permalinks'] || $new_options['permalink_slug'] !== $options['permalink_slug'] ) {
|
||||||
|
update_option( 'sm-rewrite-rules', true );
|
||||||
|
}
|
||||||
|
|
||||||
|
do_action( 'sm-general-options-updated' );
|
||||||
|
wp_redirect( admin_url( 'admin.php?page=simplemap&sm-msg=1' ) );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prints the options page
|
||||||
|
function print_page(){
|
||||||
|
global $simple_map, $wpdb;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
extract( $options );
|
||||||
|
|
||||||
|
// Set Autoload Vars
|
||||||
|
$count = $wpdb->get_col( "SELECT COUNT(ID) FROM `" . $wpdb->posts . "` WHERE post_type = 'sm-location' AND post_status = 'publish'" );
|
||||||
|
|
||||||
|
if ( $count >= 250 ) {
|
||||||
|
$disabled_autoload = false; // let it happen. we're limiting to 500 in the query
|
||||||
|
$disabledmsg = sprintf( __( 'You have to many locations to auto-load them all. Only the closest %d will be displayed if auto-load all is selected.', 'SimpleMap' ), '250' );
|
||||||
|
} else {
|
||||||
|
$disabled_autoload = false;
|
||||||
|
$disabledmsg = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract styles
|
||||||
|
$themes1 = $themes2 = array();
|
||||||
|
|
||||||
|
if ( file_exists( SIMPLEMAP_PATH . '/inc/styles' ) )
|
||||||
|
$themes1 = $this->read_styles( SIMPLEMAP_PATH . '/inc/styles' );
|
||||||
|
|
||||||
|
if ( file_exists( WP_PLUGIN_DIR . '/simplemap-styles' ) )
|
||||||
|
$themes2 = $this->read_styles( WP_PLUGIN_DIR . '/simplemap-styles' );
|
||||||
|
|
||||||
|
$themes1 = apply_filters( 'sm-general-options-themes1', $themes1 );
|
||||||
|
$themes2 = apply_filters( 'sm-general-options-themes1', $themes2 );
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Title
|
||||||
|
$sm_page_title = apply_filters( 'sm-general-options-page-title', 'SimpleMap: General Options' );
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
$simple_map->show_toolbar( $sm_page_title );
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
if ( isset( $_GET['sm-msg'] ) && '1' == $_GET['sm-msg'] )
|
||||||
|
echo '<div class="updated fade"><p>'.__('SimpleMap settings saved.', 'SimpleMap').'</p></div>';
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="dashboard-widgets-wrap" class="clear">
|
||||||
|
|
||||||
|
<form method="post" action="">
|
||||||
|
<input type="hidden" name="sm_general_options_submitted" value="1" />
|
||||||
|
|
||||||
|
<?php wp_nonce_field( 'sm-general-options' ); ?>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-page-top' ); ?>
|
||||||
|
|
||||||
|
<div id='dashboard-widgets' class='metabox-holder'>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-dash-widgets-top' ); ?>
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%;'>
|
||||||
|
|
||||||
|
<div id='normal-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-normal-sortables-top' ); ?>
|
||||||
|
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Location Defaults', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside">
|
||||||
|
<p class="sub"><?php _e( 'If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier.', 'SimpleMap' ); ?></p>
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="default_domain"><?php _e( 'Google Maps Domain', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="default_domain" id="default_domain">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_domain_options() as $key => $value ) {
|
||||||
|
echo "<option value='" . $value . "' " . selected( $default_domain, $value, false ) . ">" . $key . " (" . $value . ")</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="default_country"><?php _e( 'Default Country', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="default_country" id="default_country">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_country_options() as $key => $value ) {
|
||||||
|
echo "<option value='" . $key . "' " . selected( $default_country, $key, false ) . ">" . $value . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="default_language"><?php _e( 'Default Language', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="default_language" id="default_language">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_language_options() as $key => $value ) {
|
||||||
|
echo "<option value='" . $key . "' " . selected( $default_language, $key, false ) . ">" . $value . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td scope="row"><label for="default_state"><?php _e( 'Default State/Province', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td><input type="text" name="default_state" id="default_state" size="30" value="<?php echo $default_state; ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="address_format"><?php _e( 'Address Format', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select id="address_format" name="address_format">
|
||||||
|
<option value="town, province postalcode" <?php selected( $address_format, 'town, province postalcode' ); ?>><?php echo '[' . __( 'City/Town', 'SimpleMap' ) . '], [' . __( 'State/Province', 'SimpleMap' ) . '] [' . __( 'Zip/Postal Code', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="town province postalcode" <?php selected( $address_format, 'town province postalcode' ); ?>><?php echo '[' . __( 'City/Town', 'SimpleMap' ) . '] [' . __( 'State/Province', 'SimpleMap' ) . '] [' . __( 'Zip/Postal Code', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="town-province postalcode" <?php selected( $address_format, 'town-province postalcode' ); ?>><?php echo '[' . __( 'City/Town', 'SimpleMap' ) . '] - [' . __( 'State/Province', 'SimpleMap' ) . '] [' . __('Zip/Postal Code', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="postalcode town-province" <?php selected( $address_format, 'postalcode town-province' ); ?>><?php echo '[' . __( 'Zip/Postal Code', 'SimpleMap' ) . '] [' . __( 'City/Town', 'SimpleMap' ) . '] - [' . __( 'State/Province', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="postalcode town, province" <?php selected( $address_format, 'postalcode town, province' ); ?>><?php echo '[' . __( 'Zip/Postal Code', 'SimpleMap' ) . '] [' . __( 'City/Town', 'SimpleMap' ) . '], [' . __( 'State/Province', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="postalcode town" <?php selected( $address_format, 'postalcode town' ); ?>><?php echo '[' . __( 'Zip/Postal Code', 'SimpleMap' ) . '] [' . __( 'City/Town', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
|
||||||
|
<option value="town postalcode" <?php selected( $address_format, 'town postalcode' ); ?>><?php echo '[' . __( 'City/Town', 'SimpleMap' ) . '] [' . __( 'Zip/Postal Code', 'SimpleMap' ) . ']'; ?></option>
|
||||||
|
</select>
|
||||||
|
<span class="hidden" id="order_1"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: Minneapolis, MN 55403</span>
|
||||||
|
<span class="hidden" id="order_2"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: Minneapolis MN 55403</span>
|
||||||
|
<span class="hidden" id="order_3"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: São Paulo - SP 85070</span>
|
||||||
|
<span class="hidden" id="order_4"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: 85070 São Paulo - SP</span>
|
||||||
|
<span class="hidden" id="order_5"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: 46800 Puerto Vallarta, JAL</span>
|
||||||
|
<span class="hidden" id="order_6"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: 126 25 Stockholm</span>
|
||||||
|
<span class="hidden" id="order_7"><br /><?php _e( 'Example', 'SimpleMap' ); ?>: London EC1Y 8SY</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div> <!-- table -->
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'SimpleMap' ) ?>" /><br /><br />
|
||||||
|
</p>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### MAP CONFIGURATION #### -->
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Map Configuration', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside">
|
||||||
|
<p class="sub"><?php printf( __( 'See %s the Help page%s for an explanation of these options.', 'SimpleMap' ), '<a href="' . get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=simplemap-help">', '</a> ' ); ?></p>
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
<?php /*
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="api_key"><?php _e( 'Google Maps API Key', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="api_key" id="api_key" size="50" value="<?php echo esc_attr( $api_key ); ?>" /><br />
|
||||||
|
<small><em><?php printf( __( '%s Click here%s to sign up for a Google Maps API key for your domain.', 'SimpleMap' ), '<a href="' . $simple_map->get_api_link() . '">', '</a>'); ?></em></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
*/ ?>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( TRUE ) {
|
||||||
|
$disabled_api = false;
|
||||||
|
$api_how_to = __( 'Type in an address, state, or zip to geocode the default location.', 'SimpleMap' );
|
||||||
|
} else {
|
||||||
|
$disabled_api = true;
|
||||||
|
$api_how_to = __( 'After you enter an API Key, you can type in an address, state, or zip here to geocode the default location.', 'SimpleMap' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<td width="150"><label for="default_lat"><?php _e( 'Starting Location', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<label for="default_lat" style="display: inline-block; width: 60px;"><?php _e( 'Latitude:', 'SimpleMap' ); ?> </label>
|
||||||
|
<input type="text" name="default_lat" id="default_lat" size="13" value="<?php echo esc_attr( $default_lat ); ?>" /><br />
|
||||||
|
<label for="default_lng" style="display: inline-block; width: 60px;"><?php _e( 'Longitude:', 'SimpleMap' ); ?> </label>
|
||||||
|
<input type="text" name="default_lng" id="default_lng" size="13" value="<?php echo esc_attr( $default_lng ); ?>" />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input <?php disabled( $disabled_api ); ?> type="text" name="default_address" id="default_address" size="30" value="" /> <a class="button" <?php disabled( $disabled_api ); ?> onclick="codeAddress();return false;" href="#"><?php _e( 'Geocode Address', 'SimpleMap' ); ?></a>
|
||||||
|
<br /><small><span class='howto'><?php echo $api_how_to; ?></span></small>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="units"><?php _e( 'Distance Units', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="units" id="units">
|
||||||
|
<option value="mi" <?php selected( $units, 'mi' ); ?>><?php _e( 'Miles', 'SimpleMap' ); ?></option>
|
||||||
|
<option value="km" <?php selected( $units, 'km' ); ?>><?php _e( 'Kilometers', 'SimpleMap' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="default_radius"><?php _e( 'Default Search Radius', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="default_radius" id="default_radius">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_search_radii() as $value ) {
|
||||||
|
echo "<option value='" . esc_attr( $value ) . "' " . selected( $value, $default_radius, false ) . ">" . esc_attr( $value ) . " " . esc_attr( $units ) . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="results_limit"><?php _e( 'Number of Results to Display', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="results_limit" id="results_limit">
|
||||||
|
<option value="0" <?php selected( $results_limit, 0 ); ?>>No Limit</option>
|
||||||
|
<?php
|
||||||
|
for ( $i = 5; $i <= 50; $i += 5 ) {
|
||||||
|
echo "<option value='" . esc_attr( $i ) . "' " . selected( $results_limit, $i, false ) . ">" . esc_attr( $i ) . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<small><span class='howto'><?php _e( 'Select "No Limit" to display all results within the search radius.', 'SimpleMap' ); ?></span></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="autoload"><?php _e( 'Auto-Load Database', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="autoload" id="autoload">
|
||||||
|
<option value="none" <?php selected( $autoload, 'none' ); ?>><?php _e( 'No auto-load', 'SimpleMap' ); ?></option>
|
||||||
|
<option value="some" <?php selected( $autoload, 'some' ); ?>><?php _e('Auto-load search results', 'SimpleMap'); ?></option>
|
||||||
|
<option value="all" <?php selected( $autoload, 'all' );?> <?php disabled( $disabled_autoload ); ?>><?php _e('Auto-load all locations', 'SimpleMap'); ?></option>
|
||||||
|
</select>
|
||||||
|
<br />
|
||||||
|
<small><em><?php _e( sprintf ( '%sNo auto-load%s shows map without any locations.%s%sAuto-load search results%s displays map based on default values for search form.%s%sAuto-load all%s ignores default search form values and loads all locations.', '<strong>', '</strong>', '<br />', '<strong>', '</strong>', '<br />', '<strong>', '</strong>' ) ); ?></em></small>
|
||||||
|
<?php if ( $disabledmsg != '' ) { echo '<br /><small style="color:red";><em>' . $disabledmsg . '</small></em>'; } ?>
|
||||||
|
|
||||||
|
<!--<br /><label for="lock_default_location" id="lock_default_location_label"><input type="checkbox" name="lock_default_location" id="lock_default_location" value="1" <?php checked( $lock_default_location ); ?> /> <?php _e('Stick to default location set above', 'SimpleMap'); ?></label>-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="zoom_level"><?php _e('Default Zoom Level', 'SimpleMap'); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="zoom_level" id="zoom_level">
|
||||||
|
<option value='0' <?php selected( $zoom_level, 0 ); ?> >Auto Zoom</option>
|
||||||
|
<?php
|
||||||
|
for ( $i = 1; $i <= 19; $i++ ) {
|
||||||
|
echo "<option value='" . esc_attr( $i ) . "' " . selected( $zoom_level, $i, false ) . ">" . esc_attr( $i ) . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<small><em><?php _e( '1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in.', 'SimpleMap' ); ?></em></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="special_text"><?php _e( 'Special Location Label', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="special_text" id="special_text" size="30" value="<?php echo esc_attr( $special_text ); ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="map_pages"><?php _e( 'Map Page IDs', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="map_pages" id="map_pages" size="30" value="<?php echo esc_attr( $map_pages ); ?>" /><br />
|
||||||
|
<small><em><?php _e( 'Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages.', 'SimpleMap' ); ?></em></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div> <!-- table -->
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'SimpleMap' ) ?>" /><br /><br />
|
||||||
|
</p>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<!-- Optional Features -->
|
||||||
|
<div class="postbox">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Optional / Experimental Features', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside">
|
||||||
|
<p class="sub"><?php printf( __( 'See %s the Help page%s for an explanation of these options.', 'SimpleMap' ), '<a href="' . get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=simplemap-help">', '</a> ' ); ?></p>
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><?php _e( 'Permalinks', 'SimpleMap' ); ?></td>
|
||||||
|
<td>
|
||||||
|
<label for="enable_permalinks"><input type="checkbox" name="enable_permalinks" id="enable_permalinks" <?php checked( $enable_permalinks ); ?> /> <?php _e( 'Enable location permalinks?', 'SimpleMap' ); ?></label>
|
||||||
|
<br /><label for="permalink_slug"><small><?php _e( 'Location permalink folder?', 'SimpleMap' ); ?></small> <input type="text" name="permalink_slug" id="permalink_slug" value="<?php echo esc_attr( $permalink_slug ); ?>" /></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><?php _e( 'Location Taxonomies', 'SimpleMap' ); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
$standard_taxonomies = $simple_map->get_taxonomy_settings();
|
||||||
|
$taxonomies += $standard_taxonomies;
|
||||||
|
foreach ( $taxonomies as $taxonomy => $tax_info ) {
|
||||||
|
$safe = str_replace( '-', '_', $taxonomy );
|
||||||
|
$label = isset( $tax_info['description'] ) ? $tax_info['description'] : str_replace( 'sm-', '', $taxonomy );
|
||||||
|
$active = !empty( $options['taxonomies'][$taxonomy] );
|
||||||
|
echo '<label for="taxonomies_' . $safe . '"><input type="checkbox" name="taxonomies[' . $taxonomy . '][active]" id="taxonomies_' . $safe . '" ' . checked( $active, true, false ) . ' /> ' . __( 'Enable ' . $label . ' taxonomies?', 'SimpleMap' ) . '</label>';
|
||||||
|
echo '<br />';
|
||||||
|
if ( $active && !isset( $standard_taxonomies[$taxonomy] ) ) {
|
||||||
|
echo '<div style="margin: 5px 0px 5px 15px; padding: 5px; border: 1px solid #ccc;">';
|
||||||
|
echo '<label for="taxonomies_' . $safe . '_singular">' . __( 'Singular Form', 'SimpleMap' );
|
||||||
|
echo ': <input type="text" name="taxonomies[' . $taxonomy . '][singular]" id="taxonomies_' . $safe . '_singular" value="' . esc_attr( $tax_info['singular'] ) . '" /></label>';
|
||||||
|
echo '<br />';
|
||||||
|
echo '<label for="taxonomies_' . $safe . '_plural">' . __( 'Plural Form', 'SimpleMap' );
|
||||||
|
echo ': <input type="text" name="taxonomies[' . $taxonomy . '][plural]" id="taxonomies_' . $safe . '_plural" value="' . esc_attr( $tax_info['plural'] ) . '" /></label>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '<br />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><?php _e( 'Google Adsense for Maps', 'SimpleMap' ); ?></td>
|
||||||
|
<td>
|
||||||
|
<label for="adsense_for_maps"><input type="checkbox" name="adsense_for_maps" id="adsense_for_maps" <?php checked( $adsense_for_maps ); ?> /> <?php _e( 'Enable Adense for Maps?', 'SimpleMap' ); ?></label>
|
||||||
|
<br /><label for="adsense_pub_id"><small><?php _e( 'Default Adsense Publisher ID:', 'SimpleMap' ); ?></small> <input type="text" name="adsense_pub_id" id="adsense_pub_id" size="30" value="<?php echo esc_attr( $adsense_pub_id ); ?>" /></label>
|
||||||
|
<br /><label for="adsense_channel_id"><small><?php _e( 'Default Adsense Channel ID:', 'SimpleMap' ); ?></small> <input type="text" name="adsense_channel_id" id="adsense_channel_id" size="30" value="<?php echo esc_attr( $adsense_channel_id ); ?>" /></label>
|
||||||
|
<br /><label for="adsense_max_ads"><small><?php _e( 'Max number of ads on map:', 'SimpleMap' ); ?></small> <input type="text" name="adsense_max_ads" id="adsense_max_ads" size="10" value="<?php echo esc_attr( $adsense_max_ads ); ?>" /></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="auto_locate"><?php _e( 'Auto-detect Location', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="auto_locate" id="auto_locate">
|
||||||
|
<?php
|
||||||
|
foreach ( $simple_map->get_auto_locate_options() as $value => $label ) {
|
||||||
|
echo "<option value='" . esc_attr( $value ) . "' " . selected( $value, $auto_locate, false ) . ">" . esc_attr( $label ) . "</option>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<small><span class='howto'><?php _e( 'IP based detection does not prompt the user for permission and is faster than HTML5. HTML5 is more precise.' ); ?></span></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'SimpleMap' ) ?>" /><br /><br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-normal-sortables-bottom' ); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='postbox-container' style='width:49%;'>
|
||||||
|
|
||||||
|
<div id='side-sortables' class='meta-box-sortables ui-sortable'>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-side-sortables-top' ); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### PREMIUM SUPPORT #### -->
|
||||||
|
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3 style='color:#fff;text-shadow:0 1px 0 #000;background: #fff url( <?php echo SIMPLEMAP_URL; ?>/inc/images/blue-grad.png ) top left repeat-x;'><?php _e( 'Premium Support and Features', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside" style='padding: 0pt 10px 10px;' >
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Check for premium support status
|
||||||
|
global $simplemap_ps;
|
||||||
|
|
||||||
|
if ( ! url_has_ftps_for_item( $simplemap_ps ) ) : ?>
|
||||||
|
|
||||||
|
<h4><?php printf( __( 'SimpleMap Premium Support Benefits', 'SimpleMap' ), esc_attr( site_url() ) ); ?></h4>
|
||||||
|
<p>
|
||||||
|
<?php printf( __( 'SimpleMap now offers a premium support package for the low cost of %s per year per domain.', 'SimpleMap' ), '$30.00 USD' ); ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?php _e( 'By signing up for SimpleMap premium support, you help to ensure future enhancements to this excellent project as well as the following benefits:', 'SimpleMap' ); ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:disc'>
|
||||||
|
<li><?php _e( 'Around the clock access to our extensive knowledge base and support forum from within your WordPress dashboard', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'Professional and timely response times to all your questions from the SimpleMap team', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 10% discount for any custom functionality you request from the SimpleMap developers', 'SimpleMap' ); ?></li>
|
||||||
|
<li><?php _e( 'A 6-12 month advance access to new features integrated into the auto upgrade functionality of WordPress', 'SimpleMap' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul style='margin-left:25px;list-style-type:none'>
|
||||||
|
<li><a href='<?php echo get_ftps_paypal_button( $simplemap_ps ); ?>'><?php _e( 'Signup Now', 'SimpleMap' ); ?></a></li>
|
||||||
|
<li><a target='_blank' href='<?php echo get_ftps_learn_more_link( $simplemap_ps ); ?>'><?php _e( 'Learn More', 'SimpleMap' ); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
<?php else : ?>
|
||||||
|
|
||||||
|
<p class='howto'><?php printf( "Your premium support for <code>%s</code> was purchased on <code>%s</code> by <code>%s</code> (%s). It will remain valid for this URL until <code>%s</code>.", get_ftps_site( $simplemap_ps ), date( "F d, Y", get_ftps_purchase_date( $simplemap_ps ) ), get_ftps_name( $simplemap_ps ), get_ftps_email( $simplemap_ps ), date( "F d, Y", get_ftps_exp_date( $simplemap_ps ) ) ); ?></p>
|
||||||
|
<p><a href='#' id='premium_help'><?php _e( 'Launch Premium Support widget', 'SimpleMap' ); ?></a> | <a target="blank" href="http://support.simplemap-plugin.com?sso=<?php echo get_ftps_sso_key( $simplemap_ps ); ?>"><?php _e( 'Visit Premium Support web site', 'SimpleMap' );?></a></p>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
Tender = {
|
||||||
|
hideToggle: true,
|
||||||
|
sso: "<?php echo get_ftps_sso_key( $simplemap_ps ); ?>",
|
||||||
|
widgetToggles: [document.getElementById('premium_help')]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="https://simplemap.tenderapp.com/tender_widget.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### MAP STYLES #### -->
|
||||||
|
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3><?php _e( 'Map Style Defaults', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside">
|
||||||
|
<p class="sub"><?php printf( __( 'To insert SimpleMap into a post or page, type this shortcode in the body: %s', 'SimpleMap' ), '<code>[simplemap]</code>' ); ?></p>
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table class="form-table">
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="150"><label for="map_width"><?php _e( 'Map Size', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<label for="map_width" style="display: inline-block; width: 60px;"><?php _e( 'Width:', 'SimpleMap' ); ?> </label>
|
||||||
|
<input type="text" name="map_width" id="map_width" size="13" value="<?php echo esc_attr( $map_width ); ?>" /><br />
|
||||||
|
<label for="map_height" style="display: inline-block; width: 60px;"><?php _e( 'Height:', 'SimpleMap' ); ?> </label>
|
||||||
|
<input type="text" name="map_height" id="map_height" size="13" value="<?php echo esc_attr( $map_height ); ?>" /><br />
|
||||||
|
<small><em><?php printf( __( 'Enter a numeric value with CSS units, such as %s or %s.', 'SimpleMap' ), '</em><code>100%</code><em>', '</em><code>500px</code><em>' ); ?></em></small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="map_type"><?php _e( 'Default Map Type', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<div class="radio-thumbnail<?php if ( 'ROADMAP' == $map_type ) { echo ' radio-thumbnail-current'; } ?>">
|
||||||
|
<label style="display: block;" for="map_type_normal">
|
||||||
|
<img src="<?php echo SIMPLEMAP_URL; ?>/inc/images/map-type-normal.jpg" width="100" height="100" style="border: 1px solid #999;" /><br /><?php _e('Road map', 'SimpleMap'); ?><br />
|
||||||
|
<input type="radio" style="border: none;" name="map_type" id="map_type_normal" value="ROADMAP" <?php checked( $map_type, 'ROADMAP' ); ?> />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="radio-thumbnail<?php if ( 'SATELLITE' == $map_type ) { echo ' radio-thumbnail-current'; } ?>">
|
||||||
|
<label style="display: block;" for="map_type_satellite">
|
||||||
|
<img src="<?php echo SIMPLEMAP_URL; ?>/inc/images/map-type-satellite.jpg" width="100" height="100" style="border: 1px solid #999;" /><br /><?php _e('Satellite map', 'SimpleMap'); ?><br />
|
||||||
|
<input type="radio" style="border: none;" name="map_type" id="map_type_satellite" value="SATELLITE" <?php checked( $map_type, 'SATELLITE' ); ?> />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="radio-thumbnail<?php if ( 'HYBRID' == $map_type ) { echo ' radio-thumbnail-current'; } ?>">
|
||||||
|
<label style="display: block;" for="map_type_hybrid">
|
||||||
|
<img src="<?php echo SIMPLEMAP_URL; ?>/inc/images/map-type-hybrid.jpg" width="100" height="100" style="border: 1px solid #999;" /><br /><?php _e('Hybrid map', 'SimpleMap'); ?><br />
|
||||||
|
<input type="radio" style="border: none;" name="map_type" id="map_type_hybrid" value="HYBRID" <?php checked( $map_type, 'HYBRID' ); ?> />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="radio-thumbnail<?php if ( 'TERRAIN' == $map_type ) { echo ' radio-thumbnail-current'; } ?>">
|
||||||
|
<label style="display: block;" for="map_type_terrain">
|
||||||
|
<img src="<?php echo SIMPLEMAP_URL; ?>/inc/images/map-type-terrain.jpg" width="100" height="100" style="border: 1px solid #999;" /><br /><?php _e('Terrain map', 'SimpleMap'); ?><br />
|
||||||
|
<input type="radio" style="border: none;" name="map_type" id="map_type_terrain" value="TERRAIN" <?php checked( $map_type, 'TERRAIN' ); ?> />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="top">
|
||||||
|
<td><label for="map_stylesheet"><?php _e( 'Theme', 'SimpleMap' ); ?></label></td>
|
||||||
|
<td>
|
||||||
|
<select name="map_stylesheet" id="map_stylesheet">
|
||||||
|
<?php
|
||||||
|
echo '<optgroup label="' . __( 'Default Themes', 'SimpleMap' ) . '">' . "\n";
|
||||||
|
foreach ( $themes1 as $file => $name ) {
|
||||||
|
$file_full = 'inc/styles/' . $file;
|
||||||
|
echo '<option value="' . esc_attr( $file_full ) . '" ' . selected( $map_stylesheet, $file_full, false ) . '>' . esc_attr( $name ) . '</option>' . "\n";
|
||||||
|
}
|
||||||
|
echo '</optgroup>' . "\n";
|
||||||
|
|
||||||
|
if (!empty($themes2)) {
|
||||||
|
echo '<optgroup label="'.__('Custom Themes', 'SimpleMap').'">'."\n";
|
||||||
|
foreach ($themes2 as $file => $name) {
|
||||||
|
$file_full = 'simplemap-styles/' . $file;
|
||||||
|
echo '<option value="' . esc_attr( $file_full ) . '" ' . selected( $map_stylesheet, $file_full, false ) . '>' . esc_attr( $name ) . '</option>' . "\n";
|
||||||
|
}
|
||||||
|
echo '</optgroup>'."\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<small><em><?php printf( __( 'To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:', 'SimpleMap' ), '</em><code>', '</code><em>' ); ?></em></small><br />
|
||||||
|
<div style="margin-left: 20px;">
|
||||||
|
<code style="color: #060; background: none;">/*<br />Theme Name: THEME_NAME_HERE<br />*/</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="middle">
|
||||||
|
<td>
|
||||||
|
<label for="display_search"><?php _e( 'Display Search Form', 'SimpleMap' ); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<label for="display_search_yes"><input type="radio" name="display_search" id="display_search_yes" value="show" <?php checked( $display_search, 'show' ); ?> /> <?php _e( 'Yes', 'SimpleMap' ); ?></label>
|
||||||
|
<label for="display_search_no"><input type="radio" name="display_search" id="display_search_no" value="hide" <?php checked( $display_search, 'hide' ); ?> /> <?php _e( 'No', 'SimpleMap' ); ?></label><br />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr valign="middle">
|
||||||
|
<td>
|
||||||
|
<label for="powered_by"><?php _e('SimpleMap Link', 'SimpleMap'); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<label for="powered_by"><input type="checkbox" name="powered_by" id="powered_by" <?php checked( $powered_by ); ?> /> <?php _e( 'Show the "Powered by SimpleMap" link', 'SimpleMap' ); ?></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div> <!-- table -->
|
||||||
|
|
||||||
|
<p class="submit" align="right">
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'SimpleMap' ) ?>" />
|
||||||
|
</p>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
</div> <!-- inside -->
|
||||||
|
</div> <!-- postbox -->
|
||||||
|
|
||||||
|
<div class="postbox" >
|
||||||
|
|
||||||
|
<h3><?php _e( 'Delete SimpleMap Data', 'SimpleMap' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="inside">
|
||||||
|
<p class="sub"><span style="color: red;"><?php _e( 'CAUTION! Uninstalling SimpleMap will completely delete all current locations, categories, tags and options. This is irreversible.' , 'SimpleMap' ); ?></span></p>
|
||||||
|
<p style='text-align:center;'><a onclick="javascript:return confirm('<?php _e( 'Last chance! Pressing OK will delete all SimpleMap locations. Your settings will not be deleted.'); ?>')" href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=simplemap&sm-action=delete-simplemap&locations-only=true' ), 'delete-simplemap-locations' ); ?>" ><?php _e( 'Clicking this link will remove all locations but preserve your settings.'); ?></a></p>
|
||||||
|
<p style='text-align:center;'><a onclick="javascript:return confirm('<?php _e( 'Last chance! Pressing OK will delete all SimpleMap data.'); ?>')" href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=simplemap&sm-action=delete-simplemap' ), 'delete-simplemap' ); ?>" ><?php _e( 'Clicking this link will remove all data from the database.'); ?></a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-side-sortables-bottom' ); ?>
|
||||||
|
|
||||||
|
</div> <!-- meta-box-sortables -->
|
||||||
|
</div> <!-- postbox-container -->
|
||||||
|
|
||||||
|
<?php do_action( 'sm-general-options-dash-widgets-bottom' ); ?>
|
||||||
|
|
||||||
|
</div> <!-- dashboard-widgets -->
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p style='float:right;margin-right:25px;'><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTJBYXGQFSW64'>Donate via PayPal</a></p>
|
||||||
|
|
||||||
|
<div class="clear">
|
||||||
|
</div>
|
||||||
|
</div><!-- dashboard-widgets-wrap -->
|
||||||
|
</div> <!-- wrap -->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
// Locate and list style options / location
|
||||||
|
function read_styles( $dir ) {
|
||||||
|
$themes = array();
|
||||||
|
if ( $handle = opendir( $dir ) ) {
|
||||||
|
while ( false !== ( $file = readdir( $handle ) ) ) {
|
||||||
|
if ( $file != "." && $file != ".." && $file != ".svn" && $file != 'admin.css' ) {
|
||||||
|
$theme_data = implode( '', file( $dir . '/' . $file ) );
|
||||||
|
|
||||||
|
$name = '';
|
||||||
|
if (preg_match( '|Theme Name:(.*)$|mi', $theme_data, $matches ) )
|
||||||
|
$name = _cleanup_header_comment( $matches[1] );
|
||||||
|
else
|
||||||
|
$name = basename( $file );
|
||||||
|
|
||||||
|
$themes[$file] = $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir( $handle );
|
||||||
|
}
|
||||||
|
return( $themes );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
695
classes/parsecsv.lib.php
Normal file
|
@ -0,0 +1,695 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class smParseCSV {
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Class: parseCSV v0.3.2
|
||||||
|
http://code.google.com/p/parsecsv-for-php/
|
||||||
|
|
||||||
|
|
||||||
|
Fully conforms to the specifications lined out on wikipedia:
|
||||||
|
- http://en.wikipedia.org/wiki/Comma-separated_values
|
||||||
|
|
||||||
|
Based on the concept of Ming Hong Ng's CsvFileParser class:
|
||||||
|
- http://minghong.blogspot.com/2006/07/csv-parser-for-php.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (c) 2007 Jim Myhrberg (jim@zydev.info).
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Code Examples
|
||||||
|
----------------
|
||||||
|
# general usage
|
||||||
|
$csv = new parseCSV('data.csv');
|
||||||
|
print_r($csv->data);
|
||||||
|
----------------
|
||||||
|
# tab delimited, and encoding conversion
|
||||||
|
$csv = new parseCSV();
|
||||||
|
$csv->encoding('UTF-16', 'UTF-8');
|
||||||
|
$csv->delimiter = "\t";
|
||||||
|
$csv->parse('data.tsv');
|
||||||
|
print_r($csv->data);
|
||||||
|
----------------
|
||||||
|
# auto-detect delimiter character
|
||||||
|
$csv = new parseCSV();
|
||||||
|
$csv->auto('data.csv');
|
||||||
|
print_r($csv->data);
|
||||||
|
----------------
|
||||||
|
# modify data in a csv file
|
||||||
|
$csv = new parseCSV();
|
||||||
|
$csv->sort_by = 'id';
|
||||||
|
$csv->parse('data.csv');
|
||||||
|
# "4" is the value of the "id" column of the CSV row
|
||||||
|
$csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => 'john@doe.com');
|
||||||
|
$csv->save();
|
||||||
|
----------------
|
||||||
|
# add row/entry to end of CSV file
|
||||||
|
# - only recommended when you know the extact sctructure of the file
|
||||||
|
$csv = new parseCSV();
|
||||||
|
$csv->save('data.csv', array('1986', 'Home', 'Nowhere', ''), true);
|
||||||
|
----------------
|
||||||
|
# convert 2D array to csv data and send headers
|
||||||
|
# to browser to treat output as a file and download it
|
||||||
|
$csv = new parseCSV();
|
||||||
|
$csv->output (true, 'movies.csv', $array);
|
||||||
|
----------------
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration
|
||||||
|
* - set these options with $object->var_name = 'value';
|
||||||
|
*/
|
||||||
|
|
||||||
|
# use first line/entry as field names
|
||||||
|
var $heading = true;
|
||||||
|
|
||||||
|
# override field names
|
||||||
|
var $fields = array();
|
||||||
|
|
||||||
|
# sort entries by this field
|
||||||
|
var $sort_by = null;
|
||||||
|
var $sort_reverse = false;
|
||||||
|
|
||||||
|
# delimiter (comma) and enclosure (double quote)
|
||||||
|
var $delimiter = ',';
|
||||||
|
var $enclosure = '"';
|
||||||
|
|
||||||
|
# basic SQL-like conditions for row matching
|
||||||
|
var $conditions = null;
|
||||||
|
|
||||||
|
# number of rows to ignore from beginning of data
|
||||||
|
var $offset = null;
|
||||||
|
|
||||||
|
# limits the number of returned rows to specified amount
|
||||||
|
var $limit = null;
|
||||||
|
|
||||||
|
# number of rows to analyze when attempting to auto-detect delimiter
|
||||||
|
var $auto_depth = 15;
|
||||||
|
|
||||||
|
# characters to ignore when attempting to auto-detect delimiter
|
||||||
|
var $auto_non_chars = "a-zA-Z0-9\n\r";
|
||||||
|
|
||||||
|
# preferred delimiter characters, only used when all filtering method
|
||||||
|
# returns multiple possible delimiters (happens very rarely)
|
||||||
|
var $auto_preferred = ",;\t.:|";
|
||||||
|
|
||||||
|
# character encoding options
|
||||||
|
var $convert_encoding = false;
|
||||||
|
var $input_encoding = 'ISO-8859-1';
|
||||||
|
var $output_encoding = 'ISO-8859-1';
|
||||||
|
|
||||||
|
# used by unparse(), save(), and output() functions
|
||||||
|
var $linefeed = "\r\n";
|
||||||
|
|
||||||
|
# only used by output() function
|
||||||
|
var $output_delimiter = ',';
|
||||||
|
var $output_filename = 'data.csv';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal variables
|
||||||
|
*/
|
||||||
|
|
||||||
|
# current file
|
||||||
|
var $file;
|
||||||
|
|
||||||
|
# loaded file contents
|
||||||
|
var $file_data;
|
||||||
|
|
||||||
|
# array of field values in data parsed
|
||||||
|
var $titles = array();
|
||||||
|
|
||||||
|
# two dimentional array of CSV data
|
||||||
|
var $data = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param input CSV file or string
|
||||||
|
* @return nothing
|
||||||
|
*/
|
||||||
|
function smParseCSV ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||||
|
if ( $offset !== null ) $this->offset = $offset;
|
||||||
|
if ( $limit !== null ) $this->limit = $limit;
|
||||||
|
if ( count($conditions) > 0 ) $this->conditions = $conditions;
|
||||||
|
if ( !empty($input) ) $this->parse($input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ==============================================
|
||||||
|
// ----- [ Main Functions ] ---------------------
|
||||||
|
// ==============================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse CSV file or string
|
||||||
|
* @param input CSV file or string
|
||||||
|
* @return nothing
|
||||||
|
*/
|
||||||
|
function parse ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||||
|
if ( !empty($input) ) {
|
||||||
|
if ( $offset !== null ) $this->offset = $offset;
|
||||||
|
if ( $limit !== null ) $this->limit = $limit;
|
||||||
|
if ( count($conditions) > 0 ) $this->conditions = $conditions;
|
||||||
|
if ( is_readable($input) ) {
|
||||||
|
$this->data = $this->parse_file($input);
|
||||||
|
} else {
|
||||||
|
$this->file_data = &$input;
|
||||||
|
$this->data = $this->parse_string();
|
||||||
|
}
|
||||||
|
if ( $this->data === false ) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save changes, or new file and/or data
|
||||||
|
* @param file file to save to
|
||||||
|
* @param data 2D array with data
|
||||||
|
* @param append append current data to end of target CSV if exists
|
||||||
|
* @param fields field names
|
||||||
|
* @return true or false
|
||||||
|
*/
|
||||||
|
function save ($file = null, $data = array(), $append = false, $fields = array()) {
|
||||||
|
if ( empty($file) ) $file = &$this->file;
|
||||||
|
$mode = ( $append ) ? 'at' : 'wt' ;
|
||||||
|
$is_php = ( preg_match('/\.php$/i', $file) ) ? true : false ;
|
||||||
|
return $this->_wfile($file, $this->unparse($data, $fields, $append, $is_php), $mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate CSV based string for output
|
||||||
|
* @param output if true, prints headers and strings to browser
|
||||||
|
* @param filename filename sent to browser in headers if output is true
|
||||||
|
* @param data 2D array with data
|
||||||
|
* @param fields field names
|
||||||
|
* @param delimiter delimiter used to separate data
|
||||||
|
* @return CSV data using delimiter of choice, or default
|
||||||
|
*/
|
||||||
|
function output ($output = true, $filename = null, $data = array(), $fields = array(), $delimiter = null) {
|
||||||
|
if ( empty($filename) ) $filename = $this->output_filename;
|
||||||
|
if ( $delimiter === null ) $delimiter = $this->output_delimiter;
|
||||||
|
$data = $this->unparse($data, $fields, null, null, $delimiter);
|
||||||
|
if ( $output ) {
|
||||||
|
header('Content-type: application/csv');
|
||||||
|
header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||||
|
echo $data;
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert character encoding
|
||||||
|
* @param input input character encoding, uses default if left blank
|
||||||
|
* @param output output character encoding, uses default if left blank
|
||||||
|
* @return nothing
|
||||||
|
*/
|
||||||
|
function encoding ($input = null, $output = null) {
|
||||||
|
$this->convert_encoding = true;
|
||||||
|
if ( $input !== null ) $this->input_encoding = $input;
|
||||||
|
if ( $output !== null ) $this->output_encoding = $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-Detect Delimiter: Find delimiter by analyzing a specific number of
|
||||||
|
* rows to determine most probable delimiter character
|
||||||
|
* @param file local CSV file
|
||||||
|
* @param parse true/false parse file directly
|
||||||
|
* @param search_depth number of rows to analyze
|
||||||
|
* @param preferred preferred delimiter characters
|
||||||
|
* @param enclosure enclosure character, default is double quote (").
|
||||||
|
* @return delimiter character
|
||||||
|
*/
|
||||||
|
function auto ($file = null, $parse = true, $search_depth = null, $preferred = null, $enclosure = null) {
|
||||||
|
|
||||||
|
if ( $file === null ) $file = $this->file;
|
||||||
|
if ( empty($search_depth) ) $search_depth = $this->auto_depth;
|
||||||
|
if ( $enclosure === null ) $enclosure = $this->enclosure;
|
||||||
|
|
||||||
|
if ( $preferred === null ) $preferred = $this->auto_preferred;
|
||||||
|
|
||||||
|
if ( empty($this->file_data) ) {
|
||||||
|
if ( $this->_check_data($file) ) {
|
||||||
|
$data = &$this->file_data;
|
||||||
|
} else return false;
|
||||||
|
} else {
|
||||||
|
$data = &$this->file_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
$chars = array();
|
||||||
|
$strlen = strlen($data);
|
||||||
|
$enclosed = false;
|
||||||
|
$n = 1;
|
||||||
|
$to_end = true;
|
||||||
|
|
||||||
|
// walk specific depth finding posssible delimiter characters
|
||||||
|
for ( $i=0; $i < $strlen; $i++ ) {
|
||||||
|
$ch = $data{$i};
|
||||||
|
$nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
|
||||||
|
$pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
|
||||||
|
|
||||||
|
// open and closing quotes
|
||||||
|
if ( $ch == $enclosure && (!$enclosed || $nch != $enclosure) ) {
|
||||||
|
$enclosed = ( $enclosed ) ? false : true ;
|
||||||
|
|
||||||
|
// inline quotes
|
||||||
|
} elseif ( $ch == $enclosure && $enclosed ) {
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
// end of row
|
||||||
|
} elseif ( ($ch == "\n" && $pch != "\r" || $ch == "\r") && !$enclosed ) {
|
||||||
|
if ( $n >= $search_depth ) {
|
||||||
|
$strlen = 0;
|
||||||
|
$to_end = false;
|
||||||
|
} else {
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count character
|
||||||
|
} elseif (!$enclosed) {
|
||||||
|
if ( !preg_match('/['.preg_quote($this->auto_non_chars, '/').']/i', $ch) ) {
|
||||||
|
if ( !isset($chars[$ch][$n]) ) {
|
||||||
|
$chars[$ch][$n] = 1;
|
||||||
|
} else {
|
||||||
|
$chars[$ch][$n]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// filtering
|
||||||
|
$depth = ( $to_end ) ? $n-1 : $n ;
|
||||||
|
$filtered = array();
|
||||||
|
foreach( $chars as $char => $value ) {
|
||||||
|
if ( $match = $this->_check_count($char, $value, $depth, $preferred) ) {
|
||||||
|
$filtered[$match] = $char;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// capture most probable delimiter
|
||||||
|
ksort($filtered);
|
||||||
|
$delimiter = reset($filtered);
|
||||||
|
$this->delimiter = $delimiter;
|
||||||
|
|
||||||
|
// parse data
|
||||||
|
if ( $parse ) $this->data = $this->parse_string();
|
||||||
|
|
||||||
|
return $delimiter;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ==============================================
|
||||||
|
// ----- [ Core Functions ] ---------------------
|
||||||
|
// ==============================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read file to string and call parse_string()
|
||||||
|
* @param file local CSV file
|
||||||
|
* @return 2D array with CSV data, or false on failure
|
||||||
|
*/
|
||||||
|
function parse_file ($file = null) {
|
||||||
|
if ( $file === null ) $file = $this->file;
|
||||||
|
if ( empty($this->file_data) ) $this->load_data($file);
|
||||||
|
return ( !empty($this->file_data) ) ? $this->parse_string() : false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse CSV strings to arrays
|
||||||
|
* @param data CSV string
|
||||||
|
* @return 2D array with CSV data, or false on failure
|
||||||
|
*/
|
||||||
|
function parse_string ($data = null) {
|
||||||
|
if ( empty($data) ) {
|
||||||
|
if ( $this->_check_data() ) {
|
||||||
|
$data = &$this->file_data;
|
||||||
|
} else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rows = array();
|
||||||
|
$row = array();
|
||||||
|
$row_count = 0;
|
||||||
|
$current = '';
|
||||||
|
$head = ( !empty($this->fields) ) ? $this->fields : array() ;
|
||||||
|
$col = 0;
|
||||||
|
$enclosed = false;
|
||||||
|
$was_enclosed = false;
|
||||||
|
$strlen = strlen($data);
|
||||||
|
|
||||||
|
// walk through each character
|
||||||
|
for ( $i=0; $i < $strlen; $i++ ) {
|
||||||
|
$ch = $data{$i};
|
||||||
|
$nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
|
||||||
|
$pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
|
||||||
|
|
||||||
|
// open and closing quotes
|
||||||
|
if ( $ch == $this->enclosure && (!$enclosed || $nch != $this->enclosure) ) {
|
||||||
|
$enclosed = ( $enclosed ) ? false : true ;
|
||||||
|
if ( $enclosed ) $was_enclosed = true;
|
||||||
|
|
||||||
|
// inline quotes
|
||||||
|
} elseif ( $ch == $this->enclosure && $enclosed ) {
|
||||||
|
$current .= $ch;
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
// end of field/row
|
||||||
|
} elseif ( ($ch == $this->delimiter || ($ch == "\n" && $pch != "\r") || $ch == "\r") && !$enclosed ) {
|
||||||
|
if ( !$was_enclosed ) $current = trim($current);
|
||||||
|
$key = ( !empty($head[$col]) ) ? $head[$col] : $col ;
|
||||||
|
$row[$key] = $current;
|
||||||
|
$current = '';
|
||||||
|
$col++;
|
||||||
|
|
||||||
|
// end of row
|
||||||
|
if ( $ch == "\n" || $ch == "\r" ) {
|
||||||
|
if ( $this->_validate_offset($row_count) && $this->_validate_row_conditions($row, $this->conditions) ) {
|
||||||
|
if ( $this->heading && empty($head) ) {
|
||||||
|
$head = $row;
|
||||||
|
} elseif ( empty($this->fields) || (!empty($this->fields) && (($this->heading && $row_count > 0) || !$this->heading)) ) {
|
||||||
|
if ( !empty($this->sort_by) && !empty($row[$this->sort_by]) ) {
|
||||||
|
if ( isset($rows[$row[$this->sort_by]]) ) {
|
||||||
|
$rows[$row[$this->sort_by].'_0'] = &$rows[$row[$this->sort_by]];
|
||||||
|
unset($rows[$row[$this->sort_by]]);
|
||||||
|
for ( $sn=1; isset($rows[$row[$this->sort_by].'_'.$sn]); $sn++ ) {}
|
||||||
|
$rows[$row[$this->sort_by].'_'.$sn] = $row;
|
||||||
|
} else $rows[$row[$this->sort_by]] = $row;
|
||||||
|
} else $rows[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$row = array();
|
||||||
|
$col = 0;
|
||||||
|
$row_count++;
|
||||||
|
if ( $this->sort_by === null && $this->limit !== null && count($rows) == $this->limit ) {
|
||||||
|
$i = $strlen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// append character to current field
|
||||||
|
} else {
|
||||||
|
$current .= $ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->titles = $head;
|
||||||
|
if ( !empty($this->sort_by) ) {
|
||||||
|
( $this->sort_reverse ) ? krsort($rows) : ksort($rows) ;
|
||||||
|
if ( $this->offset !== null || $this->limit !== null ) {
|
||||||
|
$rows = array_slice($rows, ($this->offset === null ? 0 : $this->offset) , $this->limit, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create CSV data from array
|
||||||
|
* @param data 2D array with data
|
||||||
|
* @param fields field names
|
||||||
|
* @param append if true, field names will not be output
|
||||||
|
* @param is_php if a php die() call should be put on the first
|
||||||
|
* line of the file, this is later ignored when read.
|
||||||
|
* @param delimiter field delimiter to use
|
||||||
|
* @return CSV data (text string)
|
||||||
|
*/
|
||||||
|
function unparse ( $data = array(), $fields = array(), $append = false , $is_php = false, $delimiter = null) {
|
||||||
|
if ( !is_array($data) || empty($data) ) $data = &$this->data;
|
||||||
|
if ( !is_array($fields) || empty($fields) ) $fields = &$this->titles;
|
||||||
|
if ( $delimiter === null ) $delimiter = $this->delimiter;
|
||||||
|
|
||||||
|
$string = ( $is_php ) ? "<?php header('Status: 403'); die(' '); ?>".$this->linefeed : '' ;
|
||||||
|
$entry = array();
|
||||||
|
|
||||||
|
// create heading
|
||||||
|
if ( $this->heading && !$append ) {
|
||||||
|
foreach( $fields as $key => $value ) {
|
||||||
|
$entry[] = $this->_enclose_value($value);
|
||||||
|
}
|
||||||
|
$string .= implode($delimiter, $entry).$this->linefeed;
|
||||||
|
$entry = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
// create data
|
||||||
|
foreach( $data as $key => $row ) {
|
||||||
|
foreach( $row as $field => $value ) {
|
||||||
|
$entry[] = $this->_enclose_value($value);
|
||||||
|
}
|
||||||
|
$string .= implode($delimiter, $entry).$this->linefeed;
|
||||||
|
$entry = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load local file or string
|
||||||
|
* @param input local CSV file
|
||||||
|
* @return true or false
|
||||||
|
*/
|
||||||
|
function load_data ($input = null) {
|
||||||
|
$data = null;
|
||||||
|
$file = null;
|
||||||
|
if ( $input === null ) {
|
||||||
|
$file = $this->file;
|
||||||
|
} elseif ( file_exists($input) ) {
|
||||||
|
$file = $input;
|
||||||
|
} else {
|
||||||
|
$data = $input;
|
||||||
|
}
|
||||||
|
if ( !empty($data) || $data = $this->_rfile($file) ) {
|
||||||
|
if ( $this->file != $file ) $this->file = $file;
|
||||||
|
if ( preg_match('/\.php$/i', $file) && preg_match('/<\?.*?\?>(.*)/ims', $data, $strip) ) {
|
||||||
|
$data = ltrim($strip[1]);
|
||||||
|
}
|
||||||
|
if ( $this->convert_encoding ) $data = iconv($this->input_encoding, $this->output_encoding, $data);
|
||||||
|
if ( substr($data, -1) != "\n" ) $data .= "\n";
|
||||||
|
$this->file_data = &$data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ==============================================
|
||||||
|
// ----- [ Internal Functions ] -----------------
|
||||||
|
// ==============================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate a row against specified conditions
|
||||||
|
* @param row array with values from a row
|
||||||
|
* @param conditions specified conditions that the row must match
|
||||||
|
* @return true of false
|
||||||
|
*/
|
||||||
|
function _validate_row_conditions ($row = array(), $conditions = null) {
|
||||||
|
if ( !empty($row) ) {
|
||||||
|
if ( !empty($conditions) ) {
|
||||||
|
$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
|
||||||
|
$or = '';
|
||||||
|
foreach( $conditions as $key => $value ) {
|
||||||
|
if ( strpos($value, ' AND ') !== false ) {
|
||||||
|
$value = explode(' AND ', $value);
|
||||||
|
$and = '';
|
||||||
|
foreach( $value as $k => $v ) {
|
||||||
|
$and .= $this->_validate_row_condition($row, $v);
|
||||||
|
}
|
||||||
|
$or .= (strpos($and, '0') !== false) ? '0' : '1' ;
|
||||||
|
} else {
|
||||||
|
$or .= $this->_validate_row_condition($row, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (strpos($or, '1') !== false) ? true : false ;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate a row against a single condition
|
||||||
|
* @param row array with values from a row
|
||||||
|
* @param condition specified condition that the row must match
|
||||||
|
* @return true of false
|
||||||
|
*/
|
||||||
|
function _validate_row_condition ($row, $condition) {
|
||||||
|
$operators = array(
|
||||||
|
'=', 'equals', 'is',
|
||||||
|
'!=', 'is not',
|
||||||
|
'<', 'is less than',
|
||||||
|
'>', 'is greater than',
|
||||||
|
'<=', 'is less than or equals',
|
||||||
|
'>=', 'is greater than or equals',
|
||||||
|
'contains',
|
||||||
|
'does not contain',
|
||||||
|
);
|
||||||
|
$operators_regex = array();
|
||||||
|
foreach( $operators as $value ) {
|
||||||
|
$operators_regex[] = preg_quote($value, '/');
|
||||||
|
}
|
||||||
|
$operators_regex = implode('|', $operators_regex);
|
||||||
|
if ( preg_match('/^(.+) ('.$operators_regex.') (.+)$/i', trim($condition), $capture) ) {
|
||||||
|
$field = $capture[1];
|
||||||
|
$op = $capture[2];
|
||||||
|
$value = $capture[3];
|
||||||
|
if ( preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/i', $value, $capture) ) {
|
||||||
|
if ( $capture[1] == $capture[3] ) {
|
||||||
|
$value = $capture[2];
|
||||||
|
$value = str_replace("\\n", "\n", $value);
|
||||||
|
$value = str_replace("\\r", "\r", $value);
|
||||||
|
$value = str_replace("\\t", "\t", $value);
|
||||||
|
$value = stripslashes($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( array_key_exists($field, $row) ) {
|
||||||
|
if ( ($op == '=' || $op == 'equals' || $op == 'is') && $row[$field] == $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( ($op == '!=' || $op == 'is not') && $row[$field] != $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( ($op == '<' || $op == 'is less than' ) && $row[$field] < $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( ($op == '>' || $op == 'is greater than') && $row[$field] > $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( ($op == '<=' || $op == 'is less than or equals' ) && $row[$field] <= $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( ($op == '>=' || $op == 'is greater than or equals') && $row[$field] >= $value ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( $op == 'contains' && preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
|
||||||
|
return '1';
|
||||||
|
} elseif ( $op == 'does not contain' && !preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
|
||||||
|
return '1';
|
||||||
|
} else {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '1';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates if the row is within the offset or not if sorting is disabled
|
||||||
|
* @param current_row the current row number being processed
|
||||||
|
* @return true of false
|
||||||
|
*/
|
||||||
|
function _validate_offset ($current_row) {
|
||||||
|
if ( $this->sort_by === null && $this->offset !== null && $current_row < $this->offset ) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enclose values if needed
|
||||||
|
* - only used by unparse()
|
||||||
|
* @param value string to process
|
||||||
|
* @return Processed value
|
||||||
|
*/
|
||||||
|
function _enclose_value ($value = null) {
|
||||||
|
if ( $value !== null && $value != '' ) {
|
||||||
|
$delimiter = preg_quote($this->delimiter, '/');
|
||||||
|
$enclosure = preg_quote($this->enclosure, '/');
|
||||||
|
if ( preg_match("/".$delimiter."|".$enclosure."|\n|\r/i", $value) || ($value{0} == ' ' || substr($value, -1) == ' ') ) {
|
||||||
|
$value = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $value);
|
||||||
|
$value = $this->enclosure.$value.$this->enclosure;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check file data
|
||||||
|
* @param file local filename
|
||||||
|
* @return true or false
|
||||||
|
*/
|
||||||
|
function _check_data ($file = null) {
|
||||||
|
if ( empty($this->file_data) ) {
|
||||||
|
if ( $file === null ) $file = $this->file;
|
||||||
|
return $this->load_data($file);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if passed info might be delimiter
|
||||||
|
* - only used by find_delimiter()
|
||||||
|
* @return special string used for delimiter selection, or false
|
||||||
|
*/
|
||||||
|
function _check_count ($char, $array, $depth, $preferred) {
|
||||||
|
if ( $depth == count($array) ) {
|
||||||
|
$first = null;
|
||||||
|
$equal = null;
|
||||||
|
$almost = false;
|
||||||
|
foreach( $array as $key => $value ) {
|
||||||
|
if ( $first == null ) {
|
||||||
|
$first = $value;
|
||||||
|
} elseif ( $value == $first && $equal !== false) {
|
||||||
|
$equal = true;
|
||||||
|
} elseif ( $value == $first+1 && $equal !== false ) {
|
||||||
|
$equal = true;
|
||||||
|
$almost = true;
|
||||||
|
} else {
|
||||||
|
$equal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( $equal ) {
|
||||||
|
$match = ( $almost ) ? 2 : 1 ;
|
||||||
|
$pref = strpos($preferred, $char);
|
||||||
|
$pref = ( $pref !== false ) ? str_pad($pref, 3, '0', STR_PAD_LEFT) : '999' ;
|
||||||
|
return $pref.$match.'.'.(99999 - str_pad($first, 5, '0', STR_PAD_LEFT));
|
||||||
|
} else return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read local file
|
||||||
|
* @param file local filename
|
||||||
|
* @return Data from file, or false on failure
|
||||||
|
*/
|
||||||
|
function _rfile ($file = null) {
|
||||||
|
if ( is_readable($file) ) {
|
||||||
|
if ( !($fh = fopen($file, 'r')) ) return false;
|
||||||
|
$data = fread($fh, filesize($file));
|
||||||
|
fclose($fh);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write to local file
|
||||||
|
* @param file local filename
|
||||||
|
* @param string data to write to file
|
||||||
|
* @param mode fopen() mode
|
||||||
|
* @param lock flock() mode
|
||||||
|
* @return true or false
|
||||||
|
*/
|
||||||
|
function _wfile ($file, $string = '', $mode = 'wb', $lock = 2) {
|
||||||
|
if ( $fp = fopen($file, $mode) ) {
|
||||||
|
flock($fp, $lock);
|
||||||
|
$re = fwrite($fp, $string);
|
||||||
|
$re2 = fclose($fp);
|
||||||
|
if ( $re != false && $re2 != false ) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
254
classes/shortcodes.php
Normal file
|
@ -0,0 +1,254 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file contains all my classes for the different shortcodes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SM_Shortcodes Class
|
||||||
|
*
|
||||||
|
* Registers and handles shortcodes for SimpleMap Locations. The only exception right now is the
|
||||||
|
* main [simplemap] shortcode which is currently being handled by /classes/simplemap.php.
|
||||||
|
* It will eventually be moved here
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
if ( ! class_exists( 'SM_Location_Shortcodes' ) ) {
|
||||||
|
|
||||||
|
class SM_Location_Shortcodes {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of all shortcodes related to locations
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
var $shortcode_tags = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class constructor
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
// Build shortcode tag list
|
||||||
|
$this->shortcode_tags = $this->get_shortcode_tags();
|
||||||
|
|
||||||
|
// Register shortcodes with WordPress
|
||||||
|
add_action( 'init', array( &$this, 'register_shortcodes' ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method loops through all my location shortcodes and registers them.
|
||||||
|
*
|
||||||
|
* All shortcode tags actually use the same callback method
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function register_shortcodes() {
|
||||||
|
|
||||||
|
// Register
|
||||||
|
add_shortcode( 'sm-location', array( &$this, 'do_shortcode' ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the array of tags used for location shortcodes
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function get_shortcode_tags() {
|
||||||
|
|
||||||
|
$shortcode_tags = array(
|
||||||
|
'address',
|
||||||
|
'city',
|
||||||
|
'state',
|
||||||
|
'zip',
|
||||||
|
'country',
|
||||||
|
'phone',
|
||||||
|
'fax',
|
||||||
|
'email',
|
||||||
|
'url'
|
||||||
|
);
|
||||||
|
|
||||||
|
return apply_filters( 'sm-location-shortcode-tag-array', $shortcode_tags );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Responsible for returning a location address
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function do_shortcode( $args ) {
|
||||||
|
|
||||||
|
global $post, $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
// Default args for map itself, not for locations on map
|
||||||
|
$map_defaults = array(
|
||||||
|
'data' => '',
|
||||||
|
'before' => '',
|
||||||
|
'after' => '',
|
||||||
|
'map_width' => '75px',
|
||||||
|
'map_height' => '75px',
|
||||||
|
'default_lat' => get_post_meta( $post->ID, 'location_lat', true ),
|
||||||
|
'default_lng' => get_post_meta( $post->ID, 'location_lng', true ),
|
||||||
|
'panControl' => false,
|
||||||
|
'zoomContorl' => false,
|
||||||
|
'scaleControl' => false,
|
||||||
|
'streetViewControl' => false,
|
||||||
|
'mapTypeContorl' => false,
|
||||||
|
'mapTypeId' => 'google.maps.MapTypeId.ROADMAP',
|
||||||
|
'format' => 'csv',
|
||||||
|
);
|
||||||
|
|
||||||
|
$atts = shortcode_atts( $map_defaults, $args );
|
||||||
|
|
||||||
|
// If the requested data is description, return the post content
|
||||||
|
if ( 'description' == $atts['data'] )
|
||||||
|
return $post->post_content;
|
||||||
|
|
||||||
|
// If we're looking for the full address, compose that from the options
|
||||||
|
if ( 'full-address' == $atts['data'] ) {
|
||||||
|
$postmeta = get_metadata( 'post', $post->ID );
|
||||||
|
$address_format = $options['address_format'];
|
||||||
|
|
||||||
|
switch ( $address_format ) {
|
||||||
|
case 'town province postalcode' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_city'][0] . $postmeta['location_state'][0] . ' ' . $postmeta['location_zip'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'town-province postalcode' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_city'][0] . '-' . $postmeta['location_state'][0] . ' ' . $postmeta['location_zip'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'postalcode town-province' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_zip'][0] . ' ' . $postmeta['location_city'][0] . '-' . $postmeta['location_state'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'postalcode town, province' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_zip'][0] . ' ' . $postmeta['location_city'][0] . ', ' . $postmeta['location_state'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'postalcode town' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_zip'][0] . ' ' . $postmeta['location_city'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'town postalcode' :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_city'][0] . ' ' . $postmeta['location_zip'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'town, province postalcode' :
|
||||||
|
default :
|
||||||
|
$full_address = $postmeta['location_address'][0] . ' ' . $postmeta['location_address2'][0] . ' ' .$postmeta['location_city'][0] . ', ' . $postmeta['location_state'][0] . ' ' . $postmeta['location_zip'][0];
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $full_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if the requested data is 'directions' return the link to google maps
|
||||||
|
if ( 'directions' == $atts['data'] )
|
||||||
|
return $this->get_directions_link( $post->ID );
|
||||||
|
|
||||||
|
// if the requested data is a map, return the map
|
||||||
|
if ( 'iframe-map' == $atts['data'] ) {
|
||||||
|
|
||||||
|
// Args we need to make the map itself - not the locations on the map
|
||||||
|
$r = array(
|
||||||
|
'map_width' => $atts['map_width'],
|
||||||
|
'map_height' => $atts['map_height'],
|
||||||
|
'panControl' => $atts['pan_control'],
|
||||||
|
'default_lat' => $atts['default_lat'],
|
||||||
|
'default_lng' => $atts['default_lng'],
|
||||||
|
'zoomControl' => $atts['zoom_control'],
|
||||||
|
'scaleControl' => $atts['scale_control'],
|
||||||
|
'streetViewControl' => $atts['street_view_control'],
|
||||||
|
'mapTypeControl' => $atts['map_type_control'],
|
||||||
|
'mapType' => $atts['map_type']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Determine location IDs
|
||||||
|
$location_ids = empty( $args['location_ids'] ) ? array( $post->ID ) : explode( ',', $args['location_ids'] );
|
||||||
|
|
||||||
|
// Init the object and return the iframe source
|
||||||
|
$map = new SM_Map_Factory();
|
||||||
|
$map->set_map_atts( $r );
|
||||||
|
|
||||||
|
// Add Locations
|
||||||
|
foreach( $location_ids as $location_id ) {
|
||||||
|
$map->add_location( $location_id );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $map->get_iframe_embed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the requested data is a taxonomy
|
||||||
|
$sm_taxes = $simple_map->get_sm_taxonomies( 'array', '', true, 'objects' ) ? $simple_map->get_sm_taxonomies( 'array', '', true, 'objects' ) : array();
|
||||||
|
|
||||||
|
foreach( $sm_taxes as $taxonomy ) {
|
||||||
|
if ( $taxonomy->name == $atts['data'] ) {
|
||||||
|
// Forward compatible format types
|
||||||
|
$tax_format = ( in_array( $atts['format'], array( 'csv' ) ) ) ? $atts['format'] : 'csv';
|
||||||
|
if ( $terms = wp_get_object_terms( $post->ID, $taxonomy->query_var ) ) {
|
||||||
|
foreach( $terms as $termk => $termv ) {
|
||||||
|
$term_names[] = $termv->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$term_names = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forward compatible format types
|
||||||
|
switch( $tax_format ) {
|
||||||
|
case 'csv':
|
||||||
|
default:
|
||||||
|
return ! empty( $term_names ) ? $args['before'] . implode( ', ', $term_names ) . $args['after'] : '' ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Look for postmeta with location_ prepended to it
|
||||||
|
if ( $value = get_post_meta( absint( $post->ID ), 'location_' . $atts['data'], true ) )
|
||||||
|
return str_replace( '%self%', $value, $atts['before'] . $value . $atts['after'] );
|
||||||
|
|
||||||
|
// Look for postmeta of another type
|
||||||
|
if ( $value = get_post_meta( absint( $post->ID ), $atts['data'], true ) )
|
||||||
|
return str_replace( '%self%', $value, $atts['before'] . $value . $atts['after'] );
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a directions link
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function get_directions_link( $post ) {
|
||||||
|
global $simple_map;
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
$address = $directions_url = '';
|
||||||
|
|
||||||
|
if ( $pm = get_metadata( 'post', $post ) ) {
|
||||||
|
|
||||||
|
$address .= empty( $pm['location_address'][0] ) ? '' : $pm['location_address'][0];
|
||||||
|
$address .= empty( $pm['location_city'][0] ) ? '' : ' '.$pm['location_city'][0];
|
||||||
|
$address .= empty( $pm['location_state'][0] ) ? '' : ' '.$pm['location_state'][0];
|
||||||
|
$address .= empty( $pm['location_zip'][0] ) ? '' : ' '.$pm['location_zip'][0];
|
||||||
|
$address .= empty( $pm['location_country'][0] ) ? '' : ' '.$pm['location_country'][0];
|
||||||
|
|
||||||
|
$directions_url = 'http://google' . $options['default_domain'] . '/maps?saddr=&daddr=' . urlencode( $address );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $directions_url;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
2369
classes/simplemap.php
Normal file
151
classes/templates.php
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file contains all our classes for the different location templates
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SM_Template_Factory Class
|
||||||
|
*
|
||||||
|
* A templating system for SimpleMap
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
if ( ! class_exists( 'SM_Template_Factory' ) ) {
|
||||||
|
|
||||||
|
class SM_Template_Factory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Template Type - single-location, map, results
|
||||||
|
*/
|
||||||
|
var $template_type = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The post_id for the template used by the current instance of this class
|
||||||
|
* Won't be implemented in 2.4
|
||||||
|
*/
|
||||||
|
var $template_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The content of the active template (the template itself)
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
var $template_structure = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inits the templating system. Don't init class prior to template_redirect hook
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
// Set the template type
|
||||||
|
$this->template_type = $this->set_template_type();
|
||||||
|
|
||||||
|
// Set the specific template for this view
|
||||||
|
$this->set_active_template();
|
||||||
|
|
||||||
|
// Add the filter
|
||||||
|
add_filter( 'the_content', array( &$this, 'apply_template' ), 1 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses wp_query to determine the template type we are going to use
|
||||||
|
* As of 2.4, the only opiton is single-location
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function set_template_type() {
|
||||||
|
|
||||||
|
global $post;
|
||||||
|
|
||||||
|
// Exit if we're not on a single disply of the location post type
|
||||||
|
if ( 'sm-location' != $post->post_type || ! is_single() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return 'single-location';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the template we will use for the current view based on a cascading set of rules
|
||||||
|
* If this is a single location view, do the following:
|
||||||
|
* <ul>
|
||||||
|
* <li>Check for specific template via post-meta
|
||||||
|
* <li>Check for default template</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function set_active_template() {
|
||||||
|
|
||||||
|
global $post;
|
||||||
|
|
||||||
|
// Switch based on template type
|
||||||
|
switch ( $this->template_type ) {
|
||||||
|
case 'single-location' :
|
||||||
|
default :
|
||||||
|
// Grab the ID for the specific template for this post if it is present
|
||||||
|
$template_id = ( get_post_meta( $post->ID, 'sm-location-template', false ) ) ? get_post_meta( $post->ID, 'sm-location-template', false ) : 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->template_id = $template_id;
|
||||||
|
$this->template_structure = $this->get_template_structure();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the actual template structure we're going to use for this object
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function get_template_structure() {
|
||||||
|
|
||||||
|
// Grab the post that contains the template strucutre or the hard_coded structure
|
||||||
|
if ( 0 != $this->template_id ) {
|
||||||
|
// get post obejct via ID
|
||||||
|
// return post_content
|
||||||
|
} else {
|
||||||
|
$return = "<div class='sm-single-location-default-template'>";
|
||||||
|
$return .= "<div class='sm-single-map'>[sm-location data='iframe-map' map_width='100px' map_height='100px']</div>";
|
||||||
|
$return .= "<div class='sm-single-location-data'>[sm-location data='full-address']";
|
||||||
|
$return .= "<br /><a href=\"[sm-location data='directions']\">Get Directions</a>";
|
||||||
|
$return .= "<ul class='sm-single-location-data-ul'>[sm-location data='phone' before='<li>' after='</li>'] [sm-location data='email' before='<li><a href=\"mailto:%self%\">' after='</a></li>'] [sm-location data='sm_category' format='csv' before='<li>Categories: ' after='</li>'] [sm-location data='sm_tag' format='csv' before='<li>Tags: ' after='</li>']</ul>";
|
||||||
|
$return .= "</div>";
|
||||||
|
$return .= "<hr style='clear:both;' />";
|
||||||
|
$return .= "</div>";
|
||||||
|
$return .= "[sm-location data='description']";
|
||||||
|
return apply_filters( 'sm-single-location-default-template', $return );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method applies the template to the content
|
||||||
|
*
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
|
function apply_template( $content ) {
|
||||||
|
|
||||||
|
// Return content untouched if not location data
|
||||||
|
if ( ! $this->template_type || ! $this->template_structure )
|
||||||
|
return $content;
|
||||||
|
|
||||||
|
// Return if not in the loop
|
||||||
|
if ( ! in_the_loop() )
|
||||||
|
return $content;
|
||||||
|
|
||||||
|
// Save the location 'description'
|
||||||
|
$location_description = $content;
|
||||||
|
|
||||||
|
// Send it through the shortcode parser
|
||||||
|
$content = do_shortcode( $this->template_structure );
|
||||||
|
|
||||||
|
return $content;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
256
classes/widgets.php
Normal file
|
@ -0,0 +1,256 @@
|
||||||
|
<?php
|
||||||
|
// Init Widgets
|
||||||
|
function simplemap_init_widgets() {
|
||||||
|
register_widget( 'SM_Search_Widget' );
|
||||||
|
}
|
||||||
|
add_action( 'widgets_init', 'simplemap_init_widgets' );
|
||||||
|
|
||||||
|
// Location Search Widget
|
||||||
|
class SM_Search_Widget extends WP_Widget {
|
||||||
|
|
||||||
|
// Define Widget
|
||||||
|
function SM_Search_Widget() {
|
||||||
|
$widget_ops = array( 'classname' => 'sm_search_widget', 'description' => __( "Adds a customizable search widget to your site" ) );
|
||||||
|
$this->WP_Widget('sm_search_widget', __('SimpleMap Search'), $widget_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
function widget( $args, $instance ) {
|
||||||
|
global $simple_map, $wp_rewrite;
|
||||||
|
|
||||||
|
extract( $args );
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
|
||||||
|
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'] );
|
||||||
|
|
||||||
|
// Search Form Options
|
||||||
|
$show_address = $instance['show_address'] ? 1 : 0;
|
||||||
|
$show_city = $instance['show_city'] ? 1 : 0;
|
||||||
|
$show_state = $instance['show_state'] ? 1 : 0;
|
||||||
|
$show_zip = $instance['show_zip'] ? 1 : 0;
|
||||||
|
$show_distance = $instance['show_distance'] ? 1 : 0;
|
||||||
|
|
||||||
|
$default_lat = $instance['default_lat'] ? $instance['default_lat'] : 0;
|
||||||
|
$default_lng = $instance['default_lng'] ? $instance['default_lng'] : 0;
|
||||||
|
$simplemap_page = $instance['simplemap_page'] ? $instance['simplemap_page'] : 2;
|
||||||
|
|
||||||
|
// Set taxonomies to available equivalents
|
||||||
|
$show = array();
|
||||||
|
$terms = array();
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
$key = strtolower( $tax_info['plural'] );
|
||||||
|
$show[$taxonomy] = $instance['show_' . $key] ? 1 : 0;
|
||||||
|
$terms[$taxonomy] = $instance[$key] ? $instance[$key] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$available = $terms;
|
||||||
|
|
||||||
|
echo $before_widget;
|
||||||
|
if ( $title )
|
||||||
|
echo '<span class="sm-search-widget-title">' . $before_title . $title . $after_title . '</span>';
|
||||||
|
|
||||||
|
// Form Field Values
|
||||||
|
$address_value = isset( $_REQUEST['location_search_address'] ) ? $_REQUEST['location_search_address'] : '';
|
||||||
|
$city_value = isset( $_REQUEST['location_search_city'] ) ? $_REQUEST['location_search_city'] : '';
|
||||||
|
$state_value = isset( $_REQUEST['location_search_state'] ) ? $_REQUEST['location_search_state'] : '';
|
||||||
|
$zip_value = isset( $_REQUEST['location_search_zip'] ) ? $_REQUEST['location_search_zip'] : '';
|
||||||
|
$radius_value = isset( $_REQUEST['location_search_distance'] ) ? $_REQUEST['location_search_distance'] : $options['default_radius'];
|
||||||
|
$limit_value = isset( $_REQUEST['location_search_limit'] ) ? $_REQUEST['location_search_limit'] : $options['results_limit'];
|
||||||
|
|
||||||
|
// Set action based on permalink structure
|
||||||
|
if ( ! $wp_rewrite->permalink_structure ) {
|
||||||
|
$method = 'get';
|
||||||
|
$action = site_url();
|
||||||
|
} else {
|
||||||
|
$method = 'post';
|
||||||
|
$action = get_permalink( absint( $simplemap_page ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
$location_search = '<div id="location_widget_search" >';
|
||||||
|
$location_search .= '<form name="location_widget_search_form" id="location_widget_search_form" action="' . $action . '" method="' . $method . '">';
|
||||||
|
$location_search .= '<table class="location_search_widget">';
|
||||||
|
|
||||||
|
$location_search .= apply_filters( 'sm-location-search-widget-table-top', '' );
|
||||||
|
|
||||||
|
if ( $show_address )
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_address_cell location_search_widget_cell">' . apply_filters( 'sm-search-label-street', __( 'Street', 'SimpleMap' ) ) . ':<br /><input type="text" id="location_search_widget_address_field" name="location_search_address" /></td></tr>';
|
||||||
|
if ( $show_city )
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_city_cell location_search_widget_cell">' . apply_filters( 'sm-search-label-city', __( 'City', 'SimpleMap' ) ) . ':<br /><input type="text" id="location_search_widget_city_field" name="location_search_city" /></td></tr>';
|
||||||
|
if ( $show_state )
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_state_cell location_search_widget_cell">' . apply_filters( 'sm-search-label-state', __( 'State', 'SimpleMap' ) ) . ':<br /><input type="text" id="location_search_widget_state_field" name="location_search_state" /></td></tr>';
|
||||||
|
if ( $show_zip )
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_zip_cell location_search_widget_cell">' . apply_filters( 'sm-search-label-zip', __( 'Zip', 'SimpleMap' ) ) . ':<br /><input type="text" id="location_search_widget_zip_field" name="location_search_zip" /></td></tr>';
|
||||||
|
if ( $show_distance ) {
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_distance_cell location_search_widget_cell">' . apply_filters( 'sm-search-label-distance', __( 'Select a distance', 'SimpleMap' ) ) . ':<br /><select id="location_search_widget_distance_field" name="location_search_distance" >';
|
||||||
|
|
||||||
|
foreach ( $simple_map->get_search_radii() as $value ) {
|
||||||
|
$r = (int) $value;
|
||||||
|
$location_search .= '<option value="' . $value . '"' . selected( $radius_value, $value, false ) . '>' . $value . ' ' . $options['units'] . "</option>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$location_search .= '</select></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
// Place available values in array
|
||||||
|
$available = explode( ',', $available[$taxonomy] );
|
||||||
|
$valid = array();
|
||||||
|
|
||||||
|
// Loop through all days and create array of available days
|
||||||
|
if ( $all_terms = get_terms( $taxonomy ) ) {
|
||||||
|
foreach ( $all_terms as $key => $value ) {
|
||||||
|
if ( '' == $available[0] || in_array( $value->term_id, $available ) ) {
|
||||||
|
$valid[] = $value->term_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show day filters if allowed
|
||||||
|
if ( ! empty( $show[$taxonomy] ) && $all_terms ) {
|
||||||
|
$php_taxonomy = str_replace( '-', '_', $taxonomy );
|
||||||
|
$term_search = '<tr><td class="location_search_' . strtolower( $tax_info['singular'] ) . '_cell location_search_cell">' . apply_filters( $php_taxonomy . '-text',__( $tax_info['plural'], 'SimpleMap' ) ) . ':<br />';
|
||||||
|
|
||||||
|
// Print checkbox for each available day
|
||||||
|
foreach( $valid as $key => $termid ) {
|
||||||
|
if( $term = get_term_by( 'id', $termid, $taxonomy ) ) {
|
||||||
|
$term_search .= '<label for="location_search_widget_' . strtolower( $tax_info['plural'] ) . '_field_' . esc_attr( $term->term_id ) . '" class="no-linebreak"><input type="checkbox" name="location_search_' . $php_taxonomy . '_' . esc_attr( $term->term_id ) . 'field" id="location_search_widget_' . strtolower( $tax_info['plural'] ) . '_field_' . esc_attr( $term->term_id ) . '" value="' . esc_attr( $term->term_id ) . '" /> ' . esc_attr( $term->name ) . ' </label> ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$term_search .= '</td></tr>';
|
||||||
|
} else {
|
||||||
|
// Default day_selected is none
|
||||||
|
$term_search = '<input type="hidden" name="location_search_' . strtolower( $tax_info['plural'] ) . '_field" value="" checked="checked" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hidden field for available days. We'll need this in the event that nothing is selected
|
||||||
|
$term_search .= '<input type="hidden" id="avail_' . strtolower( $tax_info['plural'] ) . '" value="' . esc_attr( $terms[$taxonomy] ) . '" />';
|
||||||
|
|
||||||
|
$term_search = apply_filters( 'sm-location-' . strtolower( $tax_info['singular'] ) . '-search-widget', $term_search );
|
||||||
|
$location_search .= $term_search;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default lat / lng from shortcode?
|
||||||
|
if ( ! $default_lat )
|
||||||
|
$default_lat = $options['default_lat'];
|
||||||
|
if ( ! $default_lng )
|
||||||
|
$default_lng = $options['default_lng'];
|
||||||
|
|
||||||
|
$location_search .= "<input type='hidden' id='location_search_widget_default_lat' value='" . $default_lat . "' />";
|
||||||
|
$location_search .= "<input type='hidden' id='location_search_widget_default_lng' value='" . $default_lng . "' />";
|
||||||
|
|
||||||
|
// Hidden value for limit
|
||||||
|
$location_search .= "<input type='hidden' name='location_search_widget_limit' id='location_search_widget_limit' value='" . $limit_value . "' />";
|
||||||
|
|
||||||
|
// Hidden value set to true if we got here via search
|
||||||
|
$location_search .= "<input type='hidden' id='location_is_search_widget_results' name='location_is_search_results' value='1' />";
|
||||||
|
|
||||||
|
// Hidden value referencing page_id
|
||||||
|
$location_search .= "<input type='hidden' name='page_id' value='" . absint( $simplemap_page ) . "' />";
|
||||||
|
|
||||||
|
$location_search .= apply_filters( 'sm-location-search-widget-before-submit', '' );
|
||||||
|
|
||||||
|
$location_search .= '<tr><td class="location_search_widget_submit_cell location_search_widget_cell"> <input type="submit" value="' . apply_filters( 'sm-search-label-search', __( 'Search', 'SimpleMap' ) ) . '" id="location_search_widget_submit_field" class="submit" /></td></tr>';
|
||||||
|
$location_search .= '</table>';
|
||||||
|
$location_search .= '</form>';
|
||||||
|
$location_search .= '</div>'; // close map_search div
|
||||||
|
|
||||||
|
echo $location_search;
|
||||||
|
|
||||||
|
echo $after_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save settings in backend
|
||||||
|
function update( $new_instance, $old_instance ) {
|
||||||
|
$instance = $old_instance;
|
||||||
|
|
||||||
|
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||||
|
$instance['show_address'] = $new_instance['show_address'] ? 1 : 0;
|
||||||
|
$instance['show_city'] = $new_instance['show_city'] ? 1 : 0;
|
||||||
|
$instance['show_state'] = $new_instance['show_state'] ? 1 : 0;
|
||||||
|
$instance['show_zip'] = $new_instance['show_zip'] ? 1 : 0;
|
||||||
|
$instance['show_distance'] = $new_instance['show_distance'] ? 1 : 0;
|
||||||
|
$instance['default_lat'] = $new_instance['default_lat'] ? $new_instance['default_lat'] : 0;
|
||||||
|
$instance['default_lng'] = $new_instance['default_lng'] ? $new_instance['default_lng'] : 0;
|
||||||
|
$instance['simplemap_page'] = $new_instance['simplemap_page'] ? $new_instance['simplemap_page'] : 2;
|
||||||
|
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
$key = strtolower( $tax_info['plural'] );
|
||||||
|
$instance['show_' . $key] = $new_instance['show_' . $key] ? 1 : 0;
|
||||||
|
$instance[$key] = $new_instance[$key] ? $new_instance[$key] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
function form( $instance ) {
|
||||||
|
//Defaults
|
||||||
|
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
||||||
|
|
||||||
|
$title = esc_attr( $instance['title'] );
|
||||||
|
$show_address = isset( $instance['show_address'] ) ? (bool) $instance['show_address'] : false;
|
||||||
|
$show_city = isset( $instance['show_city'] ) ? (bool) $instance['show_city'] : false;
|
||||||
|
$show_state = isset( $instance['show_state'] ) ? (bool) $instance['show_state'] : false;
|
||||||
|
$show_zip = isset( $instance['show_zip'] ) ? (bool) $instance['show_zip'] : false;
|
||||||
|
$show_distance = isset( $instance['show_distance'] ) ? (bool) $instance['show_distance'] : false;
|
||||||
|
$default_lat = isset( $instance['default_lat'] ) ? esc_attr( $instance['default_lat'] ) : 0;
|
||||||
|
$default_lng = isset( $instance['default_lng'] ) ? esc_attr( $instance['default_lng'] ) : 0;
|
||||||
|
$simplemap_page = isset( $instance['simplemap_page'] ) ? esc_attr( $instance['simplemap_page'] ) : '';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
||||||
|
|
||||||
|
<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_address' ); ?>" name="<?php echo $this->get_field_name( 'show_address' ); ?>"<?php checked( $show_address ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( 'show_address' ); ?>"><?php _e( 'Show Address', 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_city' ); ?>" name="<?php echo $this->get_field_name( 'show_city' ); ?>"<?php checked( $show_city ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( 'show_city' ); ?>"><?php _e( 'Show City', 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_state' ); ?>" name="<?php echo $this->get_field_name( 'show_state' ); ?>"<?php checked( $show_state ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( 'show_state' ); ?>"><?php _e( 'Show State', 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_zip' ); ?>" name="<?php echo $this->get_field_name( 'show_zip' ); ?>"<?php checked( $show_zip ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( 'show_zip' ); ?>"><?php _e( 'Show Zip', 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'show_distance' ); ?>" name="<?php echo $this->get_field_name( 'show_distance' ); ?>"<?php checked( $show_distance ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( 'show_distance' ); ?>"><?php _e( 'Show Distance', 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<?php
|
||||||
|
global $simple_map;
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) {
|
||||||
|
$key = strtolower( $tax_info['plural'] );
|
||||||
|
$show_field = 'show_' . $key;
|
||||||
|
$show = isset( $instance[$show_field] ) ? (bool) $instance[$show_field] : false;
|
||||||
|
?>
|
||||||
|
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( $show_field ); ?>" name="<?php echo $this->get_field_name( $show_field ); ?>"<?php checked( $show ); ?> />
|
||||||
|
<label for="<?php echo $this->get_field_id( $show_field ); ?>"><?php _e( 'Show ' . $tax_info['plural'], 'SimpleMap' ); ?></label><br />
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/** TODO: The commented out code below isn't working yet. Implement it.
|
||||||
|
$values = isset( $instance[$key] ) ? esc_attr( $instance[$key] ) : '';
|
||||||
|
?>
|
||||||
|
<p><label for="<?php echo $this->get_field_id( $key ); ?>"><?php _e( $tax_info['plural'] . ':', 'SimpleMap' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id( $key ); ?>" name="<?php echo $this->get_field_name( $key ); ?>" type="text" value="<?php echo $values; ?>" /></p>
|
||||||
|
<?php
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/** TODO: The commented out code below isn't working yet. Implement it.
|
||||||
|
<p><label for="<?php echo $this->get_field_id( 'default_lat' ); ?>"><?php _e( 'Default Lat:', 'SimpleMap' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id( 'default_lat' ); ?>" name="<?php echo $this->get_field_name( 'default_lat' ); ?>" type="text" value="<?php echo $default_lat; ?>" /></p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id( 'default_lng' ); ?>"><?php _e( 'Default Lng:', 'SimpleMap' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id( 'default_lng' ); ?>" name="<?php echo $this->get_field_name( 'default_lng' ); ?>" type="text" value="<?php echo $default_lng; ?>" /></p>
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<p><label for="<?php echo $this->get_field_id( 'simplemap_page' ); ?>"><?php _e( 'SimpleMap Page or Post ID:', 'SimpleMap' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id( 'simplemap_page' ); ?>" name="<?php echo $this->get_field_name( 'simplemap_page' ); ?>" type="text" value="<?php echo $simplemap_page; ?>" /></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
198
classes/xml-search.php
Normal file
|
@ -0,0 +1,198 @@
|
||||||
|
<?php
|
||||||
|
if ( !class_exists( 'SM_XML_Search' ) ){
|
||||||
|
class SM_XML_Search{
|
||||||
|
// Register hook to perform the search
|
||||||
|
function sm_xml_search() {
|
||||||
|
add_action( 'template_redirect', array( &$this, 'init_search' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inits the search process. Collects default options, search options, and queries DB
|
||||||
|
function init_search() {
|
||||||
|
if ( isset( $_GET['sm-xml-search'] ) ) {
|
||||||
|
global $wpdb, $simple_map;
|
||||||
|
remove_filter( 'the_title', 'at_title_check' );
|
||||||
|
|
||||||
|
$defaults = array(
|
||||||
|
'lat' => false,
|
||||||
|
'lng' => false,
|
||||||
|
'radius' => false,
|
||||||
|
'namequery' => false,
|
||||||
|
'query_type' => 'distance',
|
||||||
|
'address' => false,
|
||||||
|
'city' => false,
|
||||||
|
'state' => false,
|
||||||
|
'zip' => false,
|
||||||
|
'onlyzip' => false,
|
||||||
|
'country' => false,
|
||||||
|
'limit' => false,
|
||||||
|
'pid' => 0,
|
||||||
|
);
|
||||||
|
$input = array_filter( array_intersect_key( $_GET, $defaults ) ) + $defaults;
|
||||||
|
|
||||||
|
$smtaxes = array();
|
||||||
|
if ( $taxonomies = get_object_taxonomies( 'sm-location' ) ) {
|
||||||
|
foreach ( $taxonomies as $key => $tax ) {
|
||||||
|
$phpsafe = str_replace( '-', '_', $tax );
|
||||||
|
$_GET += array( $phpsafe => '' );
|
||||||
|
$smtaxes[$tax] = $_GET[$phpsafe];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define my empty strings
|
||||||
|
$distance_select = $distance_having = $distance_order = '';
|
||||||
|
|
||||||
|
// We're going to do a hard limit to 5000 for now.
|
||||||
|
if ( !$input['limit'] || $input['limit'] > 250 )
|
||||||
|
$limit = "LIMIT 250";
|
||||||
|
else
|
||||||
|
$limit = 'LIMIT ' . absint( $input['limit'] );
|
||||||
|
|
||||||
|
$limit = apply_filters( 'sm-xml-search-limit', $limit );
|
||||||
|
|
||||||
|
// Locations within specific distance or just get them all?
|
||||||
|
$distance_select = $wpdb->prepare( "( 3959 * ACOS( COS( RADIANS(%s) ) * COS( RADIANS( lat_tbl.meta_value ) ) * COS( RADIANS( lng_tbl.meta_value ) - RADIANS(%s) ) + SIN( RADIANS(%s) ) * SIN( RADIANS( lat_tbl.meta_value ) ) ) ) AS distance", $input['lat'], $input['lng'], $input['lat'] ) . ', ';
|
||||||
|
$distance_order = 'distance, ';
|
||||||
|
|
||||||
|
if ( $input['radius'] ) {
|
||||||
|
$input['radius'] = ( $input['radius'] < 1 ) ? 1 : $input['radius'];
|
||||||
|
$distance_having = $wpdb->prepare( "HAVING distance < %d", $input['radius'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = 1;
|
||||||
|
$taxonomy_join = '';
|
||||||
|
foreach ( array_filter( $smtaxes ) as $taxonomy => $tax_value ) {
|
||||||
|
$term_ids = explode( ',', $tax_value );
|
||||||
|
if ( $term_ids[0] == 'OR' ) {
|
||||||
|
unset( $term_ids[0] );
|
||||||
|
if ( empty( $term_ids ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$search_values = array( "IN (" . vsprintf( '%d' . str_repeat( ',%d', count( $term_ids ) - 1 ), $term_ids ) . ")" );
|
||||||
|
} else {
|
||||||
|
$search_values = array();
|
||||||
|
foreach ( $term_ids as $term_id ) {
|
||||||
|
$search_values[] = sprintf( '= %d', $term_id );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ( $search_values as $search_value ) {
|
||||||
|
$taxonomy_join .= "
|
||||||
|
INNER JOIN
|
||||||
|
$wpdb->term_relationships AS term_rel_$i ON posts.ID = term_rel_$i.object_id
|
||||||
|
INNER JOIN
|
||||||
|
$wpdb->term_taxonomy AS tax_$i ON
|
||||||
|
term_rel_$i.term_taxonomy_id = tax_$i.term_taxonomy_id
|
||||||
|
AND tax_$i.taxonomy = '$taxonomy'
|
||||||
|
AND tax_$i.term_id $search_value
|
||||||
|
";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
lat_tbl.meta_value AS lat,
|
||||||
|
lng_tbl.meta_value AS lng,
|
||||||
|
$distance_select
|
||||||
|
posts.ID,
|
||||||
|
posts.post_content,
|
||||||
|
posts.post_title
|
||||||
|
FROM
|
||||||
|
$wpdb->posts AS posts
|
||||||
|
INNER JOIN
|
||||||
|
$wpdb->postmeta lat_tbl ON lat_tbl.post_id = posts.ID AND lat_tbl.meta_key = 'location_lat'
|
||||||
|
INNER JOIN
|
||||||
|
$wpdb->postmeta lng_tbl ON lng_tbl.post_id = posts.ID AND lng_tbl.meta_key = 'location_lng'
|
||||||
|
$taxonomy_join
|
||||||
|
WHERE
|
||||||
|
posts.post_type = 'sm-location'
|
||||||
|
AND posts.post_status = 'publish'
|
||||||
|
GROUP BY
|
||||||
|
posts.ID
|
||||||
|
$distance_having
|
||||||
|
ORDER BY " . apply_filters( 'sm-location-sort-order', $distance_order . ' posts.post_name ASC', $input ) . " " . $limit;
|
||||||
|
|
||||||
|
$sql = apply_filters( 'sm-xml-search-locations-sql', $sql );
|
||||||
|
|
||||||
|
// TODO: Consider using this to generate the marker node attributes in print_xml().
|
||||||
|
$location_field_map = array(
|
||||||
|
'location_address' => 'address',
|
||||||
|
'location_address2' => 'address2',
|
||||||
|
'location_city' => 'city',
|
||||||
|
'location_state' => 'state',
|
||||||
|
'location_zip' => 'zip',
|
||||||
|
'location_country' => 'country',
|
||||||
|
'location_phone' => 'phone',
|
||||||
|
'location_fax' => 'fax',
|
||||||
|
'location_email' => 'email',
|
||||||
|
'location_url' => 'url',
|
||||||
|
'location_special' => 'special',
|
||||||
|
);
|
||||||
|
|
||||||
|
$options = $simple_map->get_options();
|
||||||
|
$show_permalink = !empty( $options['enable_permalinks'] );
|
||||||
|
|
||||||
|
if ( $locations = $wpdb->get_results( $sql ) ) {
|
||||||
|
// Start looping through all locations i found in the radius
|
||||||
|
foreach ( $locations as $key => $value ) {
|
||||||
|
// Add postmeta data to location
|
||||||
|
$custom_fields = get_post_custom( $value->ID );
|
||||||
|
foreach ( $location_field_map as $key => $field ) {
|
||||||
|
if ( isset( $custom_fields[$key][0] ) ) {
|
||||||
|
$value->$field = $custom_fields[$key][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$value->$field = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$value->postid = $value->ID;
|
||||||
|
$value->name = apply_filters( 'the_title', $value->post_title );
|
||||||
|
|
||||||
|
$the_content = trim( $value->post_content );
|
||||||
|
if ( !empty( $the_content ) ) {
|
||||||
|
$the_content = apply_filters( 'the_content', $the_content );
|
||||||
|
}
|
||||||
|
$value->description = $the_content;
|
||||||
|
|
||||||
|
$value->permalink = '';
|
||||||
|
if ( $show_permalink ) {
|
||||||
|
$value->permalink = get_permalink( $value->ID );
|
||||||
|
$value->permalink = apply_filters( 'the_permalink', $value->permalink );
|
||||||
|
}
|
||||||
|
|
||||||
|
// List all terms for all taxonomies for this post
|
||||||
|
$value->taxes = array();
|
||||||
|
foreach ( $smtaxes as $taxonomy => $tax_value ) {
|
||||||
|
$phpsafe_tax = str_replace( '-', '_', $taxonomy );
|
||||||
|
$local_tax_names = '';
|
||||||
|
|
||||||
|
// Get all taxes for this post
|
||||||
|
if ( $local_taxes = wp_get_object_terms( $value->ID, $taxonomy, array( 'fields' => 'names' ) ) ) {
|
||||||
|
$local_tax_names = implode( ', ', $local_taxes );
|
||||||
|
}
|
||||||
|
|
||||||
|
$value->taxes[$phpsafe_tax] = $local_tax_names;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Print empty XML
|
||||||
|
$locations = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$locations = apply_filters( 'sm-xml-search-locations', $locations );
|
||||||
|
$this->print_json( $locations, $smtaxes );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prints the JSON output
|
||||||
|
function print_json( $dataset, $smtaxes ) {
|
||||||
|
header( 'Status: 200 OK', false, 200 );
|
||||||
|
header( 'Content-type: application/json' );
|
||||||
|
do_action( 'sm-xml-search-headers' );
|
||||||
|
|
||||||
|
do_action( 'sm-print-json', $dataset, $smtaxes );
|
||||||
|
|
||||||
|
echo json_encode( $dataset );
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
inc/images/black-dot.png
Normal file
After Width: | Height: | Size: 401 B |
BIN
inc/images/blue-dot.png
Normal file
After Width: | Height: | Size: 913 B |
BIN
inc/images/blue-grad.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
inc/images/button-red-grad-active.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
inc/images/button-red-grad.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
inc/images/green-dot.png
Normal file
After Width: | Height: | Size: 886 B |
BIN
inc/images/icon.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
inc/images/loading.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
inc/images/map-type-hybrid.jpg
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
inc/images/map-type-normal.jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
inc/images/map-type-satellite.jpg
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
inc/images/map-type-terrain.jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
inc/images/pink-dot.png
Normal file
After Width: | Height: | Size: 917 B |
BIN
inc/images/purple-dot.png
Normal file
After Width: | Height: | Size: 909 B |
BIN
inc/images/red-dot.png
Normal file
After Width: | Height: | Size: 893 B |
BIN
inc/images/star.png
Normal file
After Width: | Height: | Size: 608 B |
BIN
inc/images/teal-dot.png
Normal file
After Width: | Height: | Size: 927 B |
BIN
inc/images/white-dot.png
Normal file
After Width: | Height: | Size: 553 B |
BIN
inc/images/yellow-dot.png
Normal file
After Width: | Height: | Size: 956 B |
179
inc/styles/admin.css
Normal file
|
@ -0,0 +1,179 @@
|
||||||
|
#simplemap img {
|
||||||
|
background: none !important;
|
||||||
|
padding: none !important;
|
||||||
|
max-width: none !important;
|
||||||
|
max-height: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.toplevel_page_simplemap-simplemap small, body.simplemap_page_Add-Location small, body.simplemap_page_Manage-Database small, body.simplemap_page_Manage-Categories small, body.simplemap_page_Import-Export small {
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
select option span.hidden {
|
||||||
|
display: none !important;
|
||||||
|
visibility: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inline-editor {
|
||||||
|
background: #ffffe0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-red {
|
||||||
|
border-color: #900 !important;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff !important;
|
||||||
|
background: #c00 url( ../images/button-red-grad.png ) repeat-x scroll left top;
|
||||||
|
text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-red:active {
|
||||||
|
background: #c00 url( ../images/button-red-grad-active.png ) repeat-x scroll left top !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.disabled-text {
|
||||||
|
font: italic 13px Georgia;
|
||||||
|
float: right;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.title, label span.title {
|
||||||
|
display: inline-block;
|
||||||
|
width: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.title.title_long, label.long span.title.title_long {
|
||||||
|
width: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.fix_width, select.fix_width, textarea.fix_width {
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.full_width, select.full_width, textarea.full_width {
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disabled {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
span#ala {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postbox .sub {
|
||||||
|
color: rgb(119, 119, 119);
|
||||||
|
font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;
|
||||||
|
font-size: 13px;
|
||||||
|
font-style: italic;
|
||||||
|
padding: 5px 10px 15px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postbox h3 {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
form.inabox {
|
||||||
|
padding: 10px;
|
||||||
|
background: #ffffe0;
|
||||||
|
border: 1px solid #e6db55;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-khtml-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form.inabox label {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-thumbnail {
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-thumbnail:hover {
|
||||||
|
margin: 0;
|
||||||
|
background-color: #eaf2fa;
|
||||||
|
border: 1px solid #93d8e2;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-khtml-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-thumbnail-current {
|
||||||
|
margin: 0;
|
||||||
|
background-color: #ffffe0;
|
||||||
|
border: 1px solid #e6db55;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-khtml-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.server-tests {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.server-tests td {
|
||||||
|
padding: 2px;
|
||||||
|
border: 1px solid #999;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar {
|
||||||
|
width: 97%;
|
||||||
|
margin-top: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar td {
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar td.sm-page-title {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar td.sm-page-title h2 {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar-item {
|
||||||
|
width: 100px;
|
||||||
|
text-align: center;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-khtml-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #f9f9f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar-item:hover {
|
||||||
|
background-color: #eaf2fa;
|
||||||
|
border-color: #93d8e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar-item a {
|
||||||
|
text-decoration: none;
|
||||||
|
font: bold italic 1.1em Georgia;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-toolbar-item form {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sm-location-premium-support h3 {
|
||||||
|
background: #fff url( ../images/blue-grad.png ) top left repeat-x;
|
||||||
|
color:#fff;
|
||||||
|
text-shadow:0 1px 0 #000;
|
||||||
|
}
|
214
inc/styles/dark.css
Normal file
|
@ -0,0 +1,214 @@
|
||||||
|
/*
|
||||||
|
Theme Name: Dark
|
||||||
|
*/
|
||||||
|
|
||||||
|
#simplemap {
|
||||||
|
border: 1px solid #999;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap img {
|
||||||
|
background: none !important;
|
||||||
|
padding: none !important;
|
||||||
|
max-width: none !important;
|
||||||
|
max-height: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap a {
|
||||||
|
color: #00c;
|
||||||
|
background: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap a:hover {
|
||||||
|
background: none;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap {
|
||||||
|
font-size: 0.75em;
|
||||||
|
text-align: right;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap a {
|
||||||
|
color: #999;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm input#addressInput {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm input#addressSubmit {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm select {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm p {
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#map_search label {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#map_search .float_text_left {
|
||||||
|
float: left;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap-updating {
|
||||||
|
display:none;
|
||||||
|
background:#fff;
|
||||||
|
color:#000;
|
||||||
|
vertical-align:middle;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap-updating img {
|
||||||
|
vertical-align:middle;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext {
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 1.2em;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext .bubble_category {
|
||||||
|
font-size: 0.6em;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext a {
|
||||||
|
color: #00c;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext h3 {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
text-align: left !important;
|
||||||
|
line-height: 1.2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext .search-term {
|
||||||
|
background: #ff6;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#results {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 5px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 1.2em;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result small {
|
||||||
|
font-size: 0.7em;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result:hover {
|
||||||
|
background: #ebf0f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result address {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result h3 {
|
||||||
|
margin: 0 0 5px;
|
||||||
|
font-size: 1.5em;
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result img {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result .search-term {
|
||||||
|
background: #ff6;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_name {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_address {
|
||||||
|
float: left;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_phone {
|
||||||
|
float: left;
|
||||||
|
width: 30%;
|
||||||
|
height: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_links {
|
||||||
|
float: left;
|
||||||
|
display: table-cell;
|
||||||
|
width: 30%;
|
||||||
|
text-align: right;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_links div {
|
||||||
|
clear: right;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.special {
|
||||||
|
float: right;
|
||||||
|
height: 20px;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: italic;
|
||||||
|
background: url( ../images/star.png ) no-repeat left center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.location_search_title, .location_search_distance_cell, .location_search_taxonomy_cell {
|
||||||
|
font-weight:bold;
|
||||||
|
vertical-align:top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-linebreak {
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-default-template {
|
||||||
|
padding:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-map {
|
||||||
|
float:left;
|
||||||
|
width:105px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-data {
|
||||||
|
margin-left:105px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-data-ul {
|
||||||
|
|
217
inc/styles/light.css
Normal file
|
@ -0,0 +1,217 @@
|
||||||
|
/*
|
||||||
|
Theme Name: Light
|
||||||
|
*/
|
||||||
|
|
||||||
|
#simplemap {
|
||||||
|
border: 1px solid #999;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap img {
|
||||||
|
background: none !important;
|
||||||
|
padding: none !important;
|
||||||
|
max-width: none !important;
|
||||||
|
max-height: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap a {
|
||||||
|
color: #00c;
|
||||||
|
background: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap a:hover {
|
||||||
|
background: none;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap {
|
||||||
|
font-size: 0.75em;
|
||||||
|
text-align: right;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap a {
|
||||||
|
color: #999;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#powered_by_simplemap a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm input#addressInput {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm input#addressSubmit {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm select {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchForm p {
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#map_search label {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#map_search .float_text_left {
|
||||||
|
float: left;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap-updating {
|
||||||
|
display:none;
|
||||||
|
background:#fff;
|
||||||
|
color:#000;
|
||||||
|
vertical-align:middle;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#simplemap-updating img {
|
||||||
|
vertical-align:middle;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext {
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 1.2em;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext .bubble_category {
|
||||||
|
font-size: 0.6em;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext a {
|
||||||
|
color: #00c;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext h3 {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
text-align: left !important;
|
||||||
|
line-height: 1.2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markertext .search-term {
|
||||||
|
background: #ff6;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#results {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 5px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 1.2em;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result small {
|
||||||
|
font-size: 0.7em;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result:hover {
|
||||||
|
background: #ebf0f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result address {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result h3 {
|
||||||
|
margin: 0 0 5px;
|
||||||
|
font-size: 1.5em;
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result img {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result .search-term {
|
||||||
|
background: #ff6;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_name {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_address {
|
||||||
|
float: left;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_phone {
|
||||||
|
float: left;
|
||||||
|
width: 30%;
|
||||||
|
height: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_links {
|
||||||
|
float: left;
|
||||||
|
display: table-cell;
|
||||||
|
width: 30%;
|
||||||
|
text-align: right;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.result_links div {
|
||||||
|
clear: right;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.result div.special {
|
||||||
|
float: right;
|
||||||
|
height: 20px;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: italic;
|
||||||
|
background: url( ../images/star.png ) no-repeat left center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.location_search_title, .location_search_distance_cell, .location_search_taxonomy_cell {
|
||||||
|
font-weight:bold;
|
||||||
|
vertical-align:top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-linebreak {
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-default-template {
|
||||||
|
padding:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-map {
|
||||||
|
float:left;
|
||||||
|
width:105px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-data {
|
||||||
|
margin-left:105px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-single-location-data-ul {
|
||||||
|
list-style-type:none;
|
||||||
|
padding-left:0;
|
||||||
|
margin-left:0;
|
||||||
|
}
|
BIN
lang/SimpleMap-de_DE.mo
Normal file
934
lang/SimpleMap-de_DE.po
Normal file
|
@ -0,0 +1,934 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: SimpleMap\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2009-11-02 20:05-0600\n"
|
||||||
|
"PO-Revision-Date: \n"
|
||||||
|
"Last-Translator: Alison Barrett <alison@alisothegeek.com>\n"
|
||||||
|
"Language-Team: Thorsten Karras\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: English\n"
|
||||||
|
"X-Poedit-SourceCharset: utf-8\n"
|
||||||
|
"X-Poedit-KeywordsList: __;_e\n"
|
||||||
|
"X-Poedit-Basepath: ../\n"
|
||||||
|
"X-Poedit-Country: GERMANY\n"
|
||||||
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
"X-Poedit-SearchPath-1: admin\n"
|
||||||
|
"X-Poedit-SearchPath-2: includes\n"
|
||||||
|
|
||||||
|
#: simplemap.php:13
|
||||||
|
msgid "SimpleMap requires WordPress 2.8 or newer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Please update!</a>"
|
||||||
|
msgstr "SimpleMap benötigt WordPress 2.8 oder neuer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Bitte updaten!</a>"
|
||||||
|
|
||||||
|
#: simplemap.php:114
|
||||||
|
msgid "SimpleMap Options"
|
||||||
|
msgstr "SimpleMap Optionen"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/general-options.php:160
|
||||||
|
msgid "SimpleMap: General Options"
|
||||||
|
msgstr "SimpleMap: Allgemeine Optionen"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:65
|
||||||
|
msgid "General Options"
|
||||||
|
msgstr "Allgemeine Optionen"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:27
|
||||||
|
msgid "SimpleMap: Add Location"
|
||||||
|
msgstr "SimpleMap: Ort Hinzufügen"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:217
|
||||||
|
#: admin/add-location.php:218
|
||||||
|
msgid "Add Location"
|
||||||
|
msgstr "Ort Hinzufügen"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:45
|
||||||
|
msgid "SimpleMap: Manage Database"
|
||||||
|
msgstr "SimpleMap: Datenbank bearbeiten"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:77
|
||||||
|
#: admin/manage-db.php:83
|
||||||
|
#: admin/manage-db.php:89
|
||||||
|
#: admin/manage-db.php:90
|
||||||
|
#: admin/manage-db.php:108
|
||||||
|
#: admin/manage-db.php:117
|
||||||
|
#: admin/manage-db.php:123
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:277
|
||||||
|
#: admin/manage-db.php:286
|
||||||
|
#: admin/manage-db.php:292
|
||||||
|
msgid "Manage Database"
|
||||||
|
msgstr "Datenbank bearbeiten"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:25
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Manage Categories"
|
||||||
|
msgstr "SimpleMap: Datenbank bearbeiten"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:88
|
||||||
|
#: admin/manage-categories.php:97
|
||||||
|
#: admin/manage-categories.php:103
|
||||||
|
#: admin/manage-categories.php:174
|
||||||
|
#: admin/manage-categories.php:183
|
||||||
|
#: admin/manage-categories.php:189
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Manage Categories"
|
||||||
|
msgstr "Datenbank bearbeiten"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "SimpleMap: Import/Export"
|
||||||
|
msgstr "SimpleMap: Import/Export"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "Import/Export"
|
||||||
|
msgstr "Import/Export"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/help.php:18
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Help"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
msgid "Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Help"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: simplemap.php:170
|
||||||
|
msgid "SimpleMap settings saved."
|
||||||
|
msgstr "SimpleMap Einstellungen gespeichert."
|
||||||
|
|
||||||
|
#: simplemap.php:274
|
||||||
|
msgid "Class SimpleMap already declared!"
|
||||||
|
msgstr "Klasse SimpleMap schon definiert!"
|
||||||
|
|
||||||
|
#: simplemap.php:303
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr "Einstellungen"
|
||||||
|
|
||||||
|
#: actions/category-update.php:15
|
||||||
|
msgid "Your database has been successfully updated."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:200
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" failed to geocode, with status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:222
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" was not successfully inserted into the database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:233
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%d records imported successfully."
|
||||||
|
msgstr "Erfolgreich hinzugefügt."
|
||||||
|
|
||||||
|
#: actions/location-process.php:17
|
||||||
|
msgid "Record deleted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:26
|
||||||
|
msgid "Database cleared."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:144
|
||||||
|
#: admin/manage-categories.php:147
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Quick Edit"
|
||||||
|
msgstr "Schnellbearbeitung"
|
||||||
|
|
||||||
|
#: actions/location-process.php:145
|
||||||
|
#: admin/manage-categories.php:148
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr "Löschen"
|
||||||
|
|
||||||
|
#: actions/location-process.php:185
|
||||||
|
#: admin/manage-db.php:234
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Fax:"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:34
|
||||||
|
msgid "added successfully."
|
||||||
|
msgstr "Erfolgreich hinzugefügt."
|
||||||
|
|
||||||
|
#: admin/add-location.php:50
|
||||||
|
msgid "Name and Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:58
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:319
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Name"
|
||||||
|
|
||||||
|
#: admin/add-location.php:59
|
||||||
|
msgid "Please enter a name."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:63
|
||||||
|
#: admin/manage-db.php:139
|
||||||
|
#: admin/manage-db.php:156
|
||||||
|
#: admin/manage-db.php:418
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:68
|
||||||
|
#: admin/manage-categories.php:115
|
||||||
|
#: admin/manage-categories.php:124
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:391
|
||||||
|
msgid "Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:82
|
||||||
|
#: admin/manage-db.php:403
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "You can add categories from the %s General Options screen.%s"
|
||||||
|
msgstr "Einen Key unter Allgemeine Optionen eineben."
|
||||||
|
|
||||||
|
#: admin/add-location.php:88
|
||||||
|
#: admin/manage-db.php:138
|
||||||
|
#: admin/manage-db.php:155
|
||||||
|
#: admin/manage-db.php:406
|
||||||
|
msgid "Tags"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:105
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geographic Location"
|
||||||
|
msgstr "Startpunkt"
|
||||||
|
|
||||||
|
#: admin/add-location.php:108
|
||||||
|
msgid "You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:114
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:332
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
#: admin/add-location.php:120
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "City/Town"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:125
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/manage-db.php:339
|
||||||
|
msgid "State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:130
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "Zip/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:135
|
||||||
|
#: admin/manage-db.php:371
|
||||||
|
msgid "Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:151
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude/Longitude"
|
||||||
|
msgstr "Längengrad:"
|
||||||
|
|
||||||
|
#: admin/add-location.php:179
|
||||||
|
msgid "Miscellaneous Information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:187
|
||||||
|
#: admin/manage-db.php:384
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr "Telefonnummer"
|
||||||
|
|
||||||
|
#: admin/add-location.php:192
|
||||||
|
#: admin/manage-db.php:386
|
||||||
|
msgid "Fax"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:197
|
||||||
|
#: admin/manage-db.php:388
|
||||||
|
msgid "URL"
|
||||||
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: admin/add-location.php:199
|
||||||
|
msgid "Please include <strong>http://</strong>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:60
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations %s is disabled because you have more than 100 locations in your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:178
|
||||||
|
msgid "Location Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:181
|
||||||
|
#, fuzzy
|
||||||
|
msgid "If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier."
|
||||||
|
msgstr "Wenn viele ihrer Orte überwiegend im selben Bundesland sind, wählen sie dieses Bundesland, um das Hinzufügen neuer Orte zu vereinfachen"
|
||||||
|
|
||||||
|
#: admin/general-options.php:187
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Google Maps Domain"
|
||||||
|
msgstr "Google Maps API Key"
|
||||||
|
|
||||||
|
#: admin/general-options.php:203
|
||||||
|
msgid "Default Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:219
|
||||||
|
msgid "Default State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:224
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Address Format"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
#: admin/general-options.php:241
|
||||||
|
#: admin/general-options.php:242
|
||||||
|
#: admin/general-options.php:243
|
||||||
|
#: admin/general-options.php:244
|
||||||
|
#: admin/general-options.php:245
|
||||||
|
#: admin/general-options.php:246
|
||||||
|
#: admin/general-options.php:247
|
||||||
|
msgid "Example"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:256
|
||||||
|
#: admin/general-options.php:392
|
||||||
|
#: admin/general-options.php:528
|
||||||
|
msgid "Save Options"
|
||||||
|
msgstr "Einstellungen speichern"
|
||||||
|
|
||||||
|
#: admin/general-options.php:269
|
||||||
|
msgid "Map Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, php-format
|
||||||
|
msgid "See %s the Help page%s for an explanation of these options."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:278
|
||||||
|
msgid "Google Maps API Key"
|
||||||
|
msgstr "Google Maps API Key"
|
||||||
|
|
||||||
|
#: admin/general-options.php:281
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%s Click here%s to sign up for a Google Maps API key for your domain."
|
||||||
|
msgstr "Um einen Google-Maps API Key für deine Domain zu erlangen"
|
||||||
|
|
||||||
|
#: admin/general-options.php:286
|
||||||
|
#: admin/help.php:73
|
||||||
|
msgid "Starting Location"
|
||||||
|
msgstr "Startpunkt"
|
||||||
|
|
||||||
|
#: admin/general-options.php:288
|
||||||
|
msgid "Latitude:"
|
||||||
|
msgstr "Breitengrad:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:290
|
||||||
|
msgid "Longitude:"
|
||||||
|
msgstr "Längengrad:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:298
|
||||||
|
msgid "Distance Units"
|
||||||
|
msgstr "Entfernung in"
|
||||||
|
|
||||||
|
#: admin/general-options.php:305
|
||||||
|
msgid "Miles"
|
||||||
|
msgstr "Meilen"
|
||||||
|
|
||||||
|
#: admin/general-options.php:306
|
||||||
|
msgid "Kilometers"
|
||||||
|
msgstr "Kilometern"
|
||||||
|
|
||||||
|
#: admin/general-options.php:312
|
||||||
|
msgid "Default Search Radius"
|
||||||
|
msgstr "Standard Suchradius"
|
||||||
|
|
||||||
|
#: admin/general-options.php:326
|
||||||
|
msgid "Number of Results to Display"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:336
|
||||||
|
msgid "Select \"No Limit\" to display all results within the search radius."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:341
|
||||||
|
#: admin/help.php:78
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-Load Database"
|
||||||
|
msgstr "Datenbank bearbeiten"
|
||||||
|
|
||||||
|
#: admin/general-options.php:344
|
||||||
|
msgid "No auto-load"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:345
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-load search results"
|
||||||
|
msgstr "Adresse automatisch laden"
|
||||||
|
|
||||||
|
#: admin/general-options.php:346
|
||||||
|
msgid "Auto-load all locations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:354
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Stick to default location set above"
|
||||||
|
msgstr "Standard Bundesland"
|
||||||
|
|
||||||
|
#: admin/general-options.php:359
|
||||||
|
msgid "Default Zoom Level"
|
||||||
|
msgstr "Standard Zoomstufe"
|
||||||
|
|
||||||
|
#: admin/general-options.php:368
|
||||||
|
msgid "1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in."
|
||||||
|
msgstr "wobei 1 am meisten ausgezoomt (die ganze Welt ist sichtbar) und 19 ist am meisten eingezoomt ist"
|
||||||
|
|
||||||
|
#: admin/general-options.php:373
|
||||||
|
#: admin/help.php:89
|
||||||
|
msgid "Special Location Label"
|
||||||
|
msgstr "Spezielle Ortsbeschreibung"
|
||||||
|
|
||||||
|
#: admin/general-options.php:380
|
||||||
|
msgid "Map Page IDs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:383
|
||||||
|
msgid "Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:415
|
||||||
|
msgid "Map Style Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:418
|
||||||
|
#, php-format
|
||||||
|
msgid "To insert SimpleMap into a post or page, type this shortcode in the body: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:424
|
||||||
|
msgid "Map Size"
|
||||||
|
msgstr "Kartengröße"
|
||||||
|
|
||||||
|
#: admin/general-options.php:426
|
||||||
|
msgid "Width:"
|
||||||
|
msgstr "Breite"
|
||||||
|
|
||||||
|
#: admin/general-options.php:428
|
||||||
|
msgid "Height:"
|
||||||
|
msgstr "Höhe"
|
||||||
|
|
||||||
|
#: admin/general-options.php:430
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Enter a numeric value with CSS units, such as %s or %s."
|
||||||
|
msgstr "Gebe einen numerischen Wert mit CSS Einheiten ein, wie"
|
||||||
|
|
||||||
|
#: admin/general-options.php:435
|
||||||
|
msgid "Default Map Type"
|
||||||
|
msgstr "Standard Kartentyp"
|
||||||
|
|
||||||
|
#: admin/general-options.php:439
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Road map"
|
||||||
|
msgstr "Normale Ansicht"
|
||||||
|
|
||||||
|
#: admin/general-options.php:446
|
||||||
|
msgid "Satellite map"
|
||||||
|
msgstr "Sattelitenansicht"
|
||||||
|
|
||||||
|
#: admin/general-options.php:453
|
||||||
|
msgid "Hybrid map"
|
||||||
|
msgstr "Hybridansicht"
|
||||||
|
|
||||||
|
#: admin/general-options.php:460
|
||||||
|
msgid "Terrain map"
|
||||||
|
msgstr "Geländeansicht"
|
||||||
|
|
||||||
|
#: admin/general-options.php:468
|
||||||
|
msgid "Theme"
|
||||||
|
msgstr "Theme"
|
||||||
|
|
||||||
|
#: admin/general-options.php:475
|
||||||
|
msgid "Default Themes"
|
||||||
|
msgstr "Standard Themes"
|
||||||
|
|
||||||
|
#: admin/general-options.php:483
|
||||||
|
msgid "Custom Themes"
|
||||||
|
msgstr "Benutzerdefinierte Themes"
|
||||||
|
|
||||||
|
#: admin/general-options.php:492
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
msgstr "Um ihr eigenes Theme zu benutzen, laden sie ihre CSS-Dateien in ein Verzeichnis namens"
|
||||||
|
|
||||||
|
#: admin/general-options.php:501
|
||||||
|
msgid "Display Search Form"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:508
|
||||||
|
msgid "Show the search form above the map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:513
|
||||||
|
msgid "SimpleMap Link"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: admin/general-options.php:520
|
||||||
|
msgid "Show the \"Powered by SimpleMap\" link"
|
||||||
|
msgstr "Zeigen des \"Powered by SimpleMap\" Links"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
msgid "Jump to a section:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:35
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Displaying Your Map"
|
||||||
|
msgstr "Anzeigen"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:108
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Adding a Location"
|
||||||
|
msgstr "Ort Hinzufügen"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:141
|
||||||
|
msgid "Everything Else"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:42
|
||||||
|
msgid "To show your map on any post or page, insert the shortcode in the body:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:44
|
||||||
|
msgid "If you want only certain categories to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:46
|
||||||
|
msgid "You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:48
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Configure the appearance of your map on the %s General Options page.%s"
|
||||||
|
msgstr "Einen Key unter Allgemeine Optionen eineben."
|
||||||
|
|
||||||
|
#: admin/help.php:74
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press \"Geocode Address.\""
|
||||||
|
msgstr "Geben sie einen Startpunkt für die Karte ein, der angewählt wird, wenn kein Ort gesucht wurde; z.B. wenn ihre Orte überwiegend in der selben Stadt sind und sie hier zentriert beginnen möchten."
|
||||||
|
|
||||||
|
#: admin/help.php:80
|
||||||
|
#, php-format
|
||||||
|
msgid "%s No auto-load:%s Locations will not load automatically."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:81
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:82
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:84
|
||||||
|
msgid "If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:90
|
||||||
|
msgid "This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for \"Favorite Spots,\" or \"Free Wi-Fi,\" or anything you want. You can also leave it blank to disable it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:116
|
||||||
|
msgid "To properly add a new location, you must enter one or both of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:117
|
||||||
|
#, fuzzy
|
||||||
|
msgid "1. A full address"
|
||||||
|
msgstr "Adresse automatisch laden"
|
||||||
|
|
||||||
|
#: admin/help.php:118
|
||||||
|
#, fuzzy
|
||||||
|
msgid "2. A latitude and longitude"
|
||||||
|
msgstr "Um einen Längen- und Breitengrad ihrer Adresse zu finden."
|
||||||
|
|
||||||
|
#: admin/help.php:119
|
||||||
|
msgid "If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:123
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You must also enter a name for every location."
|
||||||
|
msgstr "Du musst einen API-Key für deine Domain eingeben."
|
||||||
|
|
||||||
|
#: admin/help.php:149
|
||||||
|
#, php-format
|
||||||
|
msgid "If you have any other questions or comments, please visit the %s SimpleMap Support Forums%s. Search the forums for your problem before you post; the same issue may have been solved already by someone else."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:18
|
||||||
|
msgid "SimpleMap: Import/Export CSV"
|
||||||
|
msgstr "SimpleMap: Import/Export CSV"
|
||||||
|
|
||||||
|
#: admin/import-export.php:32
|
||||||
|
msgid "Import From File"
|
||||||
|
msgstr "Aus Datei importieren"
|
||||||
|
|
||||||
|
#: admin/import-export.php:36
|
||||||
|
msgid "If your file has fewer than 100 records and does not have latitude/longitude data:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:38
|
||||||
|
msgid "Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:40
|
||||||
|
msgid "Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Description, Special (1 or 0), Latitude, Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:42
|
||||||
|
msgid "You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( ' ) or double ( \" ) quotation marks will work."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:44
|
||||||
|
msgid "If your file has more than 100 records:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:46
|
||||||
|
msgid "If you have more than 100 records to import, it is best to do one of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:49
|
||||||
|
msgid "Geocode your own data before importing it"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:50
|
||||||
|
msgid "Split your file into multiple files with no more than 100 lines each"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:53
|
||||||
|
#, php-format
|
||||||
|
msgid "Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:55
|
||||||
|
msgid "If you are importing a file you exported from SimpleMap (and haven't changed since), be sure to check the box below since the locations are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:61
|
||||||
|
#, fuzzy
|
||||||
|
msgid "File to import (maximum size 2MB):"
|
||||||
|
msgstr "Datei zum Import:"
|
||||||
|
|
||||||
|
#: admin/import-export.php:63
|
||||||
|
msgid "Check this box if the locations in the file are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:65
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Import CSV File"
|
||||||
|
msgstr "Aus Datei importieren"
|
||||||
|
|
||||||
|
#: admin/import-export.php:69
|
||||||
|
msgid "Importing a file may take several seconds; please be patient."
|
||||||
|
msgstr "Eine Datei zu importieren kann einige Sekunden dauern; bitte bleiben sie geduldig."
|
||||||
|
|
||||||
|
#: admin/import-export.php:81
|
||||||
|
msgid "Export To File"
|
||||||
|
msgstr "Aus Datei exportieren"
|
||||||
|
|
||||||
|
#: admin/import-export.php:88
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Export Database to CSV File"
|
||||||
|
msgstr "Datenbank exportieren"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete All Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete all categories in database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:85
|
||||||
|
#: admin/manage-categories.php:171
|
||||||
|
#, php-format
|
||||||
|
msgid "Displaying %d–%d of %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:114
|
||||||
|
#: admin/manage-categories.php:123
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:162
|
||||||
|
#: admin/manage-db.php:263
|
||||||
|
#: admin/manage-db.php:265
|
||||||
|
msgid "No records found."
|
||||||
|
msgstr "Keine Einträge gefunden."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:211
|
||||||
|
msgid "Category Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:217
|
||||||
|
#: admin/manage-db.php:423
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Abbrechen"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:218
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Update Category"
|
||||||
|
msgstr "Ort neu laden"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:235
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You are about to delete the selected categories. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Sind sind dabei die ausgewählten Einträge zu löschen. \"Abbrechen\" um zu beenden, \"OK\" um zu löschen.\""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:249
|
||||||
|
msgid "Add Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Do you really want to delete all locations in your database?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete all entries in database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:105
|
||||||
|
#: admin/manage-db.php:274
|
||||||
|
msgid "Displaying"
|
||||||
|
msgstr "Anzeigen"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Phone/Fax/URL"
|
||||||
|
msgstr "Telefonnummer/Fax"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Edit this post inline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
#, php-format
|
||||||
|
msgid "Do you really want to delete %s ?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:323
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude"
|
||||||
|
msgstr "Breitengrad:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:326
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Longitude"
|
||||||
|
msgstr "Längengrad:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:336
|
||||||
|
msgid "City"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:368
|
||||||
|
msgid "ZIP/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:379
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geocode Address"
|
||||||
|
msgstr "Adresse"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Update Location"
|
||||||
|
msgstr "Ort neu laden"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Geocode the new address to update this location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:441
|
||||||
|
msgid "You are about to delete the selected posts. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Sind sind dabei die ausgewählten Einträge zu löschen. \"Abbrechen\" um zu beenden, \"OK\" um zu löschen.\""
|
||||||
|
|
||||||
|
#: includes/display-map.php:27
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:28
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Please enter an address or search term in the box above."
|
||||||
|
msgstr "Bitte geben sie einen Namen, Adresse, Stadt oder Postleitzahl in das Suchfeld ein"
|
||||||
|
|
||||||
|
#: includes/display-map.php:33
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Powered by %s SimpleMap"
|
||||||
|
msgstr "Zeigen des \"Powered by SimpleMap\" Links"
|
||||||
|
|
||||||
|
#: includes/scripts.php:22
|
||||||
|
msgid "Visit Website"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:23
|
||||||
|
msgid "Get Directions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:24
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Location"
|
||||||
|
msgstr "Ort Hinzufügen"
|
||||||
|
|
||||||
|
#: includes/scripts.php:29
|
||||||
|
#, fuzzy
|
||||||
|
msgid "No results found."
|
||||||
|
msgstr "Keine Einträge gefunden."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "Go to the SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Home Page"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Go to the SimpleMap Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "You must enter an API key for your domain."
|
||||||
|
msgstr "Du musst einen API-Key für deine Domain eingeben."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "Enter a key on the General Options page."
|
||||||
|
msgstr "Einen Key unter Allgemeine Optionen eineben."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:27
|
||||||
|
msgid "You must update your database to enable the new category functionality."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:28
|
||||||
|
msgid "To update the database:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:30
|
||||||
|
msgid "Click here FIRST to download a backup of your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:32
|
||||||
|
msgid "Then click here to update your categories."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Click here to sign up for a Google Maps API key."
|
||||||
|
#~ msgstr "Hier klicken, um einen Google Maps API Key zu erlangen."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid "Importing Your CSV File"
|
||||||
|
#~ msgstr "Aus Datei importieren"
|
||||||
|
#~ msgid "City, State, Zip"
|
||||||
|
#~ msgstr "Stadt, Bundesland, Postleitzahl"
|
||||||
|
#~ msgid "Please include the"
|
||||||
|
#~ msgstr "Bitte füge den"
|
||||||
|
#~ msgid "Click here"
|
||||||
|
#~ msgstr "Hier klicken"
|
||||||
|
#~ msgid "or"
|
||||||
|
#~ msgstr "oder"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "If you want to distinguish certain locations (i.e. Ten-Year Members, Most "
|
||||||
|
#~ "Popular, etc.) then enter the label for them here. Leave it blank to "
|
||||||
|
#~ "disable this feature."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Wenn sie einen Ort besser schildern möchten (z.B. Treffpunkte, Vereine "
|
||||||
|
#~ "etc.), geben sie ihm hier eine Beschreibung. Freilassen, um diese "
|
||||||
|
#~ "Funktion nicht zu nutzen."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Enter an address, city, or zip code here if you want the map to "
|
||||||
|
#~ "automatically show all locations in that area."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Geben sie eine Adresse, Stadt oder Postleitzahl hier ein, um die Karte "
|
||||||
|
#~ "automatisch alle Punkte in der Gegend anzeigen zu lassen."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Um ihm einen Namen zu geben, benutzen sie einen der folgenden Header zu "
|
||||||
|
#~ "Beginn ihres Stylesheets:"
|
||||||
|
#~ msgid "Import"
|
||||||
|
#~ msgstr "Import"
|
||||||
|
#~ msgid "Powered by"
|
||||||
|
#~ msgstr "Powered by"
|
||||||
|
|
BIN
lang/SimpleMap-en_US.mo
Normal file
BIN
lang/SimpleMap-es_ES.mo
Normal file
927
lang/SimpleMap-es_ES.po
Normal file
|
@ -0,0 +1,927 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: SimpleMap\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2009-11-02 20:05-0600\n"
|
||||||
|
"PO-Revision-Date: \n"
|
||||||
|
"Last-Translator: Alison Barrett <alison@alisothegeek.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: English\n"
|
||||||
|
"X-Poedit-SourceCharset: utf-8\n"
|
||||||
|
"X-Poedit-KeywordsList: __;_e\n"
|
||||||
|
"X-Poedit-Basepath: ../\n"
|
||||||
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
"X-Poedit-SearchPath-1: admin\n"
|
||||||
|
"X-Poedit-SearchPath-2: includes\n"
|
||||||
|
|
||||||
|
#: simplemap.php:13
|
||||||
|
msgid "SimpleMap requires WordPress 2.8 or newer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Please update!</a>"
|
||||||
|
msgstr "SimpleMap requiere WordPress 2.8 o superior. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">¡Por favor, actualiza tu WP!</a>"
|
||||||
|
|
||||||
|
#: simplemap.php:114
|
||||||
|
msgid "SimpleMap Options"
|
||||||
|
msgstr "Opciones de SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/general-options.php:160
|
||||||
|
msgid "SimpleMap: General Options"
|
||||||
|
msgstr "SimpleMap: Opciones generales"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:65
|
||||||
|
msgid "General Options"
|
||||||
|
msgstr "Opciones generales"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:27
|
||||||
|
msgid "SimpleMap: Add Location"
|
||||||
|
msgstr "SimpleMap: Añadir localización"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:217
|
||||||
|
#: admin/add-location.php:218
|
||||||
|
msgid "Add Location"
|
||||||
|
msgstr "Añadir localización"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:45
|
||||||
|
msgid "SimpleMap: Manage Database"
|
||||||
|
msgstr "SimpleMap: Gestionar la base de datos"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:77
|
||||||
|
#: admin/manage-db.php:83
|
||||||
|
#: admin/manage-db.php:89
|
||||||
|
#: admin/manage-db.php:90
|
||||||
|
#: admin/manage-db.php:108
|
||||||
|
#: admin/manage-db.php:117
|
||||||
|
#: admin/manage-db.php:123
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:277
|
||||||
|
#: admin/manage-db.php:286
|
||||||
|
#: admin/manage-db.php:292
|
||||||
|
msgid "Manage Database"
|
||||||
|
msgstr "Gestionar la base de datos"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:25
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Manage Categories"
|
||||||
|
msgstr "SimpleMap: Gestionar la base de datos"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:88
|
||||||
|
#: admin/manage-categories.php:97
|
||||||
|
#: admin/manage-categories.php:103
|
||||||
|
#: admin/manage-categories.php:174
|
||||||
|
#: admin/manage-categories.php:183
|
||||||
|
#: admin/manage-categories.php:189
|
||||||
|
msgid "Manage Categories"
|
||||||
|
msgstr "Administrar categorías"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "SimpleMap: Import/Export"
|
||||||
|
msgstr "SimpleMap: Importar/exportar"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "Import/Export"
|
||||||
|
msgstr "Importar/exportar"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/help.php:18
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Help"
|
||||||
|
msgstr "Enlace a SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
msgid "Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Help"
|
||||||
|
msgstr "Enlace a SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:170
|
||||||
|
msgid "SimpleMap settings saved."
|
||||||
|
msgstr "Configuración de SimpleMap guardada."
|
||||||
|
|
||||||
|
#: simplemap.php:274
|
||||||
|
msgid "Class SimpleMap already declared!"
|
||||||
|
msgstr "Class SimpleMap ha sido declarada ya!"
|
||||||
|
|
||||||
|
#: simplemap.php:303
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr "Configuración"
|
||||||
|
|
||||||
|
#: actions/category-update.php:15
|
||||||
|
msgid "Your database has been successfully updated."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:200
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" failed to geocode, with status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:222
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" was not successfully inserted into the database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:233
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%d records imported successfully."
|
||||||
|
msgstr "añadido correctamente."
|
||||||
|
|
||||||
|
#: actions/location-process.php:17
|
||||||
|
msgid "Record deleted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:26
|
||||||
|
msgid "Database cleared."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:144
|
||||||
|
#: admin/manage-categories.php:147
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Quick Edit"
|
||||||
|
msgstr "Edición Rápida"
|
||||||
|
|
||||||
|
#: actions/location-process.php:145
|
||||||
|
#: admin/manage-categories.php:148
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr "Borrar"
|
||||||
|
|
||||||
|
#: actions/location-process.php:185
|
||||||
|
#: admin/manage-db.php:234
|
||||||
|
msgid "Fax:"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:34
|
||||||
|
msgid "added successfully."
|
||||||
|
msgstr "añadido correctamente."
|
||||||
|
|
||||||
|
#: admin/add-location.php:50
|
||||||
|
msgid "Name and Description"
|
||||||
|
msgstr "Nombre y descripción"
|
||||||
|
|
||||||
|
#: admin/add-location.php:58
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:319
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Nombre"
|
||||||
|
|
||||||
|
#: admin/add-location.php:59
|
||||||
|
msgid "Please enter a name."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:63
|
||||||
|
#: admin/manage-db.php:139
|
||||||
|
#: admin/manage-db.php:156
|
||||||
|
#: admin/manage-db.php:418
|
||||||
|
msgid "Description"
|
||||||
|
msgstr "Descripción"
|
||||||
|
|
||||||
|
#: admin/add-location.php:68
|
||||||
|
#: admin/manage-categories.php:115
|
||||||
|
#: admin/manage-categories.php:124
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:391
|
||||||
|
msgid "Category"
|
||||||
|
msgstr "Categoría"
|
||||||
|
|
||||||
|
#: admin/add-location.php:82
|
||||||
|
#: admin/manage-db.php:403
|
||||||
|
#, php-format
|
||||||
|
msgid "You can add categories from the %s General Options screen.%s"
|
||||||
|
msgstr "Puedes añadir categorías desde la seccion de %s Opciones Generales%s"
|
||||||
|
|
||||||
|
#: admin/add-location.php:88
|
||||||
|
#: admin/manage-db.php:138
|
||||||
|
#: admin/manage-db.php:155
|
||||||
|
#: admin/manage-db.php:406
|
||||||
|
msgid "Tags"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:105
|
||||||
|
msgid "Geographic Location"
|
||||||
|
msgstr "Localización geográfica"
|
||||||
|
|
||||||
|
#: admin/add-location.php:108
|
||||||
|
msgid "You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:114
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:332
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Dirección"
|
||||||
|
|
||||||
|
#: admin/add-location.php:120
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "City/Town"
|
||||||
|
msgstr "Ciudad"
|
||||||
|
|
||||||
|
#: admin/add-location.php:125
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/manage-db.php:339
|
||||||
|
msgid "State/Province"
|
||||||
|
msgstr "Estado/provincia"
|
||||||
|
|
||||||
|
#: admin/add-location.php:130
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "Zip/Postal Code"
|
||||||
|
msgstr "Codigo Postal"
|
||||||
|
|
||||||
|
#: admin/add-location.php:135
|
||||||
|
#: admin/manage-db.php:371
|
||||||
|
msgid "Country"
|
||||||
|
msgstr "Pais"
|
||||||
|
|
||||||
|
#: admin/add-location.php:151
|
||||||
|
msgid "Latitude/Longitude"
|
||||||
|
msgstr "Latitud/longitud"
|
||||||
|
|
||||||
|
#: admin/add-location.php:179
|
||||||
|
msgid "Miscellaneous Information"
|
||||||
|
msgstr "Información adicional"
|
||||||
|
|
||||||
|
#: admin/add-location.php:187
|
||||||
|
#: admin/manage-db.php:384
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr "Teléfono"
|
||||||
|
|
||||||
|
#: admin/add-location.php:192
|
||||||
|
#: admin/manage-db.php:386
|
||||||
|
msgid "Fax"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:197
|
||||||
|
#: admin/manage-db.php:388
|
||||||
|
msgid "URL"
|
||||||
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: admin/add-location.php:199
|
||||||
|
msgid "Please include <strong>http://</strong>"
|
||||||
|
msgstr "Por favor, incluya <strong>http://</strong>"
|
||||||
|
|
||||||
|
#: admin/general-options.php:60
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations %s is disabled because you have more than 100 locations in your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:178
|
||||||
|
msgid "Location Defaults"
|
||||||
|
msgstr "Localizacion por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:181
|
||||||
|
#, fuzzy
|
||||||
|
msgid "If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier."
|
||||||
|
msgstr "Si la mayoría de las localizaciones son del mismo estado, por favor, elígelo aquí para hacer los añadidos de forma mas sencilla."
|
||||||
|
|
||||||
|
#: admin/general-options.php:187
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Google Maps Domain"
|
||||||
|
msgstr "Google Maps API Key"
|
||||||
|
|
||||||
|
#: admin/general-options.php:203
|
||||||
|
msgid "Default Country"
|
||||||
|
msgstr "Pais por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:219
|
||||||
|
msgid "Default State/Province"
|
||||||
|
msgstr "Default State/Province"
|
||||||
|
|
||||||
|
#: admin/general-options.php:224
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Address Format"
|
||||||
|
msgstr "Dirección"
|
||||||
|
|
||||||
|
#: admin/general-options.php:241
|
||||||
|
#: admin/general-options.php:242
|
||||||
|
#: admin/general-options.php:243
|
||||||
|
#: admin/general-options.php:244
|
||||||
|
#: admin/general-options.php:245
|
||||||
|
#: admin/general-options.php:246
|
||||||
|
#: admin/general-options.php:247
|
||||||
|
msgid "Example"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:256
|
||||||
|
#: admin/general-options.php:392
|
||||||
|
#: admin/general-options.php:528
|
||||||
|
msgid "Save Options"
|
||||||
|
msgstr "Opciones de almacenamiento"
|
||||||
|
|
||||||
|
#: admin/general-options.php:269
|
||||||
|
msgid "Map Configuration"
|
||||||
|
msgstr "Configuracion del mapa"
|
||||||
|
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, php-format
|
||||||
|
msgid "See %s the Help page%s for an explanation of these options."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:278
|
||||||
|
msgid "Google Maps API Key"
|
||||||
|
msgstr "Google Maps API Key"
|
||||||
|
|
||||||
|
#: admin/general-options.php:281
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%s Click here%s to sign up for a Google Maps API key for your domain."
|
||||||
|
msgstr "para conseguir una clave para tu dominio de la API de Google Maps."
|
||||||
|
|
||||||
|
#: admin/general-options.php:286
|
||||||
|
#: admin/help.php:73
|
||||||
|
msgid "Starting Location"
|
||||||
|
msgstr "Localización principal"
|
||||||
|
|
||||||
|
#: admin/general-options.php:288
|
||||||
|
msgid "Latitude:"
|
||||||
|
msgstr "Latitud:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:290
|
||||||
|
msgid "Longitude:"
|
||||||
|
msgstr "Longitud:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:298
|
||||||
|
msgid "Distance Units"
|
||||||
|
msgstr "Unidad de distancia"
|
||||||
|
|
||||||
|
#: admin/general-options.php:305
|
||||||
|
msgid "Miles"
|
||||||
|
msgstr "Millas"
|
||||||
|
|
||||||
|
#: admin/general-options.php:306
|
||||||
|
msgid "Kilometers"
|
||||||
|
msgstr "Kilómetros"
|
||||||
|
|
||||||
|
#: admin/general-options.php:312
|
||||||
|
msgid "Default Search Radius"
|
||||||
|
msgstr "Radio de búsqueda por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:326
|
||||||
|
msgid "Number of Results to Display"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:336
|
||||||
|
msgid "Select \"No Limit\" to display all results within the search radius."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:341
|
||||||
|
#: admin/help.php:78
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-Load Database"
|
||||||
|
msgstr "Gestionar la base de datos"
|
||||||
|
|
||||||
|
#: admin/general-options.php:344
|
||||||
|
msgid "No auto-load"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:345
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-load search results"
|
||||||
|
msgstr "Carga automática de direcciones"
|
||||||
|
|
||||||
|
#: admin/general-options.php:346
|
||||||
|
msgid "Auto-load all locations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:354
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Stick to default location set above"
|
||||||
|
msgstr "Estado por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:359
|
||||||
|
msgid "Default Zoom Level"
|
||||||
|
msgstr "Nivel de zoom por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:368
|
||||||
|
msgid "1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in."
|
||||||
|
msgstr "1 es el mínimo zoom (donde toda la tierra es visible) y 19 es el máximo."
|
||||||
|
|
||||||
|
#: admin/general-options.php:373
|
||||||
|
#: admin/help.php:89
|
||||||
|
msgid "Special Location Label"
|
||||||
|
msgstr "Etiqueta de localización especial"
|
||||||
|
|
||||||
|
#: admin/general-options.php:380
|
||||||
|
msgid "Map Page IDs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:383
|
||||||
|
msgid "Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:415
|
||||||
|
msgid "Map Style Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:418
|
||||||
|
#, php-format
|
||||||
|
msgid "To insert SimpleMap into a post or page, type this shortcode in the body: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:424
|
||||||
|
msgid "Map Size"
|
||||||
|
msgstr "Tamaño del Mapa"
|
||||||
|
|
||||||
|
#: admin/general-options.php:426
|
||||||
|
msgid "Width:"
|
||||||
|
msgstr "Ancho:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:428
|
||||||
|
msgid "Height:"
|
||||||
|
msgstr "Alto:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:430
|
||||||
|
#, php-format
|
||||||
|
msgid "Enter a numeric value with CSS units, such as %s or %s."
|
||||||
|
msgstr "Introduzca un valor numerico con unidades CSS, como %s o %s"
|
||||||
|
|
||||||
|
#: admin/general-options.php:435
|
||||||
|
msgid "Default Map Type"
|
||||||
|
msgstr "Mapa por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:439
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Road map"
|
||||||
|
msgstr "Mapa normal"
|
||||||
|
|
||||||
|
#: admin/general-options.php:446
|
||||||
|
msgid "Satellite map"
|
||||||
|
msgstr "Mapa por satélite"
|
||||||
|
|
||||||
|
#: admin/general-options.php:453
|
||||||
|
msgid "Hybrid map"
|
||||||
|
msgstr "Mapa híbrido"
|
||||||
|
|
||||||
|
#: admin/general-options.php:460
|
||||||
|
msgid "Terrain map"
|
||||||
|
msgstr "Mapa relieve"
|
||||||
|
|
||||||
|
#: admin/general-options.php:468
|
||||||
|
msgid "Theme"
|
||||||
|
msgstr "Plantilla"
|
||||||
|
|
||||||
|
#: admin/general-options.php:475
|
||||||
|
msgid "Default Themes"
|
||||||
|
msgstr "Plantilla por defecto"
|
||||||
|
|
||||||
|
#: admin/general-options.php:483
|
||||||
|
msgid "Custom Themes"
|
||||||
|
msgstr "Plantillas propias"
|
||||||
|
|
||||||
|
#: admin/general-options.php:492
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
msgstr "Para añadir tu propio estilo, sube la hoja de estilos CSS a un nuevo directorio en la sección de plugins llamado"
|
||||||
|
|
||||||
|
#: admin/general-options.php:501
|
||||||
|
msgid "Display Search Form"
|
||||||
|
msgstr "Mostrar el cajetín de búsqueda"
|
||||||
|
|
||||||
|
#: admin/general-options.php:508
|
||||||
|
msgid "Show the search form above the map"
|
||||||
|
msgstr "Mostrar el cajetín sobre el mapa"
|
||||||
|
|
||||||
|
#: admin/general-options.php:513
|
||||||
|
msgid "SimpleMap Link"
|
||||||
|
msgstr "Enlace a SimpleMap"
|
||||||
|
|
||||||
|
#: admin/general-options.php:520
|
||||||
|
msgid "Show the \"Powered by SimpleMap\" link"
|
||||||
|
msgstr "Mostrar el enlace \"Creado por SimpleMap\""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
msgid "Jump to a section:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:35
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Displaying Your Map"
|
||||||
|
msgstr "Mostrando"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:108
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Adding a Location"
|
||||||
|
msgstr "Añadir localización"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:141
|
||||||
|
msgid "Everything Else"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:42
|
||||||
|
msgid "To show your map on any post or page, insert the shortcode in the body:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:44
|
||||||
|
msgid "If you want only certain categories to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:46
|
||||||
|
msgid "You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:48
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Configure the appearance of your map on the %s General Options page.%s"
|
||||||
|
msgstr "Introduzca la clave en la página de Opciones generales."
|
||||||
|
|
||||||
|
#: admin/help.php:74
|
||||||
|
msgid "Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press \"Geocode Address.\""
|
||||||
|
msgstr "Introduzca la localización del mapa que se abrirá por defecto, cuando no se hayan buscado ninguna localización. Si no conoce la latitud y longitud de su localización por defecto, introduzca la dirección en el cajetín inferior y presione \"Geocode Adress\""
|
||||||
|
|
||||||
|
#: admin/help.php:80
|
||||||
|
#, php-format
|
||||||
|
msgid "%s No auto-load:%s Locations will not load automatically."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:81
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:82
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:84
|
||||||
|
msgid "If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:90
|
||||||
|
msgid "This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for \"Favorite Spots,\" or \"Free Wi-Fi,\" or anything you want. You can also leave it blank to disable it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:116
|
||||||
|
msgid "To properly add a new location, you must enter one or both of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:117
|
||||||
|
#, fuzzy
|
||||||
|
msgid "1. A full address"
|
||||||
|
msgstr "Carga automática de direcciones"
|
||||||
|
|
||||||
|
#: admin/help.php:118
|
||||||
|
#, fuzzy
|
||||||
|
msgid "2. A latitude and longitude"
|
||||||
|
msgstr "para encontrar la latitud y longitud de una dirección."
|
||||||
|
|
||||||
|
#: admin/help.php:119
|
||||||
|
msgid "If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:123
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You must also enter a name for every location."
|
||||||
|
msgstr "Debes introducir una clave API para tu dominio."
|
||||||
|
|
||||||
|
#: admin/help.php:149
|
||||||
|
#, php-format
|
||||||
|
msgid "If you have any other questions or comments, please visit the %s SimpleMap Support Forums%s. Search the forums for your problem before you post; the same issue may have been solved already by someone else."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:18
|
||||||
|
msgid "SimpleMap: Import/Export CSV"
|
||||||
|
msgstr "SimpleMap: Importar / exportar a un CSV"
|
||||||
|
|
||||||
|
#: admin/import-export.php:32
|
||||||
|
msgid "Import From File"
|
||||||
|
msgstr "Importar desde un archivo"
|
||||||
|
|
||||||
|
#: admin/import-export.php:36
|
||||||
|
msgid "If your file has fewer than 100 records and does not have latitude/longitude data:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:38
|
||||||
|
msgid "Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:40
|
||||||
|
msgid "Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Description, Special (1 or 0), Latitude, Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:42
|
||||||
|
msgid "You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( ' ) or double ( \" ) quotation marks will work."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:44
|
||||||
|
msgid "If your file has more than 100 records:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:46
|
||||||
|
msgid "If you have more than 100 records to import, it is best to do one of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:49
|
||||||
|
msgid "Geocode your own data before importing it"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:50
|
||||||
|
msgid "Split your file into multiple files with no more than 100 lines each"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:53
|
||||||
|
#, php-format
|
||||||
|
msgid "Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:55
|
||||||
|
msgid "If you are importing a file you exported from SimpleMap (and haven't changed since), be sure to check the box below since the locations are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:61
|
||||||
|
#, fuzzy
|
||||||
|
msgid "File to import (maximum size 2MB):"
|
||||||
|
msgstr "Archivo a importar:"
|
||||||
|
|
||||||
|
#: admin/import-export.php:63
|
||||||
|
msgid "Check this box if the locations in the file are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:65
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Import CSV File"
|
||||||
|
msgstr "Importar desde un archivo"
|
||||||
|
|
||||||
|
#: admin/import-export.php:69
|
||||||
|
msgid "Importing a file may take several seconds; please be patient."
|
||||||
|
msgstr "Importar un archivo puede durar varios segundos, por favor, sea paciente."
|
||||||
|
|
||||||
|
#: admin/import-export.php:81
|
||||||
|
msgid "Export To File"
|
||||||
|
msgstr "Exportar a un fichero"
|
||||||
|
|
||||||
|
#: admin/import-export.php:88
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Export Database to CSV File"
|
||||||
|
msgstr "Exportar la base de datos"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete All Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete all categories in database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:85
|
||||||
|
#: admin/manage-categories.php:171
|
||||||
|
#, php-format
|
||||||
|
msgid "Displaying %d–%d of %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:114
|
||||||
|
#: admin/manage-categories.php:123
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:162
|
||||||
|
#: admin/manage-db.php:263
|
||||||
|
#: admin/manage-db.php:265
|
||||||
|
msgid "No records found."
|
||||||
|
msgstr "No se han encontrado direcciones"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:211
|
||||||
|
msgid "Category Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:217
|
||||||
|
#: admin/manage-db.php:423
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancelar"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:218
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Update Category"
|
||||||
|
msgstr "Actualice la localización"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:235
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You are about to delete the selected categories. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Va a borrar los post seleccionados \"Cancelar\" para no borrarlos u \"OK\" para borrarlos."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:249
|
||||||
|
msgid "Add Category"
|
||||||
|
msgstr "Añadir categoría"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Do you really want to delete all locations in your database?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete all entries in database"
|
||||||
|
msgstr "Borre todas las entradas de la base de datos"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:105
|
||||||
|
#: admin/manage-db.php:274
|
||||||
|
msgid "Displaying"
|
||||||
|
msgstr "Mostrando"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
msgid "Phone/Fax/URL"
|
||||||
|
msgstr "Teléfono/Fax/URL"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Edit this post inline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
#, php-format
|
||||||
|
msgid "Do you really want to delete %s ?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:323
|
||||||
|
msgid "Latitude"
|
||||||
|
msgstr "Latitud"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:326
|
||||||
|
msgid "Longitude"
|
||||||
|
msgstr "Longitud"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:336
|
||||||
|
msgid "City"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:368
|
||||||
|
msgid "ZIP/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:379
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geocode Address"
|
||||||
|
msgstr "Dirección"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Update Location"
|
||||||
|
msgstr "Actualice la localización"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Geocode the new address to update this location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:441
|
||||||
|
msgid "You are about to delete the selected posts. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Va a borrar los post seleccionados \"Cancelar\" para no borrarlos u \"OK\" para borrarlos."
|
||||||
|
|
||||||
|
#: includes/display-map.php:27
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:28
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Please enter an address or search term in the box above."
|
||||||
|
msgstr "Por favor, introduzca el nombre, dirección, ciudad o el código postal en el cajetín de búsqueda"
|
||||||
|
|
||||||
|
#: includes/display-map.php:33
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Powered by %s SimpleMap"
|
||||||
|
msgstr "Mostrar el enlace \"Creado por SimpleMap\""
|
||||||
|
|
||||||
|
#: includes/scripts.php:22
|
||||||
|
msgid "Visit Website"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:23
|
||||||
|
msgid "Get Directions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:24
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Location"
|
||||||
|
msgstr "Añadir localización"
|
||||||
|
|
||||||
|
#: includes/scripts.php:29
|
||||||
|
#, fuzzy
|
||||||
|
msgid "No results found."
|
||||||
|
msgstr "No se han encontrado direcciones"
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "Go to the SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Home Page"
|
||||||
|
msgstr "Enlace a SimpleMap"
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Go to the SimpleMap Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "You must enter an API key for your domain."
|
||||||
|
msgstr "Debes introducir una clave API para tu dominio."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "Enter a key on the General Options page."
|
||||||
|
msgstr "Introduzca la clave en la página de Opciones generales."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:27
|
||||||
|
msgid "You must update your database to enable the new category functionality."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:28
|
||||||
|
msgid "To update the database:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:30
|
||||||
|
msgid "Click here FIRST to download a backup of your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:32
|
||||||
|
msgid "Then click here to update your categories."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Click here to sign up for a Google Maps API key."
|
||||||
|
#~ msgstr "Clica aquí para conseguir una clave para la API de Google Maps"
|
||||||
|
#~ msgid "Preparing Your CSV File"
|
||||||
|
#~ msgstr "Prepare su fichero CSV"
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid "Importing Your CSV File"
|
||||||
|
#~ msgstr "Importar desde un archivo"
|
||||||
|
#~ msgid "City, State, Zip"
|
||||||
|
#~ msgstr "Ciudad, estado, código postal"
|
||||||
|
#~ msgid "Please include the"
|
||||||
|
#~ msgstr "Por favor incluye"
|
||||||
|
#~ msgid "Click here"
|
||||||
|
#~ msgstr "Clica aquí"
|
||||||
|
#~ msgid "or"
|
||||||
|
#~ msgstr "0"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "If you want to distinguish certain locations (i.e. Ten-Year Members, Most "
|
||||||
|
#~ "Popular, etc.) then enter the label for them here. Leave it blank to "
|
||||||
|
#~ "disable this feature."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Si quieres hacer distinción entre diferentes direcciones (por ejemplo: "
|
||||||
|
#~ "Miembros, mas populares, etc.) introduce una etiqueta aquí. Déjalo en "
|
||||||
|
#~ "blanco si quieres deshabilitar esta función."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Enter an address, city, or zip code here if you want the map to "
|
||||||
|
#~ "automatically show all locations in that area."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Introduzca una direccion, ciudad, o código postal aquí si quiere que, "
|
||||||
|
#~ "automáticamente, el mapa muestre todas las ubicaciones en el área."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Para nombrarlo, use el siguiente encabezado en la cabecera de tu hoja de "
|
||||||
|
#~ "estilos:"
|
||||||
|
#~ msgid "Import"
|
||||||
|
#~ msgstr "Importar"
|
||||||
|
#~ msgid "Powered by"
|
||||||
|
#~ msgstr "Creado por"
|
||||||
|
|
BIN
lang/SimpleMap-nl_NL.mo
Normal file
947
lang/SimpleMap-nl_NL.po
Normal file
|
@ -0,0 +1,947 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: SimpleMap\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2009-11-02 20:05-0600\n"
|
||||||
|
"PO-Revision-Date: \n"
|
||||||
|
"Last-Translator: Alison Barrett <alison@alisothegeek.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: English\n"
|
||||||
|
"X-Poedit-SourceCharset: utf-8\n"
|
||||||
|
"X-Poedit-KeywordsList: __;_e\n"
|
||||||
|
"X-Poedit-Basepath: ../\n"
|
||||||
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
"X-Poedit-SearchPath-1: admin\n"
|
||||||
|
"X-Poedit-SearchPath-2: includes\n"
|
||||||
|
|
||||||
|
#: simplemap.php:13
|
||||||
|
msgid "SimpleMap requires WordPress 2.8 or newer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Please update!</a>"
|
||||||
|
msgstr "SimpleMap vereist WordPress 2.8 of nieuwer.<a href=\"http://codex.wordpress.org/Upgrading_WordPress\">AUB update!</a>"
|
||||||
|
|
||||||
|
#: simplemap.php:114
|
||||||
|
msgid "SimpleMap Options"
|
||||||
|
msgstr "SimpleMap Opties"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/general-options.php:160
|
||||||
|
msgid "SimpleMap: General Options"
|
||||||
|
msgstr "SimpleMap: Algemene opties"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:65
|
||||||
|
msgid "General Options"
|
||||||
|
msgstr "Algemene opties"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:27
|
||||||
|
msgid "SimpleMap: Add Location"
|
||||||
|
msgstr "SimpleMap: Voeg Locatie Toe"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:217
|
||||||
|
#: admin/add-location.php:218
|
||||||
|
msgid "Add Location"
|
||||||
|
msgstr "Voeg Locatie Toe"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:45
|
||||||
|
msgid "SimpleMap: Manage Database"
|
||||||
|
msgstr "SimpleMap: Beheer Database"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:77
|
||||||
|
#: admin/manage-db.php:83
|
||||||
|
#: admin/manage-db.php:89
|
||||||
|
#: admin/manage-db.php:90
|
||||||
|
#: admin/manage-db.php:108
|
||||||
|
#: admin/manage-db.php:117
|
||||||
|
#: admin/manage-db.php:123
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:277
|
||||||
|
#: admin/manage-db.php:286
|
||||||
|
#: admin/manage-db.php:292
|
||||||
|
msgid "Manage Database"
|
||||||
|
msgstr "Beheer Database"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:25
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Manage Categories"
|
||||||
|
msgstr "SimpleMap: Beheer Database"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:88
|
||||||
|
#: admin/manage-categories.php:97
|
||||||
|
#: admin/manage-categories.php:103
|
||||||
|
#: admin/manage-categories.php:174
|
||||||
|
#: admin/manage-categories.php:183
|
||||||
|
#: admin/manage-categories.php:189
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Manage Categories"
|
||||||
|
msgstr "Beheer Database"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "SimpleMap: Import/Export"
|
||||||
|
msgstr "SimpleMap: Import/Export"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "Import/Export"
|
||||||
|
msgstr "Import/Export"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/help.php:18
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Help"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
msgid "Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Help"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: simplemap.php:170
|
||||||
|
msgid "SimpleMap settings saved."
|
||||||
|
msgstr "SimpleMap instellingen opgeslagen."
|
||||||
|
|
||||||
|
#: simplemap.php:274
|
||||||
|
msgid "Class SimpleMap already declared!"
|
||||||
|
msgstr "Class SimpleMap al aangegeven!"
|
||||||
|
|
||||||
|
#: simplemap.php:303
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr "Instellingen"
|
||||||
|
|
||||||
|
#: actions/category-update.php:15
|
||||||
|
msgid "Your database has been successfully updated."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:200
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" failed to geocode, with status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:222
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" was not successfully inserted into the database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:233
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%d records imported successfully."
|
||||||
|
msgstr "succesvol toegevoegd."
|
||||||
|
|
||||||
|
#: actions/location-process.php:17
|
||||||
|
msgid "Record deleted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:26
|
||||||
|
msgid "Database cleared."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:144
|
||||||
|
#: admin/manage-categories.php:147
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Quick Edit"
|
||||||
|
msgstr "Snel bewerken"
|
||||||
|
|
||||||
|
#: actions/location-process.php:145
|
||||||
|
#: admin/manage-categories.php:148
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr "Wissen"
|
||||||
|
|
||||||
|
#: actions/location-process.php:185
|
||||||
|
#: admin/manage-db.php:234
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Fax:"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:34
|
||||||
|
msgid "added successfully."
|
||||||
|
msgstr "succesvol toegevoegd."
|
||||||
|
|
||||||
|
#: admin/add-location.php:50
|
||||||
|
msgid "Name and Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:58
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:319
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Naam"
|
||||||
|
|
||||||
|
#: admin/add-location.php:59
|
||||||
|
msgid "Please enter a name."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:63
|
||||||
|
#: admin/manage-db.php:139
|
||||||
|
#: admin/manage-db.php:156
|
||||||
|
#: admin/manage-db.php:418
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:68
|
||||||
|
#: admin/manage-categories.php:115
|
||||||
|
#: admin/manage-categories.php:124
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:391
|
||||||
|
msgid "Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:82
|
||||||
|
#: admin/manage-db.php:403
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "You can add categories from the %s General Options screen.%s"
|
||||||
|
msgstr "Druk op een toets op de Algemene opties pagina."
|
||||||
|
|
||||||
|
#: admin/add-location.php:88
|
||||||
|
#: admin/manage-db.php:138
|
||||||
|
#: admin/manage-db.php:155
|
||||||
|
#: admin/manage-db.php:406
|
||||||
|
msgid "Tags"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:105
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geographic Location"
|
||||||
|
msgstr "Start Locatie"
|
||||||
|
|
||||||
|
#: admin/add-location.php:108
|
||||||
|
msgid "You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:114
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:332
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Adres"
|
||||||
|
|
||||||
|
#: admin/add-location.php:120
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "City/Town"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:125
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/manage-db.php:339
|
||||||
|
msgid "State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:130
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "Zip/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:135
|
||||||
|
#: admin/manage-db.php:371
|
||||||
|
msgid "Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:151
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude/Longitude"
|
||||||
|
msgstr "Lengtegraad:"
|
||||||
|
|
||||||
|
#: admin/add-location.php:179
|
||||||
|
msgid "Miscellaneous Information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:187
|
||||||
|
#: admin/manage-db.php:384
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr "Telefoon"
|
||||||
|
|
||||||
|
#: admin/add-location.php:192
|
||||||
|
#: admin/manage-db.php:386
|
||||||
|
msgid "Fax"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:197
|
||||||
|
#: admin/manage-db.php:388
|
||||||
|
msgid "URL"
|
||||||
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: admin/add-location.php:199
|
||||||
|
msgid "Please include <strong>http://</strong>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:60
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations %s is disabled because you have more than 100 locations in your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:178
|
||||||
|
msgid "Location Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:181
|
||||||
|
#, fuzzy
|
||||||
|
msgid "If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier."
|
||||||
|
msgstr "Als de meeste van uw locaties zijn in dezelfde provincie zijn, kiest u die provincie hier, om toevoeging van nieuwe locaties te vergemakkelijken."
|
||||||
|
|
||||||
|
#: admin/general-options.php:187
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Google Maps Domain"
|
||||||
|
msgstr "Google Maps API sleutel"
|
||||||
|
|
||||||
|
#: admin/general-options.php:203
|
||||||
|
msgid "Default Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:219
|
||||||
|
msgid "Default State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:224
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Address Format"
|
||||||
|
msgstr "Adres"
|
||||||
|
|
||||||
|
#: admin/general-options.php:241
|
||||||
|
#: admin/general-options.php:242
|
||||||
|
#: admin/general-options.php:243
|
||||||
|
#: admin/general-options.php:244
|
||||||
|
#: admin/general-options.php:245
|
||||||
|
#: admin/general-options.php:246
|
||||||
|
#: admin/general-options.php:247
|
||||||
|
msgid "Example"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:256
|
||||||
|
#: admin/general-options.php:392
|
||||||
|
#: admin/general-options.php:528
|
||||||
|
msgid "Save Options"
|
||||||
|
msgstr "Opslagopties"
|
||||||
|
|
||||||
|
#: admin/general-options.php:269
|
||||||
|
msgid "Map Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, php-format
|
||||||
|
msgid "See %s the Help page%s for an explanation of these options."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:278
|
||||||
|
msgid "Google Maps API Key"
|
||||||
|
msgstr "Google Maps API sleutel"
|
||||||
|
|
||||||
|
#: admin/general-options.php:281
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%s Click here%s to sign up for a Google Maps API key for your domain."
|
||||||
|
msgstr "aan te melden voor een Google Maps API-sleutel voor uw domein."
|
||||||
|
|
||||||
|
#: admin/general-options.php:286
|
||||||
|
#: admin/help.php:73
|
||||||
|
msgid "Starting Location"
|
||||||
|
msgstr "Start Locatie"
|
||||||
|
|
||||||
|
#: admin/general-options.php:288
|
||||||
|
msgid "Latitude:"
|
||||||
|
msgstr "Breedtegraad:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:290
|
||||||
|
msgid "Longitude:"
|
||||||
|
msgstr "Lengtegraad:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:298
|
||||||
|
msgid "Distance Units"
|
||||||
|
msgstr "Afstand Eenheden"
|
||||||
|
|
||||||
|
#: admin/general-options.php:305
|
||||||
|
msgid "Miles"
|
||||||
|
msgstr "Mijl"
|
||||||
|
|
||||||
|
#: admin/general-options.php:306
|
||||||
|
msgid "Kilometers"
|
||||||
|
msgstr "Kilometers"
|
||||||
|
|
||||||
|
#: admin/general-options.php:312
|
||||||
|
msgid "Default Search Radius"
|
||||||
|
msgstr "Standaard Zoeken Radius"
|
||||||
|
|
||||||
|
#: admin/general-options.php:326
|
||||||
|
msgid "Number of Results to Display"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:336
|
||||||
|
msgid "Select \"No Limit\" to display all results within the search radius."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:341
|
||||||
|
#: admin/help.php:78
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-Load Database"
|
||||||
|
msgstr "Beheer Database"
|
||||||
|
|
||||||
|
#: admin/general-options.php:344
|
||||||
|
msgid "No auto-load"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:345
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-load search results"
|
||||||
|
msgstr "Automatisch laden van Adres"
|
||||||
|
|
||||||
|
#: admin/general-options.php:346
|
||||||
|
msgid "Auto-load all locations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:354
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Stick to default location set above"
|
||||||
|
msgstr "Standaard Provincie"
|
||||||
|
|
||||||
|
#: admin/general-options.php:359
|
||||||
|
msgid "Default Zoom Level"
|
||||||
|
msgstr "Standaard zoomniveau"
|
||||||
|
|
||||||
|
#: admin/general-options.php:368
|
||||||
|
msgid "1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in."
|
||||||
|
msgstr "1 is de meest uitgezoomde (de hele wereld zichtbaar is) en 19 is de meest ingezoomde."
|
||||||
|
|
||||||
|
#: admin/general-options.php:373
|
||||||
|
#: admin/help.php:89
|
||||||
|
msgid "Special Location Label"
|
||||||
|
msgstr "Bijzondere Locatie Label"
|
||||||
|
|
||||||
|
#: admin/general-options.php:380
|
||||||
|
msgid "Map Page IDs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:383
|
||||||
|
msgid "Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:415
|
||||||
|
msgid "Map Style Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:418
|
||||||
|
#, php-format
|
||||||
|
msgid "To insert SimpleMap into a post or page, type this shortcode in the body: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:424
|
||||||
|
msgid "Map Size"
|
||||||
|
msgstr "Map Grootte"
|
||||||
|
|
||||||
|
#: admin/general-options.php:426
|
||||||
|
msgid "Width:"
|
||||||
|
msgstr "Breedte:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:428
|
||||||
|
msgid "Height:"
|
||||||
|
msgstr "Hoogte:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:430
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Enter a numeric value with CSS units, such as %s or %s."
|
||||||
|
msgstr "Voer een numerieke waarde met CSS eenheden, zoals"
|
||||||
|
|
||||||
|
#: admin/general-options.php:435
|
||||||
|
msgid "Default Map Type"
|
||||||
|
msgstr "Standaard Kaart Type"
|
||||||
|
|
||||||
|
#: admin/general-options.php:439
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Road map"
|
||||||
|
msgstr "Normaal kaart"
|
||||||
|
|
||||||
|
#: admin/general-options.php:446
|
||||||
|
msgid "Satellite map"
|
||||||
|
msgstr "Satelliet kaart"
|
||||||
|
|
||||||
|
#: admin/general-options.php:453
|
||||||
|
msgid "Hybrid map"
|
||||||
|
msgstr "Hybride kaart"
|
||||||
|
|
||||||
|
#: admin/general-options.php:460
|
||||||
|
msgid "Terrain map"
|
||||||
|
msgstr "Terrein kaart"
|
||||||
|
|
||||||
|
#: admin/general-options.php:468
|
||||||
|
msgid "Theme"
|
||||||
|
msgstr "Thema"
|
||||||
|
|
||||||
|
#: admin/general-options.php:475
|
||||||
|
msgid "Default Themes"
|
||||||
|
msgstr "Standaard Thema's"
|
||||||
|
|
||||||
|
#: admin/general-options.php:483
|
||||||
|
msgid "Custom Themes"
|
||||||
|
msgstr "Aangepaste Thema's"
|
||||||
|
|
||||||
|
#: admin/general-options.php:492
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
msgstr "Als u uw eigen thema wilt gebruiken, upload uw eigen CSS-bestand naar een nieuwe map in je plugins map genaamd"
|
||||||
|
|
||||||
|
#: admin/general-options.php:501
|
||||||
|
msgid "Display Search Form"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:508
|
||||||
|
msgid "Show the search form above the map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:513
|
||||||
|
msgid "SimpleMap Link"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: admin/general-options.php:520
|
||||||
|
msgid "Show the \"Powered by SimpleMap\" link"
|
||||||
|
msgstr "Toon de \"Powered by SimpleMap\" link"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
msgid "Jump to a section:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:35
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Displaying Your Map"
|
||||||
|
msgstr "Weergeven"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:108
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Adding a Location"
|
||||||
|
msgstr "Voeg Locatie Toe"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:141
|
||||||
|
msgid "Everything Else"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:42
|
||||||
|
msgid "To show your map on any post or page, insert the shortcode in the body:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:44
|
||||||
|
msgid "If you want only certain categories to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:46
|
||||||
|
msgid "You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:48
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Configure the appearance of your map on the %s General Options page.%s"
|
||||||
|
msgstr "Druk op een toets op de Algemene opties pagina."
|
||||||
|
|
||||||
|
#: admin/help.php:74
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press \"Geocode Address.\""
|
||||||
|
msgstr "Voer de locatie in van de kaart, die standaard geopnend moet worden, als er niet op plaatsnaam is gezocht. Bijvoorbeeld, als uw locaties zich in dezelfde stad bevinden, kunt u beginnen met het midden van die stad."
|
||||||
|
|
||||||
|
#: admin/help.php:80
|
||||||
|
#, php-format
|
||||||
|
msgid "%s No auto-load:%s Locations will not load automatically."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:81
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:82
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:84
|
||||||
|
msgid "If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:90
|
||||||
|
msgid "This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for \"Favorite Spots,\" or \"Free Wi-Fi,\" or anything you want. You can also leave it blank to disable it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:116
|
||||||
|
msgid "To properly add a new location, you must enter one or both of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:117
|
||||||
|
#, fuzzy
|
||||||
|
msgid "1. A full address"
|
||||||
|
msgstr "Automatisch laden van Adres"
|
||||||
|
|
||||||
|
#: admin/help.php:118
|
||||||
|
#, fuzzy
|
||||||
|
msgid "2. A latitude and longitude"
|
||||||
|
msgstr "om de breedte-en lengtegraad van een adres te vinden."
|
||||||
|
|
||||||
|
#: admin/help.php:119
|
||||||
|
msgid "If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:123
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You must also enter a name for every location."
|
||||||
|
msgstr "U moet een API-sleutel voor uw domein invoeren."
|
||||||
|
|
||||||
|
#: admin/help.php:149
|
||||||
|
#, php-format
|
||||||
|
msgid "If you have any other questions or comments, please visit the %s SimpleMap Support Forums%s. Search the forums for your problem before you post; the same issue may have been solved already by someone else."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:18
|
||||||
|
msgid "SimpleMap: Import/Export CSV"
|
||||||
|
msgstr "SimpleMap: Import/Export CSV"
|
||||||
|
|
||||||
|
#: admin/import-export.php:32
|
||||||
|
msgid "Import From File"
|
||||||
|
msgstr "Import Uit bestand"
|
||||||
|
|
||||||
|
#: admin/import-export.php:36
|
||||||
|
msgid "If your file has fewer than 100 records and does not have latitude/longitude data:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:38
|
||||||
|
msgid "Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:40
|
||||||
|
msgid "Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Description, Special (1 or 0), Latitude, Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:42
|
||||||
|
msgid "You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( ' ) or double ( \" ) quotation marks will work."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:44
|
||||||
|
msgid "If your file has more than 100 records:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:46
|
||||||
|
msgid "If you have more than 100 records to import, it is best to do one of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:49
|
||||||
|
msgid "Geocode your own data before importing it"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:50
|
||||||
|
msgid "Split your file into multiple files with no more than 100 lines each"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:53
|
||||||
|
#, php-format
|
||||||
|
msgid "Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:55
|
||||||
|
msgid "If you are importing a file you exported from SimpleMap (and haven't changed since), be sure to check the box below since the locations are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:61
|
||||||
|
#, fuzzy
|
||||||
|
msgid "File to import (maximum size 2MB):"
|
||||||
|
msgstr "Bestand te importeren:"
|
||||||
|
|
||||||
|
#: admin/import-export.php:63
|
||||||
|
msgid "Check this box if the locations in the file are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:65
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Import CSV File"
|
||||||
|
msgstr "Import Uit bestand"
|
||||||
|
|
||||||
|
#: admin/import-export.php:69
|
||||||
|
msgid "Importing a file may take several seconds; please be patient."
|
||||||
|
msgstr "Het importeren van een bestand kan enkele seconden duren, even geduld AUB."
|
||||||
|
|
||||||
|
#: admin/import-export.php:81
|
||||||
|
msgid "Export To File"
|
||||||
|
msgstr "Exporteren naar bestand"
|
||||||
|
|
||||||
|
#: admin/import-export.php:88
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Export Database to CSV File"
|
||||||
|
msgstr "Export Database"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete All Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Delete all categories in database"
|
||||||
|
msgstr "Verwijder alle vermeldingen in de database"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:85
|
||||||
|
#: admin/manage-categories.php:171
|
||||||
|
#, php-format
|
||||||
|
msgid "Displaying %d–%d of %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:114
|
||||||
|
#: admin/manage-categories.php:123
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:162
|
||||||
|
#: admin/manage-db.php:263
|
||||||
|
#: admin/manage-db.php:265
|
||||||
|
msgid "No records found."
|
||||||
|
msgstr "Geen gegevens gevonden."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:211
|
||||||
|
msgid "Category Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:217
|
||||||
|
#: admin/manage-db.php:423
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annuleren"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:218
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Update Category"
|
||||||
|
msgstr "Vernieuw Locatie"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:235
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You are about to delete the selected categories. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "U gaat de geselecteerde posten verwijderen. \"Annuleren \" om te stoppen, \"OK \" om te verwijderen."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:249
|
||||||
|
msgid "Add Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete Database"
|
||||||
|
msgstr "Verwijder Database"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Do you really want to delete all locations in your database?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete all entries in database"
|
||||||
|
msgstr "Verwijder alle vermeldingen in de database"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:105
|
||||||
|
#: admin/manage-db.php:274
|
||||||
|
msgid "Displaying"
|
||||||
|
msgstr "Weergeven"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Phone/Fax/URL"
|
||||||
|
msgstr "Tel/Fax"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Edit this post inline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
#, php-format
|
||||||
|
msgid "Do you really want to delete %s ?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:323
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude"
|
||||||
|
msgstr "Breedtegraad:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:326
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Longitude"
|
||||||
|
msgstr "Lengtegraad:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:336
|
||||||
|
msgid "City"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:368
|
||||||
|
msgid "ZIP/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:379
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geocode Address"
|
||||||
|
msgstr "Adres"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Update Location"
|
||||||
|
msgstr "Vernieuw Locatie"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Geocode the new address to update this location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:441
|
||||||
|
msgid "You are about to delete the selected posts. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "U gaat de geselecteerde posten verwijderen. \"Annuleren \" om te stoppen, \"OK \" om te verwijderen."
|
||||||
|
|
||||||
|
#: includes/display-map.php:27
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:28
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Please enter an address or search term in the box above."
|
||||||
|
msgstr "Geef een naam, adres, woonplaats of postcode in het zoekvak hierboven."
|
||||||
|
|
||||||
|
#: includes/display-map.php:33
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Powered by %s SimpleMap"
|
||||||
|
msgstr "Toon de \"Powered by SimpleMap\" link"
|
||||||
|
|
||||||
|
#: includes/scripts.php:22
|
||||||
|
msgid "Visit Website"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:23
|
||||||
|
msgid "Get Directions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:24
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Location"
|
||||||
|
msgstr "Voeg Locatie Toe"
|
||||||
|
|
||||||
|
#: includes/scripts.php:29
|
||||||
|
#, fuzzy
|
||||||
|
msgid "No results found."
|
||||||
|
msgstr "Geen gegevens gevonden."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "Go to the SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Home Page"
|
||||||
|
msgstr "SimpleMap Link"
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Go to the SimpleMap Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "You must enter an API key for your domain."
|
||||||
|
msgstr "U moet een API-sleutel voor uw domein invoeren."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "Enter a key on the General Options page."
|
||||||
|
msgstr "Druk op een toets op de Algemene opties pagina."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:27
|
||||||
|
msgid "You must update your database to enable the new category functionality."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:28
|
||||||
|
msgid "To update the database:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:30
|
||||||
|
msgid "Click here FIRST to download a backup of your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:32
|
||||||
|
msgid "Then click here to update your categories."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Click here to sign up for a Google Maps API key."
|
||||||
|
#~ msgstr "Klik hier om u aan te melden voor een Google Maps API-sleutel."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid "Importing Your CSV File"
|
||||||
|
#~ msgstr "Import Uit bestand"
|
||||||
|
#~ msgid "City, State, Zip"
|
||||||
|
#~ msgstr "Plaats, Provincie , postcode"
|
||||||
|
#~ msgid "Please include the"
|
||||||
|
#~ msgstr "Geef ook de"
|
||||||
|
#~ msgid "Click here"
|
||||||
|
#~ msgstr "Klik hier"
|
||||||
|
#~ msgid "or"
|
||||||
|
#~ msgstr "of"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "If you want to distinguish certain locations (i.e. Ten-Year Members, Most "
|
||||||
|
#~ "Popular, etc.) then enter the label for them here. Leave it blank to "
|
||||||
|
#~ "disable this feature."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Als je diverse locaties wilt onderscheiden (bv: Tien Jaar leden, Meest "
|
||||||
|
#~ "Populaire, enz.), voer het etiket dan hier in. Laat dit veld leeg om deze "
|
||||||
|
#~ "functie uit te schakelen."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Enter an address, city, or zip code here if you want the map to "
|
||||||
|
#~ "automatically show all locations in that area."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Voer een adres, plaats of postcode in, als u wilt dat de kaart "
|
||||||
|
#~ "automatisch alle locaties in dat gebied laat zien."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Om het een naam te geven, gebruikt u de volgende kop in de top van uw "
|
||||||
|
#~ "stylesheet:"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To ensure that you have the correct column structure, please download an "
|
||||||
|
#~ "export of your database below, even if it is empty, and compare your "
|
||||||
|
#~ "column order to what is in the export. If you are using a spreadsheet "
|
||||||
|
#~ "application, be sure to remove any double quotation marks (\") from your "
|
||||||
|
#~ "data before you export the CSV."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Om ervoor te zorgen dat u de juiste kolom structuur heeft, download een "
|
||||||
|
#~ "export van uw database hier beneden, zelfs als deze leeg is, U kunt dan "
|
||||||
|
#~ "een vergelijking maken van uw kolom structuur en die van het eport "
|
||||||
|
#~ "bestand. Als u een spreadsheet-toepassing gebruikt, moet u eventuele "
|
||||||
|
#~ "dubbele aanhalingstekens (\") van uw gegevens verwijderen voordat u het "
|
||||||
|
#~ "CSV bestnd exporteert."
|
||||||
|
#~ msgid "Import"
|
||||||
|
#~ msgstr "Import"
|
||||||
|
#~ msgid "Powered by"
|
||||||
|
#~ msgstr "Powered by"
|
||||||
|
|
BIN
lang/SimpleMap-pt_BR.mo
Normal file
946
lang/SimpleMap-pt_BR.po
Normal file
|
@ -0,0 +1,946 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: SimpleMap\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2009-11-02 20:05-0600\n"
|
||||||
|
"PO-Revision-Date: \n"
|
||||||
|
"Last-Translator: Alison Barrett <alison@alisothegeek.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: Portuguese\n"
|
||||||
|
"X-Poedit-SourceCharset: utf-8\n"
|
||||||
|
"X-Poedit-KeywordsList: __;_e\n"
|
||||||
|
"X-Poedit-Basepath: ../\n"
|
||||||
|
"X-Poedit-Country: BRAZIL\n"
|
||||||
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
"X-Poedit-SearchPath-1: admin\n"
|
||||||
|
"X-Poedit-SearchPath-2: includes\n"
|
||||||
|
|
||||||
|
#: simplemap.php:13
|
||||||
|
msgid "SimpleMap requires WordPress 2.8 or newer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Please update!</a>"
|
||||||
|
msgstr "SimpleMap requer Wordpress 2.8 ou superior. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Por favor, faça update do seu sistema!</a>"
|
||||||
|
|
||||||
|
#: simplemap.php:114
|
||||||
|
msgid "SimpleMap Options"
|
||||||
|
msgstr "Opções SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/general-options.php:160
|
||||||
|
msgid "SimpleMap: General Options"
|
||||||
|
msgstr "SimpleMap: Opções Principais"
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:65
|
||||||
|
msgid "General Options"
|
||||||
|
msgstr "Opções Principais"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:27
|
||||||
|
msgid "SimpleMap: Add Location"
|
||||||
|
msgstr "SimpleMap: Adicionar Local"
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:217
|
||||||
|
#: admin/add-location.php:218
|
||||||
|
msgid "Add Location"
|
||||||
|
msgstr "Adicionar local"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:45
|
||||||
|
msgid "SimpleMap: Manage Database"
|
||||||
|
msgstr "SimpleMap: Gerenciar Banco de Dados"
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:77
|
||||||
|
#: admin/manage-db.php:83
|
||||||
|
#: admin/manage-db.php:89
|
||||||
|
#: admin/manage-db.php:90
|
||||||
|
#: admin/manage-db.php:108
|
||||||
|
#: admin/manage-db.php:117
|
||||||
|
#: admin/manage-db.php:123
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:277
|
||||||
|
#: admin/manage-db.php:286
|
||||||
|
#: admin/manage-db.php:292
|
||||||
|
msgid "Manage Database"
|
||||||
|
msgstr "Gerenciar Banco de Dados"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:25
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Manage Categories"
|
||||||
|
msgstr "SimpleMap: Gerenciar Banco de Dados"
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:88
|
||||||
|
#: admin/manage-categories.php:97
|
||||||
|
#: admin/manage-categories.php:103
|
||||||
|
#: admin/manage-categories.php:174
|
||||||
|
#: admin/manage-categories.php:183
|
||||||
|
#: admin/manage-categories.php:189
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Manage Categories"
|
||||||
|
msgstr "Gerenciar Banco de Dados"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "SimpleMap: Import/Export"
|
||||||
|
msgstr "SimpleMap: Importar/Exportar"
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "Import/Export"
|
||||||
|
msgstr "Importar/Exportar"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/help.php:18
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap: Help"
|
||||||
|
msgstr "Link SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
msgid "Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Help"
|
||||||
|
msgstr "Link SimpleMap"
|
||||||
|
|
||||||
|
#: simplemap.php:170
|
||||||
|
msgid "SimpleMap settings saved."
|
||||||
|
msgstr "Configurações salvas."
|
||||||
|
|
||||||
|
#: simplemap.php:274
|
||||||
|
msgid "Class SimpleMap already declared!"
|
||||||
|
msgstr "Classe SimpleMap já declarada!"
|
||||||
|
|
||||||
|
#: simplemap.php:303
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr "Configurações"
|
||||||
|
|
||||||
|
#: actions/category-update.php:15
|
||||||
|
msgid "Your database has been successfully updated."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:200
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" failed to geocode, with status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:222
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" was not successfully inserted into the database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:233
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%d records imported successfully."
|
||||||
|
msgstr "adicionado com sucesso."
|
||||||
|
|
||||||
|
#: actions/location-process.php:17
|
||||||
|
msgid "Record deleted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:26
|
||||||
|
msgid "Database cleared."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:144
|
||||||
|
#: admin/manage-categories.php:147
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Quick Edit"
|
||||||
|
msgstr "Edição rápida"
|
||||||
|
|
||||||
|
#: actions/location-process.php:145
|
||||||
|
#: admin/manage-categories.php:148
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr "Excluir"
|
||||||
|
|
||||||
|
#: actions/location-process.php:185
|
||||||
|
#: admin/manage-db.php:234
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Fax:"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:34
|
||||||
|
msgid "added successfully."
|
||||||
|
msgstr "adicionado com sucesso."
|
||||||
|
|
||||||
|
#: admin/add-location.php:50
|
||||||
|
msgid "Name and Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:58
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:319
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Nome"
|
||||||
|
|
||||||
|
#: admin/add-location.php:59
|
||||||
|
msgid "Please enter a name."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:63
|
||||||
|
#: admin/manage-db.php:139
|
||||||
|
#: admin/manage-db.php:156
|
||||||
|
#: admin/manage-db.php:418
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:68
|
||||||
|
#: admin/manage-categories.php:115
|
||||||
|
#: admin/manage-categories.php:124
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:391
|
||||||
|
msgid "Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:82
|
||||||
|
#: admin/manage-db.php:403
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "You can add categories from the %s General Options screen.%s"
|
||||||
|
msgstr "Adicione uma chave na Página de configurações gerais."
|
||||||
|
|
||||||
|
#: admin/add-location.php:88
|
||||||
|
#: admin/manage-db.php:138
|
||||||
|
#: admin/manage-db.php:155
|
||||||
|
#: admin/manage-db.php:406
|
||||||
|
msgid "Tags"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:105
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geographic Location"
|
||||||
|
msgstr "Localização Inicial"
|
||||||
|
|
||||||
|
#: admin/add-location.php:108
|
||||||
|
msgid "You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:114
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:332
|
||||||
|
msgid "Address"
|
||||||
|
msgstr "Endereço"
|
||||||
|
|
||||||
|
#: admin/add-location.php:120
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "City/Town"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:125
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/manage-db.php:339
|
||||||
|
msgid "State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:130
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "Zip/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:135
|
||||||
|
#: admin/manage-db.php:371
|
||||||
|
msgid "Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:151
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude/Longitude"
|
||||||
|
msgstr "Longitude:"
|
||||||
|
|
||||||
|
#: admin/add-location.php:179
|
||||||
|
msgid "Miscellaneous Information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:187
|
||||||
|
#: admin/manage-db.php:384
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr "Telefone"
|
||||||
|
|
||||||
|
#: admin/add-location.php:192
|
||||||
|
#: admin/manage-db.php:386
|
||||||
|
msgid "Fax"
|
||||||
|
msgstr "Fax"
|
||||||
|
|
||||||
|
#: admin/add-location.php:197
|
||||||
|
#: admin/manage-db.php:388
|
||||||
|
msgid "URL"
|
||||||
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: admin/add-location.php:199
|
||||||
|
msgid "Please include <strong>http://</strong>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:60
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations %s is disabled because you have more than 100 locations in your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:178
|
||||||
|
msgid "Location Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:181
|
||||||
|
#, fuzzy
|
||||||
|
msgid "If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier."
|
||||||
|
msgstr "Se a maioria dos locais estão no mesmo Estado, escolha aqui o Estado que faço a adição de novos locais mais fácil."
|
||||||
|
|
||||||
|
#: admin/general-options.php:187
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Google Maps Domain"
|
||||||
|
msgstr "API do Google Maps"
|
||||||
|
|
||||||
|
#: admin/general-options.php:203
|
||||||
|
msgid "Default Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:219
|
||||||
|
msgid "Default State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:224
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Address Format"
|
||||||
|
msgstr "Endereço"
|
||||||
|
|
||||||
|
#: admin/general-options.php:241
|
||||||
|
#: admin/general-options.php:242
|
||||||
|
#: admin/general-options.php:243
|
||||||
|
#: admin/general-options.php:244
|
||||||
|
#: admin/general-options.php:245
|
||||||
|
#: admin/general-options.php:246
|
||||||
|
#: admin/general-options.php:247
|
||||||
|
msgid "Example"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:256
|
||||||
|
#: admin/general-options.php:392
|
||||||
|
#: admin/general-options.php:528
|
||||||
|
msgid "Save Options"
|
||||||
|
msgstr "Salvar opções"
|
||||||
|
|
||||||
|
#: admin/general-options.php:269
|
||||||
|
msgid "Map Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, php-format
|
||||||
|
msgid "See %s the Help page%s for an explanation of these options."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:278
|
||||||
|
msgid "Google Maps API Key"
|
||||||
|
msgstr "API do Google Maps"
|
||||||
|
|
||||||
|
#: admin/general-options.php:281
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "%s Click here%s to sign up for a Google Maps API key for your domain."
|
||||||
|
msgstr "para pegar um API do Google Maps para seu domínio."
|
||||||
|
|
||||||
|
#: admin/general-options.php:286
|
||||||
|
#: admin/help.php:73
|
||||||
|
msgid "Starting Location"
|
||||||
|
msgstr "Localização Inicial"
|
||||||
|
|
||||||
|
#: admin/general-options.php:288
|
||||||
|
msgid "Latitude:"
|
||||||
|
msgstr "Latitude:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:290
|
||||||
|
msgid "Longitude:"
|
||||||
|
msgstr "Longitude:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:298
|
||||||
|
msgid "Distance Units"
|
||||||
|
msgstr "Unidade de distância"
|
||||||
|
|
||||||
|
#: admin/general-options.php:305
|
||||||
|
msgid "Miles"
|
||||||
|
msgstr "Milhas (mi)"
|
||||||
|
|
||||||
|
#: admin/general-options.php:306
|
||||||
|
msgid "Kilometers"
|
||||||
|
msgstr "Quilômetros (km)"
|
||||||
|
|
||||||
|
#: admin/general-options.php:312
|
||||||
|
msgid "Default Search Radius"
|
||||||
|
msgstr "Abrangência padrão da busca"
|
||||||
|
|
||||||
|
#: admin/general-options.php:326
|
||||||
|
msgid "Number of Results to Display"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:336
|
||||||
|
msgid "Select \"No Limit\" to display all results within the search radius."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:341
|
||||||
|
#: admin/help.php:78
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-Load Database"
|
||||||
|
msgstr "Gerenciar Banco de Dados"
|
||||||
|
|
||||||
|
#: admin/general-options.php:344
|
||||||
|
msgid "No auto-load"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:345
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Auto-load search results"
|
||||||
|
msgstr "Autocarregar Endereço"
|
||||||
|
|
||||||
|
#: admin/general-options.php:346
|
||||||
|
msgid "Auto-load all locations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:354
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Stick to default location set above"
|
||||||
|
msgstr "Estado Padrão"
|
||||||
|
|
||||||
|
#: admin/general-options.php:359
|
||||||
|
msgid "Default Zoom Level"
|
||||||
|
msgstr "Nível de zoom padrão"
|
||||||
|
|
||||||
|
#: admin/general-options.php:368
|
||||||
|
msgid "1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in."
|
||||||
|
msgstr "1 é o zoom mínimo (todo o globo é visível) e 19 é o zoom máximo."
|
||||||
|
|
||||||
|
#: admin/general-options.php:373
|
||||||
|
#: admin/help.php:89
|
||||||
|
msgid "Special Location Label"
|
||||||
|
msgstr "Identificação Especial de Local"
|
||||||
|
|
||||||
|
#: admin/general-options.php:380
|
||||||
|
msgid "Map Page IDs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:383
|
||||||
|
msgid "Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:415
|
||||||
|
msgid "Map Style Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:418
|
||||||
|
#, php-format
|
||||||
|
msgid "To insert SimpleMap into a post or page, type this shortcode in the body: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:424
|
||||||
|
msgid "Map Size"
|
||||||
|
msgstr "Tamanho do mapa"
|
||||||
|
|
||||||
|
#: admin/general-options.php:426
|
||||||
|
msgid "Width:"
|
||||||
|
msgstr "Largura:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:428
|
||||||
|
msgid "Height:"
|
||||||
|
msgstr "Altura:"
|
||||||
|
|
||||||
|
#: admin/general-options.php:430
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Enter a numeric value with CSS units, such as %s or %s."
|
||||||
|
msgstr "Entre um valor numérico com unidades CSS, como"
|
||||||
|
|
||||||
|
#: admin/general-options.php:435
|
||||||
|
msgid "Default Map Type"
|
||||||
|
msgstr "Tipo de Mapa Padrão"
|
||||||
|
|
||||||
|
#: admin/general-options.php:439
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Road map"
|
||||||
|
msgstr "Normal"
|
||||||
|
|
||||||
|
#: admin/general-options.php:446
|
||||||
|
msgid "Satellite map"
|
||||||
|
msgstr "Satélite"
|
||||||
|
|
||||||
|
#: admin/general-options.php:453
|
||||||
|
msgid "Hybrid map"
|
||||||
|
msgstr "Híbrido"
|
||||||
|
|
||||||
|
#: admin/general-options.php:460
|
||||||
|
msgid "Terrain map"
|
||||||
|
msgstr "Terreno"
|
||||||
|
|
||||||
|
#: admin/general-options.php:468
|
||||||
|
msgid "Theme"
|
||||||
|
msgstr "Tema"
|
||||||
|
|
||||||
|
#: admin/general-options.php:475
|
||||||
|
msgid "Default Themes"
|
||||||
|
msgstr "Temas padrões"
|
||||||
|
|
||||||
|
#: admin/general-options.php:483
|
||||||
|
msgid "Custom Themes"
|
||||||
|
msgstr "Temas personalizados"
|
||||||
|
|
||||||
|
#: admin/general-options.php:492
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
msgstr "Para adicionar seu próprio tema, faça upload do seu próprio arquivo de CSS para um novo diretório dentro do diretório atual do plugin chamado"
|
||||||
|
|
||||||
|
#: admin/general-options.php:501
|
||||||
|
msgid "Display Search Form"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:508
|
||||||
|
msgid "Show the search form above the map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:513
|
||||||
|
msgid "SimpleMap Link"
|
||||||
|
msgstr "Link SimpleMap"
|
||||||
|
|
||||||
|
#: admin/general-options.php:520
|
||||||
|
msgid "Show the \"Powered by SimpleMap\" link"
|
||||||
|
msgstr "Mostrar o link \"por SimpleMap\""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
msgid "Jump to a section:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:35
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Displaying Your Map"
|
||||||
|
msgstr "Mostrando"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:108
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Adding a Location"
|
||||||
|
msgstr "Adicionar local"
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:141
|
||||||
|
msgid "Everything Else"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:42
|
||||||
|
msgid "To show your map on any post or page, insert the shortcode in the body:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:44
|
||||||
|
msgid "If you want only certain categories to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:46
|
||||||
|
msgid "You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:48
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Configure the appearance of your map on the %s General Options page.%s"
|
||||||
|
msgstr "Adicione uma chave na Página de configurações gerais."
|
||||||
|
|
||||||
|
#: admin/help.php:74
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press \"Geocode Address.\""
|
||||||
|
msgstr "Adicione o local no mapa a ser aberto por padrão quando nenhum local tenha sido pesquisado. Por exemplo, se seus locais estão concentrados na mesma cidade, você pode querer começar centralizado naquela cidade."
|
||||||
|
|
||||||
|
#: admin/help.php:80
|
||||||
|
#, php-format
|
||||||
|
msgid "%s No auto-load:%s Locations will not load automatically."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:81
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:82
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:84
|
||||||
|
msgid "If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:90
|
||||||
|
msgid "This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for \"Favorite Spots,\" or \"Free Wi-Fi,\" or anything you want. You can also leave it blank to disable it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:116
|
||||||
|
msgid "To properly add a new location, you must enter one or both of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:117
|
||||||
|
#, fuzzy
|
||||||
|
msgid "1. A full address"
|
||||||
|
msgstr "Autocarregar Endereço"
|
||||||
|
|
||||||
|
#: admin/help.php:118
|
||||||
|
#, fuzzy
|
||||||
|
msgid "2. A latitude and longitude"
|
||||||
|
msgstr "para encontrar a latitude e longitude de um endereço"
|
||||||
|
|
||||||
|
#: admin/help.php:119
|
||||||
|
msgid "If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:123
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You must also enter a name for every location."
|
||||||
|
msgstr "Você precisa adicionar um API para a seu domínio."
|
||||||
|
|
||||||
|
#: admin/help.php:149
|
||||||
|
#, php-format
|
||||||
|
msgid "If you have any other questions or comments, please visit the %s SimpleMap Support Forums%s. Search the forums for your problem before you post; the same issue may have been solved already by someone else."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:18
|
||||||
|
msgid "SimpleMap: Import/Export CSV"
|
||||||
|
msgstr "SimpleMap: Importar/Exportar CSV"
|
||||||
|
|
||||||
|
#: admin/import-export.php:32
|
||||||
|
msgid "Import From File"
|
||||||
|
msgstr "Importar do Arquivo"
|
||||||
|
|
||||||
|
#: admin/import-export.php:36
|
||||||
|
msgid "If your file has fewer than 100 records and does not have latitude/longitude data:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:38
|
||||||
|
msgid "Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:40
|
||||||
|
msgid "Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Description, Special (1 or 0), Latitude, Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:42
|
||||||
|
msgid "You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( ' ) or double ( \" ) quotation marks will work."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:44
|
||||||
|
msgid "If your file has more than 100 records:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:46
|
||||||
|
msgid "If you have more than 100 records to import, it is best to do one of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:49
|
||||||
|
msgid "Geocode your own data before importing it"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:50
|
||||||
|
msgid "Split your file into multiple files with no more than 100 lines each"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:53
|
||||||
|
#, php-format
|
||||||
|
msgid "Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:55
|
||||||
|
msgid "If you are importing a file you exported from SimpleMap (and haven't changed since), be sure to check the box below since the locations are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:61
|
||||||
|
#, fuzzy
|
||||||
|
msgid "File to import (maximum size 2MB):"
|
||||||
|
msgstr "Arquivo para importar:"
|
||||||
|
|
||||||
|
#: admin/import-export.php:63
|
||||||
|
msgid "Check this box if the locations in the file are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:65
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Import CSV File"
|
||||||
|
msgstr "Importar do Arquivo"
|
||||||
|
|
||||||
|
#: admin/import-export.php:69
|
||||||
|
msgid "Importing a file may take several seconds; please be patient."
|
||||||
|
msgstr "Importação de um arquivo pode levar vários segundos, por favor seja paciente."
|
||||||
|
|
||||||
|
#: admin/import-export.php:81
|
||||||
|
msgid "Export To File"
|
||||||
|
msgstr "Exportar para arquivo"
|
||||||
|
|
||||||
|
#: admin/import-export.php:88
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Export Database to CSV File"
|
||||||
|
msgstr "Exportar Banco de Dados"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete All Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Delete all categories in database"
|
||||||
|
msgstr "Excluir todas as entrada no banco de dados"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:85
|
||||||
|
#: admin/manage-categories.php:171
|
||||||
|
#, php-format
|
||||||
|
msgid "Displaying %d–%d of %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:114
|
||||||
|
#: admin/manage-categories.php:123
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:162
|
||||||
|
#: admin/manage-db.php:263
|
||||||
|
#: admin/manage-db.php:265
|
||||||
|
msgid "No records found."
|
||||||
|
msgstr "Registro não encontrado."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:211
|
||||||
|
msgid "Category Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:217
|
||||||
|
#: admin/manage-db.php:423
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancelar"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:218
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Update Category"
|
||||||
|
msgstr "Atualizar local"
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:235
|
||||||
|
#, fuzzy
|
||||||
|
msgid "You are about to delete the selected categories. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Você deseja excluir as entradas selecionados. \"Cancelar\" para parar, \"OK\" para excluir."
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:249
|
||||||
|
msgid "Add Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete Database"
|
||||||
|
msgstr "Excluir Banco de Dados"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Do you really want to delete all locations in your database?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete all entries in database"
|
||||||
|
msgstr "Excluir todas as entrada no banco de dados"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:105
|
||||||
|
#: admin/manage-db.php:274
|
||||||
|
msgid "Displaying"
|
||||||
|
msgstr "Mostrando"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Phone/Fax/URL"
|
||||||
|
msgstr "Fone/Fax"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Edit this post inline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
#, php-format
|
||||||
|
msgid "Do you really want to delete %s ?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:323
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Latitude"
|
||||||
|
msgstr "Latitude:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:326
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Longitude"
|
||||||
|
msgstr "Longitude:"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:336
|
||||||
|
msgid "City"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:368
|
||||||
|
msgid "ZIP/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:379
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Geocode Address"
|
||||||
|
msgstr "Endereço"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Update Location"
|
||||||
|
msgstr "Atualizar local"
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Geocode the new address to update this location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:441
|
||||||
|
msgid "You are about to delete the selected posts. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr "Você deseja excluir as entradas selecionados. \"Cancelar\" para parar, \"OK\" para excluir."
|
||||||
|
|
||||||
|
#: includes/display-map.php:27
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:28
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Please enter an address or search term in the box above."
|
||||||
|
msgstr "Adicione um nome, endereço, cidade ou CEP no campo de busca acima."
|
||||||
|
|
||||||
|
#: includes/display-map.php:33
|
||||||
|
#, fuzzy, php-format
|
||||||
|
msgid "Powered by %s SimpleMap"
|
||||||
|
msgstr "Mostrar o link \"por SimpleMap\""
|
||||||
|
|
||||||
|
#: includes/scripts.php:22
|
||||||
|
msgid "Visit Website"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:23
|
||||||
|
msgid "Get Directions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:24
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Location"
|
||||||
|
msgstr "Adicionar local"
|
||||||
|
|
||||||
|
#: includes/scripts.php:29
|
||||||
|
#, fuzzy
|
||||||
|
msgid "No results found."
|
||||||
|
msgstr "Registro não encontrado."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "Go to the SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SimpleMap Home Page"
|
||||||
|
msgstr "Link SimpleMap"
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Go to the SimpleMap Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "You must enter an API key for your domain."
|
||||||
|
msgstr "Você precisa adicionar um API para a seu domínio."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "Enter a key on the General Options page."
|
||||||
|
msgstr "Adicione uma chave na Página de configurações gerais."
|
||||||
|
|
||||||
|
#: includes/toolbar.php:27
|
||||||
|
msgid "You must update your database to enable the new category functionality."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:28
|
||||||
|
msgid "To update the database:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:30
|
||||||
|
msgid "Click here FIRST to download a backup of your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:32
|
||||||
|
msgid "Then click here to update your categories."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Click here to sign up for a Google Maps API key."
|
||||||
|
#~ msgstr "Clique aqui para pegar seu API do Google Maps."
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid "Importing Your CSV File"
|
||||||
|
#~ msgstr "Importar do Arquivo"
|
||||||
|
#~ msgid "City, State, Zip"
|
||||||
|
#~ msgstr "Cidade, Estado, CEP"
|
||||||
|
#~ msgid "Please include the"
|
||||||
|
#~ msgstr "Por favor inclua o(a)"
|
||||||
|
#~ msgid "Click here"
|
||||||
|
#~ msgstr "Clique aqui"
|
||||||
|
#~ msgid "or"
|
||||||
|
#~ msgstr "ou"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "If you want to distinguish certain locations (i.e. Ten-Year Members, Most "
|
||||||
|
#~ "Popular, etc.) then enter the label for them here. Leave it blank to "
|
||||||
|
#~ "disable this feature."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Se você deseja distinguir certos locais (por exemplo, Membros de 10 anos, "
|
||||||
|
#~ "Mais Popular, etc.) então adicione a identificação para eles aqui. Deixe "
|
||||||
|
#~ "em branco se desejar desabilitar esta opção."
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "Enter an address, city, or zip code here if you want the map to "
|
||||||
|
#~ "automatically show all locations in that area."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Adicione aqui um endereço, cidade ou CEP se você deseja que o mapa mostre "
|
||||||
|
#~ "automaticamente todos os locais daquela área. "
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Ao nomeá-lo, use a seguinte cabeçalho no topo da sua folha de estilo:"
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "To ensure that you have the correct column structure, please download an "
|
||||||
|
#~ "export of your database below, even if it is empty, and compare your "
|
||||||
|
#~ "column order to what is in the export. If you are using a spreadsheet "
|
||||||
|
#~ "application, be sure to remove any double quotation marks (\") from your "
|
||||||
|
#~ "data before you export the CSV."
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "Esteja seguro que a estrutura de coluna seja correta, por favor, faça "
|
||||||
|
#~ "abaixo o download do seu banco de dados, ainda que vazio, e compare a "
|
||||||
|
#~ "posição das colunas. Se você está usando um aplicativo de planilhas, "
|
||||||
|
#~ "tenha certeza que removeu qualquer aspas ('\") do seus dados antes de "
|
||||||
|
#~ "exportar o arquivo CSV."
|
||||||
|
#~ msgid "Import"
|
||||||
|
#~ msgstr "Importar"
|
||||||
|
#~ msgid "Powered by"
|
||||||
|
#~ msgstr "por"
|
||||||
|
|
BIN
lang/SimpleMap.mo
Normal file
862
lang/SimpleMap.pot
Normal file
|
@ -0,0 +1,862 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: SimpleMap\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2009-11-02 20:05-0600\n"
|
||||||
|
"PO-Revision-Date: \n"
|
||||||
|
"Last-Translator: Alison Barrett <alison@alisothegeek.com>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Poedit-Language: English\n"
|
||||||
|
"X-Poedit-SourceCharset: utf-8\n"
|
||||||
|
"X-Poedit-KeywordsList: __;_e\n"
|
||||||
|
"X-Poedit-Basepath: ../\n"
|
||||||
|
"X-Poedit-SearchPath-0: .\n"
|
||||||
|
"X-Poedit-SearchPath-1: admin\n"
|
||||||
|
"X-Poedit-SearchPath-2: includes\n"
|
||||||
|
|
||||||
|
#: simplemap.php:13
|
||||||
|
msgid "SimpleMap requires WordPress 2.8 or newer. <a href=\"http://codex.wordpress.org/Upgrading_WordPress\">Please update!</a>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:114
|
||||||
|
msgid "SimpleMap Options"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/general-options.php:160
|
||||||
|
msgid "SimpleMap: General Options"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:115
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:65
|
||||||
|
msgid "General Options"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:27
|
||||||
|
msgid "SimpleMap: Add Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:116
|
||||||
|
#: admin/add-location.php:217
|
||||||
|
#: admin/add-location.php:218
|
||||||
|
msgid "Add Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:45
|
||||||
|
msgid "SimpleMap: Manage Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:117
|
||||||
|
#: admin/manage-db.php:77
|
||||||
|
#: admin/manage-db.php:83
|
||||||
|
#: admin/manage-db.php:89
|
||||||
|
#: admin/manage-db.php:90
|
||||||
|
#: admin/manage-db.php:108
|
||||||
|
#: admin/manage-db.php:117
|
||||||
|
#: admin/manage-db.php:123
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:277
|
||||||
|
#: admin/manage-db.php:286
|
||||||
|
#: admin/manage-db.php:292
|
||||||
|
msgid "Manage Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:25
|
||||||
|
msgid "SimpleMap: Manage Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:118
|
||||||
|
#: admin/manage-categories.php:88
|
||||||
|
#: admin/manage-categories.php:97
|
||||||
|
#: admin/manage-categories.php:103
|
||||||
|
#: admin/manage-categories.php:174
|
||||||
|
#: admin/manage-categories.php:183
|
||||||
|
#: admin/manage-categories.php:189
|
||||||
|
msgid "Manage Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "SimpleMap: Import/Export"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:119
|
||||||
|
msgid "Import/Export"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/help.php:18
|
||||||
|
msgid "SimpleMap: Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
msgid "Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:120
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
msgid "SimpleMap Help"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:170
|
||||||
|
msgid "SimpleMap settings saved."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:274
|
||||||
|
msgid "Class SimpleMap already declared!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: simplemap.php:303
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/category-update.php:15
|
||||||
|
msgid "Your database has been successfully updated."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:200
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" failed to geocode, with status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:222
|
||||||
|
#, php-format
|
||||||
|
msgid "Location \"%s\" was not successfully inserted into the database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/csv-process.php:233
|
||||||
|
#, php-format
|
||||||
|
msgid "%d records imported successfully."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:17
|
||||||
|
msgid "Record deleted."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:26
|
||||||
|
msgid "Database cleared."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:144
|
||||||
|
#: admin/manage-categories.php:147
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Quick Edit"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:145
|
||||||
|
#: admin/manage-categories.php:148
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/location-process.php:185
|
||||||
|
#: admin/manage-db.php:234
|
||||||
|
msgid "Fax:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:34
|
||||||
|
msgid "added successfully."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:50
|
||||||
|
msgid "Name and Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:58
|
||||||
|
#: admin/manage-db.php:134
|
||||||
|
#: admin/manage-db.php:151
|
||||||
|
#: admin/manage-db.php:319
|
||||||
|
msgid "Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:59
|
||||||
|
msgid "Please enter a name."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:63
|
||||||
|
#: admin/manage-db.php:139
|
||||||
|
#: admin/manage-db.php:156
|
||||||
|
#: admin/manage-db.php:418
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:68
|
||||||
|
#: admin/manage-categories.php:115
|
||||||
|
#: admin/manage-categories.php:124
|
||||||
|
#: admin/manage-db.php:137
|
||||||
|
#: admin/manage-db.php:154
|
||||||
|
#: admin/manage-db.php:391
|
||||||
|
msgid "Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:82
|
||||||
|
#: admin/manage-db.php:403
|
||||||
|
#, php-format
|
||||||
|
msgid "You can add categories from the %s General Options screen.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:88
|
||||||
|
#: admin/manage-db.php:138
|
||||||
|
#: admin/manage-db.php:155
|
||||||
|
#: admin/manage-db.php:406
|
||||||
|
msgid "Tags"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:105
|
||||||
|
msgid "Geographic Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:108
|
||||||
|
msgid "You must enter either an address or a latitude/longitude. If you enter both, the address will not be geocoded and your latitude/longitude values will remain intact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:114
|
||||||
|
#: admin/manage-db.php:135
|
||||||
|
#: admin/manage-db.php:152
|
||||||
|
#: admin/manage-db.php:332
|
||||||
|
msgid "Address"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:120
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "City/Town"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:125
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/manage-db.php:339
|
||||||
|
msgid "State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:130
|
||||||
|
#: admin/general-options.php:38
|
||||||
|
#: admin/general-options.php:39
|
||||||
|
#: admin/general-options.php:227
|
||||||
|
#: admin/general-options.php:229
|
||||||
|
#: admin/general-options.php:231
|
||||||
|
#: admin/general-options.php:233
|
||||||
|
#: admin/general-options.php:235
|
||||||
|
#: admin/general-options.php:237
|
||||||
|
#: admin/general-options.php:239
|
||||||
|
msgid "Zip/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:135
|
||||||
|
#: admin/manage-db.php:371
|
||||||
|
msgid "Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:151
|
||||||
|
msgid "Latitude/Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:179
|
||||||
|
msgid "Miscellaneous Information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:187
|
||||||
|
#: admin/manage-db.php:384
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:192
|
||||||
|
#: admin/manage-db.php:386
|
||||||
|
msgid "Fax"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:197
|
||||||
|
#: admin/manage-db.php:388
|
||||||
|
msgid "URL"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/add-location.php:199
|
||||||
|
msgid "Please include <strong>http://</strong>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:60
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations %s is disabled because you have more than 100 locations in your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:178
|
||||||
|
msgid "Location Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:181
|
||||||
|
msgid "If most of your locations are in the same area, choose the country and state/province here to make adding new locations easier."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:187
|
||||||
|
msgid "Google Maps Domain"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:203
|
||||||
|
msgid "Default Country"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:219
|
||||||
|
msgid "Default State/Province"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:224
|
||||||
|
msgid "Address Format"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:241
|
||||||
|
#: admin/general-options.php:242
|
||||||
|
#: admin/general-options.php:243
|
||||||
|
#: admin/general-options.php:244
|
||||||
|
#: admin/general-options.php:245
|
||||||
|
#: admin/general-options.php:246
|
||||||
|
#: admin/general-options.php:247
|
||||||
|
msgid "Example"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:256
|
||||||
|
#: admin/general-options.php:392
|
||||||
|
#: admin/general-options.php:528
|
||||||
|
msgid "Save Options"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:269
|
||||||
|
msgid "Map Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:272
|
||||||
|
#, php-format
|
||||||
|
msgid "See %s the Help page%s for an explanation of these options."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:278
|
||||||
|
msgid "Google Maps API Key"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:281
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Click here%s to sign up for a Google Maps API key for your domain."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:286
|
||||||
|
#: admin/help.php:73
|
||||||
|
msgid "Starting Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:288
|
||||||
|
msgid "Latitude:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:290
|
||||||
|
msgid "Longitude:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:298
|
||||||
|
msgid "Distance Units"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:305
|
||||||
|
msgid "Miles"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:306
|
||||||
|
msgid "Kilometers"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:312
|
||||||
|
msgid "Default Search Radius"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:326
|
||||||
|
msgid "Number of Results to Display"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:336
|
||||||
|
msgid "Select \"No Limit\" to display all results within the search radius."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:341
|
||||||
|
#: admin/help.php:78
|
||||||
|
msgid "Auto-Load Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:344
|
||||||
|
msgid "No auto-load"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:345
|
||||||
|
msgid "Auto-load search results"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:346
|
||||||
|
msgid "Auto-load all locations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:354
|
||||||
|
msgid "Stick to default location set above"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:359
|
||||||
|
msgid "Default Zoom Level"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:368
|
||||||
|
msgid "1 is the most zoomed out (the whole world is visible) and 19 is the most zoomed in."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:373
|
||||||
|
#: admin/help.php:89
|
||||||
|
msgid "Special Location Label"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:380
|
||||||
|
msgid "Map Page IDs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:383
|
||||||
|
msgid "Enter the IDs of the pages/posts the map will appear on, separated by commas. The map scripts will only be loaded on those pages. Leave blank or enter 0 to load the scripts on all pages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:415
|
||||||
|
msgid "Map Style Defaults"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:418
|
||||||
|
#, php-format
|
||||||
|
msgid "To insert SimpleMap into a post or page, type this shortcode in the body: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:424
|
||||||
|
msgid "Map Size"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:426
|
||||||
|
msgid "Width:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:428
|
||||||
|
msgid "Height:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:430
|
||||||
|
#, php-format
|
||||||
|
msgid "Enter a numeric value with CSS units, such as %s or %s."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:435
|
||||||
|
msgid "Default Map Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:439
|
||||||
|
msgid "Road map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:446
|
||||||
|
msgid "Satellite map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:453
|
||||||
|
msgid "Hybrid map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:460
|
||||||
|
msgid "Terrain map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:468
|
||||||
|
msgid "Theme"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:475
|
||||||
|
msgid "Default Themes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:483
|
||||||
|
msgid "Custom Themes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:492
|
||||||
|
#, php-format
|
||||||
|
msgid "To add your own theme, upload your own CSS file to a new directory in your plugins folder called %s simplemap-styles%s. To give it a name, use the following header in the top of your stylesheet:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:501
|
||||||
|
msgid "Display Search Form"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:508
|
||||||
|
msgid "Show the search form above the map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:513
|
||||||
|
msgid "SimpleMap Link"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/general-options.php:520
|
||||||
|
msgid "Show the \"Powered by SimpleMap\" link"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
msgid "Jump to a section:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:35
|
||||||
|
msgid "Displaying Your Map"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:108
|
||||||
|
msgid "Adding a Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:22
|
||||||
|
#: admin/help.php:141
|
||||||
|
msgid "Everything Else"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:42
|
||||||
|
msgid "To show your map on any post or page, insert the shortcode in the body:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:44
|
||||||
|
msgid "If you want only certain categories to show on a map, insert shortcode like this, where the numbers are replaced with the ID numbers of your desired categories:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:46
|
||||||
|
msgid "You can place content above or below your map, just like in any other post. Note that any content placed below the map will be pushed down by the list of search results (unless you have them displaying differently with a custom theme)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:48
|
||||||
|
#, php-format
|
||||||
|
msgid "Configure the appearance of your map on the %s General Options page.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:74
|
||||||
|
msgid "Enter the location the map should open to by default, when no location has been searched for. If you do not know the latitude and longitude of your starting location, enter the address in the provided text field and press \"Geocode Address.\""
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:80
|
||||||
|
#, php-format
|
||||||
|
msgid "%s No auto-load:%s Locations will not load automatically."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:81
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load search results:%s The locations will load based on the default location, default search radius and zoom level you have set."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:82
|
||||||
|
#, php-format
|
||||||
|
msgid "%s Auto-load all locations:%s All of the locations in your database will load at the default zoom level you have set, disregarding your default search radius. %s This option is not enabled if you have more than 100 locations in your database.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:84
|
||||||
|
msgid "If you leave the checkbox unchecked, then the auto-load feature will automatically move the map to the center of all the loaded locations. If you check the box, your default location will be respected regardless of the locations the map is loading."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:90
|
||||||
|
msgid "This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for \"Favorite Spots,\" or \"Free Wi-Fi,\" or anything you want. You can also leave it blank to disable it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:116
|
||||||
|
msgid "To properly add a new location, you must enter one or both of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:117
|
||||||
|
msgid "1. A full address"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:118
|
||||||
|
msgid "2. A latitude and longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:119
|
||||||
|
msgid "If you enter a latitude and longitude, then the address will not be geocoded, and your custom values will be left in place. Entering an address without latitude or longitude will result in the address being geocoded before it is submitted to the database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:123
|
||||||
|
msgid "You must also enter a name for every location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/help.php:149
|
||||||
|
#, php-format
|
||||||
|
msgid "If you have any other questions or comments, please visit the %s SimpleMap Support Forums%s. Search the forums for your problem before you post; the same issue may have been solved already by someone else."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:18
|
||||||
|
msgid "SimpleMap: Import/Export CSV"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:32
|
||||||
|
msgid "Import From File"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:36
|
||||||
|
msgid "If your file has fewer than 100 records and does not have latitude/longitude data:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:38
|
||||||
|
msgid "Make sure your CSV has a header row that gives the field names (in English). A good example of a header row would be as follows:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:40
|
||||||
|
msgid "Name, Address, Address Line 2, City, State/Province, ZIP/Postal Code, Country, Phone, Fax, URL, Category, Tags, Description, Special (1 or 0), Latitude, Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:42
|
||||||
|
msgid "You can import your file with or without quotation marks around each field. However, if any of your fields contain commas, you should enclose your fields in quotation marks. Single ( ' ) or double ( \" ) quotation marks will work."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:44
|
||||||
|
msgid "If your file has more than 100 records:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:46
|
||||||
|
msgid "If you have more than 100 records to import, it is best to do one of the following:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:49
|
||||||
|
msgid "Geocode your own data before importing it"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:50
|
||||||
|
msgid "Split your file into multiple files with no more than 100 lines each"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:53
|
||||||
|
#, php-format
|
||||||
|
msgid "Geocoding your own data will allow you to import thousands of records very quickly. If your locations need to be geocoded by SimpleMap, any file with more than 100 records might stall your server. %s Resources for geocoding your own locations can be found here.%s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:55
|
||||||
|
msgid "If you are importing a file you exported from SimpleMap (and haven't changed since), be sure to check the box below since the locations are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:61
|
||||||
|
msgid "File to import (maximum size 2MB):"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:63
|
||||||
|
msgid "Check this box if the locations in the file are already geocoded."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:65
|
||||||
|
msgid "Import CSV File"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:69
|
||||||
|
msgid "Importing a file may take several seconds; please be patient."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:81
|
||||||
|
msgid "Export To File"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/import-export.php:88
|
||||||
|
msgid "Export Database to CSV File"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete All Categories"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:37
|
||||||
|
msgid "Delete all categories in database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:85
|
||||||
|
#: admin/manage-categories.php:171
|
||||||
|
#, php-format
|
||||||
|
msgid "Displaying %d–%d of %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:114
|
||||||
|
#: admin/manage-categories.php:123
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:162
|
||||||
|
#: admin/manage-db.php:263
|
||||||
|
#: admin/manage-db.php:265
|
||||||
|
msgid "No records found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:211
|
||||||
|
msgid "Category Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:217
|
||||||
|
#: admin/manage-db.php:423
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:218
|
||||||
|
msgid "Update Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:235
|
||||||
|
msgid "You are about to delete the selected categories. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-categories.php:249
|
||||||
|
msgid "Add Category"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete Database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Do you really want to delete all locations in your database?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:57
|
||||||
|
msgid "Delete all entries in database"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:105
|
||||||
|
#: admin/manage-db.php:274
|
||||||
|
msgid "Displaying"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:136
|
||||||
|
#: admin/manage-db.php:153
|
||||||
|
msgid "Phone/Fax/URL"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:193
|
||||||
|
msgid "Edit this post inline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:194
|
||||||
|
#, php-format
|
||||||
|
msgid "Do you really want to delete %s ?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:323
|
||||||
|
msgid "Latitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:326
|
||||||
|
msgid "Longitude"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:336
|
||||||
|
msgid "City"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:368
|
||||||
|
msgid "ZIP/Postal Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:379
|
||||||
|
msgid "Geocode Address"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Update Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:424
|
||||||
|
msgid "Geocode the new address to update this location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: admin/manage-db.php:441
|
||||||
|
msgid "You are about to delete the selected posts. \"Cancel\" to stop, \"OK\" to delete."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:27
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:28
|
||||||
|
msgid "Please enter an address or search term in the box above."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/display-map.php:33
|
||||||
|
#, php-format
|
||||||
|
msgid "Powered by %s SimpleMap"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:22
|
||||||
|
msgid "Visit Website"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:23
|
||||||
|
msgid "Get Directions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:24
|
||||||
|
msgid "Location"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/scripts.php:29
|
||||||
|
msgid "No results found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "Go to the SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:6
|
||||||
|
msgid "SimpleMap Home Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Go to the SimpleMap Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:9
|
||||||
|
msgid "Support Forums"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "You must enter an API key for your domain."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:23
|
||||||
|
msgid "Enter a key on the General Options page."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:27
|
||||||
|
msgid "You must update your database to enable the new category functionality."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:28
|
||||||
|
msgid "To update the database:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:30
|
||||||
|
msgid "Click here FIRST to download a backup of your database."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: includes/toolbar.php:32
|
||||||
|
msgid "Then click here to update your categories."
|
||||||
|
msgstr ""
|
||||||
|
|
418
readme.txt
Normal file
|
@ -0,0 +1,418 @@
|
||||||
|
=== SimpleMap Store Locator ===
|
||||||
|
|
||||||
|
Contributors: hallsofmontezuma, fullthrottledevelopment
|
||||||
|
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTJBYXGQFSW64
|
||||||
|
Tags: map, maps, store locator, database, locations, stores, Google maps, locator
|
||||||
|
Requires at least: 2.8
|
||||||
|
Tested up to: 3.7.1
|
||||||
|
Stable tag: 2.4.6
|
||||||
|
|
||||||
|
SimpleMap is an easy-to-use international store locator plugin that uses Google Maps to display information directly on your WordPress site.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
SimpleMap is a *powerful* and *easy-to-use* international store locator plugin. It has an intuitive interface and is completely customizable. Its search features make it easy for your users to find your locations quickly.
|
||||||
|
|
||||||
|
Please note: SimpleMap has some compatibility problems with WordPress MU.
|
||||||
|
|
||||||
|
Key features include:
|
||||||
|
|
||||||
|
* Manage locations from any country supported by Google Maps
|
||||||
|
* Manage an unlimited number of locations
|
||||||
|
* Put a Google Map on any page or post that gives instant results to users
|
||||||
|
* Users can enter a street address, city, state, or zip to search the database
|
||||||
|
* Customize the appearance of the map and results with your own themes
|
||||||
|
* Use a familiar interface that fits seamlessly into the WordPress admin area
|
||||||
|
* Import and export your database as a CSV file
|
||||||
|
* Quick Edit function allows for real-time updates to the location database
|
||||||
|
* Make certain locations stand out with a customizable tag (Most Popular, Ten-Year Member, etc.)
|
||||||
|
* Easy-to-use settings page means you don't need to know any code to customize your map
|
||||||
|
|
||||||
|
See the screenshots for examples of the plugin in action.
|
||||||
|
|
||||||
|
With SimpleMap, you can easily put a store locator on your WordPress site in seconds. Its intuitive interface makes it the easiest plugin of its kind to use, and the clean design means you'll have a classy store locator that fits in perfectly with any WordPress theme.
|
||||||
|
|
||||||
|
== Installation ==
|
||||||
|
|
||||||
|
1. Upload the entire `simplemap` folder to your `/wp-content/plugins/` folder.
|
||||||
|
2. Go to the 'Plugins' page in the menu and activate the plugin.
|
||||||
|
3. Type `[simplemap]` into any Post or Page you want SimpleMap to be displayed in.
|
||||||
|
4. Enter some locations in the database and start enjoying the plugin!
|
||||||
|
|
||||||
|
== Screenshots ==
|
||||||
|
|
||||||
|
1. Example of the map and results
|
||||||
|
2. Location with an image tag in the description
|
||||||
|
3. Location with HTML formatting in the description
|
||||||
|
4. General Options page
|
||||||
|
5. Managing the database
|
||||||
|
|
||||||
|
== Frequently Asked Questions ==
|
||||||
|
|
||||||
|
= What are the minimum requirements for SimpleMap? =
|
||||||
|
|
||||||
|
You must have:
|
||||||
|
|
||||||
|
* WordPress 2.8 or later
|
||||||
|
* PHP 5 (or PHP 4 with the SimpleXML extension loaded), DOMDocument class
|
||||||
|
|
||||||
|
= How do I put SimpleMap on my website? =
|
||||||
|
|
||||||
|
Simply insert the following shortcode into any page or post: `[simplemap]`
|
||||||
|
|
||||||
|
= I've put in the shortcode, but my map isn't showing up. Why? =
|
||||||
|
|
||||||
|
If the search form is showing up, but the map is blank, it's probably a Javascript error. Check to see if any other plugins are throwing Javascript errors before the SimpleMap Javascript gets loaded.
|
||||||
|
|
||||||
|
= What is the "Special Location Label"? =
|
||||||
|
|
||||||
|
This is meant to flag certain locations with a specific label. It shows up in the search results with a gold star next to it. Originally this was developed for an organization that wanted to highlight people that had been members for more than ten years. It could be used for something like that, or for "Favorite Spots," or "Free Wi-Fi," or anything you want. You can also leave it blank to disable it.
|
||||||
|
|
||||||
|
= Why can't my map load more than 100 search results at a time? =
|
||||||
|
|
||||||
|
On most browsers, loading more than 100 locations at once will really slow things down. In some cases, such as a slower internet connection, it can crash the browser completely. I put that limit on there to prevent that from happening.
|
||||||
|
|
||||||
|
= Can I suggest a feature for SimpleMap? =
|
||||||
|
|
||||||
|
Of course! Visit [the SimpleMap home page](http://simplemap-plugin.com/) to do so.
|
||||||
|
|
||||||
|
= What if I have a problem with SimpleMap, or find a bug? =
|
||||||
|
|
||||||
|
Please visit [the SimpleMap forums at WordPress.org](http://wordpress.org/tags/simplemap?forum_id=10) if you have a bug to report. Otherwise, you may access premium support inside the plugin dashboard.
|
||||||
|
|
||||||
|
== Changelog ==
|
||||||
|
|
||||||
|
= 2.4.6 =
|
||||||
|
* Bugfix release for Google API changes
|
||||||
|
* Fixed display of marker bubble
|
||||||
|
|
||||||
|
= 2.4.5 =
|
||||||
|
* Compatibility fixes for WordPress 3.5
|
||||||
|
= 2.4.4 =
|
||||||
|
* Added filters to menu item permissions
|
||||||
|
* Don't display map updating image if map is hidden
|
||||||
|
* Show error if over Google API limit
|
||||||
|
* Added ability to to show description in search results with a filter
|
||||||
|
* Fixed typo with call to wp_get_current_user
|
||||||
|
* Fixed bug that prevented locations less than 1KM from being returned
|
||||||
|
* Passing current WordPress post/page ID to search script
|
||||||
|
* Fixed bug that created memory errors when large amount of locations were deleted at once
|
||||||
|
* Fixed bug that created memory errors on medium size DBs during export. Still need to refactor for large exports
|
||||||
|
* Change locations from hierarchical to non-hierarchical to avoid poor WP query
|
||||||
|
* Fixed error that prevented permalink map from rendering in IE
|
||||||
|
|
||||||
|
= 2.4.3 =
|
||||||
|
* Added filter to allow devs to remove loading image
|
||||||
|
* Added filter to allow devs to change sort order
|
||||||
|
* Added language options for Google Maps API call to allow for additional localization
|
||||||
|
* Changed the name of the CSV class to prevent conflicts with other plugins
|
||||||
|
* Removed some random characters appearing in location pages
|
||||||
|
* Change HTTP/1.1 200 OK header to Status: 200 OK', false, 200
|
||||||
|
* Added ability to hide bubble description with filter
|
||||||
|
* Switch paramater order in call to maps.googleapis.com that was causing errors
|
||||||
|
* Fixed permalink error
|
||||||
|
* Added auto-locate options to experimental features
|
||||||
|
|
||||||
|
= 2.4.2 =
|
||||||
|
* Changed XML in search class to json
|
||||||
|
* Fix broken taxonomy filters
|
||||||
|
* Fix error caused when deleting locations where no categories exist
|
||||||
|
* Changed query params to get directions links to reflect Googles changes
|
||||||
|
* Fixed display bug associated with "Now Loading" image when small maps are used.
|
||||||
|
* Forced 200 status in header of xml-search.php script
|
||||||
|
|
||||||
|
= 2.4.1 =
|
||||||
|
* Revamped the way we pass locaitonData and searchData back and forth between JS functions (placed in objects)
|
||||||
|
* Made custom JS function for Custom Markers future proof (this is not backwards compatible but will be from here out)
|
||||||
|
* Fixed errors in options-general.php
|
||||||
|
* Fixed bad tabbing that snuck into the code
|
||||||
|
* Fixed autoload bug introduced in 2.4
|
||||||
|
* Fixed taxonomy shortcodes.
|
||||||
|
|
||||||
|
|
||||||
|
= 2.4 =
|
||||||
|
* Added ability to turn on location permalinks
|
||||||
|
* Google Maps API version 3
|
||||||
|
* Streetview
|
||||||
|
* Options to activate permalinks for locations
|
||||||
|
* Foundation for templating system
|
||||||
|
* Added ability to delete all locations but to preserve settings
|
||||||
|
* Added cancel link to second stage of import process
|
||||||
|
* Added code to remove a hook added by the AddThis plugin that breaks results
|
||||||
|
* Added map_type and zoom_level to shortcode options
|
||||||
|
* Relax permissions on SM menu items
|
||||||
|
* Applied label filters for categories in widget (to match search form)
|
||||||
|
* Allow custom taxonomies to be integrated into the SimpleMap API and attached to the sm-location custom post type
|
||||||
|
* Allow for custom taxonomies to be imported and created on the fly
|
||||||
|
* Added ability to span table cells via shortcode
|
||||||
|
* Added markers to titles
|
||||||
|
* Added autoload shortcode
|
||||||
|
* Fixed error where not all categories are imported in some instances
|
||||||
|
* Don’t autozoom search results on initial page load
|
||||||
|
* Changed location of temp XML upload file and added the blog id to file handle for ** * MultiSite configurations
|
||||||
|
* Added missing filters for search form text
|
||||||
|
* Only pass non-empty post_content through 'the_content' filter in case submit button is not included, attached an invisible submit button so that hitting Enter in the address fields still works
|
||||||
|
* Reorganized column counting function and added in safety limitations to avoid all rows from being combined when the column count doesn't exactly match
|
||||||
|
* W3C and performance enhancements
|
||||||
|
* Only save options when they have changed
|
||||||
|
* Fixed the lat / lng and zoom settings on a permalink location map
|
||||||
|
* Fixed error causing 404 for location permalinks after initial activation
|
||||||
|
* Added a pin to indicate search lat/lng location as well as additional pin colors that can be set with a filter
|
||||||
|
* Fixed error message appearing in some instances of deleting locations from General Options screen
|
||||||
|
* Import / Export modification to make sure we convert old CSV values to new ones.
|
||||||
|
* Added region to Google Maps API call to fix default google domain
|
||||||
|
* Added some additional CSS classes to map bubbles and search results divs
|
||||||
|
* Fixed some JS errors that broke search results in some cases
|
||||||
|
* Fixed issue that prevented adsense from showing in some instances
|
||||||
|
* Template class refining
|
||||||
|
* Enabled custom markers for permalink pages
|
||||||
|
* Made taxonomy information available on permalink page
|
||||||
|
* Fix autoload shortcode argument
|
||||||
|
* Added titles to markers
|
||||||
|
* Additional actions, filters, whitespace formatting, and notifications
|
||||||
|
|
||||||
|
= 2.3.4 =
|
||||||
|
* Refactored XML Search query. Very large speed improvments to search
|
||||||
|
* Fixed bug returning false negatives with low limit + taxonomy combo on search
|
||||||
|
* Added South Africa Google domain
|
||||||
|
* Made Google Domains and Country names array filterable
|
||||||
|
* Revamped functions that identify plugin path and plugin URL to work with SSL and non-standard setups
|
||||||
|
* Minor CSS changes
|
||||||
|
* Replace calls to get_option( 'site_url' ) with site_url()
|
||||||
|
* Removed debugging code at top of XML-Search.php that was lowering PHP memory_limit
|
||||||
|
* Fixed limit shortcode so that it works again
|
||||||
|
|
||||||
|
= 2.3.3 =
|
||||||
|
* Add a fallback that geocodes new locations via JS when PHP doesn't work because of 620 status from Google
|
||||||
|
* Added actions to the load_simplemap JS function
|
||||||
|
* Added ability to use a select box for taxonomies in the search form (rather than checkboxes)
|
||||||
|
* Fixed bug that allowed results to show up in search
|
||||||
|
* Fixed bug preventing drag and drop location from updating address in some locations
|
||||||
|
|
||||||
|
= 2.3.2 =
|
||||||
|
* Add a fallback XML generator for servers without DOMDocument Installed
|
||||||
|
* Added ids to search form tr and td elements to allow manipulation via CSS / JS
|
||||||
|
* Refactored parts of XML search script for optimization
|
||||||
|
* More hooks
|
||||||
|
* Forced JS header as 200. Some hosts were reporting status for PHP as JS to be 400.
|
||||||
|
* Added WP_IMPORTING flag while importing locations.
|
||||||
|
* Fixed some HTML Validation issues in the Search form (have one more to root out)
|
||||||
|
|
||||||
|
= 2.3.1 =
|
||||||
|
* Added additional filters to allow modifying search form labels without use of .pot file.
|
||||||
|
* Removed stray testing code in simplemap.php
|
||||||
|
|
||||||
|
= 2.3 =
|
||||||
|
* Revamped the search form making it extremly flexible via shortcode arguments (see KB article on premium support site)
|
||||||
|
* Reformulated the main search query to trim search results to 1/10 the time of that introduced in 2.0 (more work still to be done here)
|
||||||
|
* Added multiple filters that allow for customization of text labels / tabs / visual elements in the map and search results
|
||||||
|
* Added more than a dozen new shortcode arguments for overriding General Settings on a per map instance (see KB article on premium support site)
|
||||||
|
* Added 2 new optional taxonomies (Days and Times)
|
||||||
|
* Added optional ability to add Google Adwords for maps overlay to map
|
||||||
|
* Removed caching system introduced in 2.2.1 as it was failing for large DBs
|
||||||
|
* Fixed country code problem in General Settings
|
||||||
|
* Fixed bug that prevented default zoom level from working
|
||||||
|
* Fixed bug that prevented auto load all locations in some setups
|
||||||
|
* Limited total number of auto load locations. It proved impractical to load them all if you had a large DB
|
||||||
|
* Added instructional descriptions to General Settings that proved confusing to users
|
||||||
|
* Fixed bug preventing radius from working in some setups
|
||||||
|
|
||||||
|
= 2.2.1 =
|
||||||
|
* Added 'Loading' message to map when doing search
|
||||||
|
* Added caching system to speed up repeated searches on systems with large amounts of locations
|
||||||
|
* Added filters to compensate for WP Bug when more than 10k locations exist
|
||||||
|
* Fixed bug that prevented locations from appearing when searched from widget and search form is hidden
|
||||||
|
* Fixed bug that prevented categories and tags from being imported correctly on some systems
|
||||||
|
* Fixed bug that prevented 'No Limit' option for number of results shown to be set.
|
||||||
|
* Fixed autoload bug introduced in 2.2
|
||||||
|
* Fixed bug that prevented changing of Default Country in options
|
||||||
|
|
||||||
|
= 2.2 =
|
||||||
|
* Added ability to customize map markers without hacking plugin files
|
||||||
|
* Added ability to filter locations by meeting day and time
|
||||||
|
* Added search widget
|
||||||
|
* Added shortcode argument for custom search form title
|
||||||
|
* Fixed errors that broke distance reporting
|
||||||
|
* Fixed errors that locked up the edit screen with large number of locations
|
||||||
|
* Fixed error that created bad XML link when no search results were found
|
||||||
|
* Added several warning / error messages to UI
|
||||||
|
* Fixed error that prevented custom style sheets from loading properly
|
||||||
|
|
||||||
|
= 2.1 =
|
||||||
|
* Added shortcode args to hide map
|
||||||
|
* Added shortcode args to hide list of results
|
||||||
|
* Added shortcode args to hide entire search box
|
||||||
|
* Added shortcode args to override default lat / lng for individual maps
|
||||||
|
|
||||||
|
= 2.0 =
|
||||||
|
* First major overhaul since FullThrottle took over development
|
||||||
|
* Custom Post Types and Taxonomies for Locations, Location Categories, and Location Tags.
|
||||||
|
* All scripts and styles are now enqueued to prevent conflicts
|
||||||
|
* Custom MySQL queries have been reduced to 1. The rest have been replaced by WordPress API functions.
|
||||||
|
* Overhauled search form allows more control
|
||||||
|
* Additional shortag attributes allows more search form flexibility
|
||||||
|
* Drag and Drop map available on New / Edit Location screen to fine tune placement of location
|
||||||
|
* Autoload of locations on by default.
|
||||||
|
* Multiple bug fixes covered in switch to custom post types and WordPress DB API (functions and $wpdb)
|
||||||
|
* Several hooks and filters added to code (more to come in the future)
|
||||||
|
* Option added to General Options screen that allows complete deletion of all SimpleMap data
|
||||||
|
* Revamped Import / Export process. Import process now allows fine tuning of column data
|
||||||
|
* Ability to export legacy ( prior to version 2.0 ) data into CSV
|
||||||
|
* Ability to completely remove legacy database tables and data
|
||||||
|
* Ability to create categories / tags on the fly during CSV import
|
||||||
|
|
||||||
|
= 1.2.2 =
|
||||||
|
* Modified URL references to admin pages to fix 'Do not have permissions' errors that occurred in WP 3.0
|
||||||
|
* Modified the way existing form values are populated in the admin pages
|
||||||
|
* Plugin development was taken over by [FullThrottle Development](http://fullthrottledevelopment.com/)
|
||||||
|
|
||||||
|
= 1.2.1 =
|
||||||
|
* Moved SimpleMap out of beta status and into a stable release
|
||||||
|
|
||||||
|
= 1.2b4 =
|
||||||
|
* Cleaned up the scripts loaded in the head section of the page.
|
||||||
|
* Added ability to specify page IDs on which to load the map scripts.
|
||||||
|
* Separated CSS from Javascript in the head section to hopefully make it more compatible with the "Javascript to the Bottom" plugin.
|
||||||
|
|
||||||
|
= 1.2b3 =
|
||||||
|
* Fixed error where database table was not being created on install/activation of plugin
|
||||||
|
* Text search works on name, description, and tags (but not on categories yet - still in progress)
|
||||||
|
* Changing a location's address in Quick Edit forces you to re-geocode before saving the changes
|
||||||
|
* Added ability to specify an address format (order of fields in the City line)
|
||||||
|
* Page now scrolls to map when you click on a location in the results list
|
||||||
|
|
||||||
|
= 1.2b2 =
|
||||||
|
* "Get Directions" link now uses custom Google Maps country domain (as set in General Options)
|
||||||
|
* Added translation support for a few strings that were missing it (including "Fax" and "Tags")
|
||||||
|
* Fixed the bubble-height problem (hopefully for good this time)
|
||||||
|
* Added ability to re-geocode address when changing the database with Quick Edit
|
||||||
|
* Info bubble correctly displays category name instead of ID number
|
||||||
|
* Removed "get computed style" function, which should eliminate that error in any browsers
|
||||||
|
|
||||||
|
= 1.2b1 =
|
||||||
|
* Added tags
|
||||||
|
* Multiple maps (on different posts/pages only)
|
||||||
|
* Maps with specific categories
|
||||||
|
* Searching by name or keyword now searches the Name, Description, Category, and Tags fields
|
||||||
|
* Improved CSV support
|
||||||
|
* Added ability to choose Google Maps domain (.com, .co.uk, etc.)
|
||||||
|
|
||||||
|
= 1.1.4 =
|
||||||
|
* Added Help page to de-clutter the other admin pages, and allow for more thorough explanations of features
|
||||||
|
* Improved CSV import: Now includes an option to quickly import large files if the locations are already geocoded
|
||||||
|
* Improved latitude/longitude handling: The values are now directly editable on the Manage Database page, and any new location (added on the Add Location page OR via CSV import) that has latitude/longitude already set will keep those values intact
|
||||||
|
* Improved Auto-Load: There is now an option to auto-load all locations in the database, and it automatically disables itself if there are more than 100 locations (to prevent crashing browsers)
|
||||||
|
* Improved Auto-Load: There is now an option to lock the auto-load to your default location, instead of the map centering itself on the loaded locations
|
||||||
|
* Improved map display: Numerous CSS fixes added to ensure that map overlays display properly
|
||||||
|
* Improved state/province: Is now a text field instead of a drop-down list, so any value can be entered
|
||||||
|
* Added ability to sort the database by column on the Manage Database page
|
||||||
|
* Added ability to change the number of search results shown (was previously limited to 20)
|
||||||
|
* Fixed bug: Info bubble should now expand properly when a location's name/category takes up more than one line
|
||||||
|
* Added questions to FAQ in Readme file
|
||||||
|
|
||||||
|
= 1.1.3 =
|
||||||
|
* Fixed bug: "Get Directions" link in location's info bubble no longer inserts "null" in the destination address
|
||||||
|
* Fixed bug: Single quotes in a location's name and address are no longer preceded by a backslash in the results display
|
||||||
|
|
||||||
|
= 1.1.2 =
|
||||||
|
* Fixed bug: Javascript code was breaking map functionality and the Geocode Address button in the General Options (Internet Explorer/Firefox only)
|
||||||
|
|
||||||
|
= 1.1.1 =
|
||||||
|
* Support for Cyrillic characters
|
||||||
|
* Autoloading locations now respects the default zoom level set in General Options
|
||||||
|
* Link to sign up for Google Maps API key will link to a translated signup page (English, Spanish, German, Japanese, Korean, Portugese, Russian, and Chinese)
|
||||||
|
* Fixed bug causing error when adding a location before any categories had been created
|
||||||
|
* Fixed bug causing the default country to reset to "United States"
|
||||||
|
* Fixed bug regarding duplicate function names; all function names are now unique to the plugin
|
||||||
|
|
||||||
|
= 1.1 =
|
||||||
|
* New Feature: Support for international locations
|
||||||
|
* New Feature: HTML descriptions for locations
|
||||||
|
* New Feature: Custom categories for locations
|
||||||
|
* New Feature: Choose to show or hide the search box with the map
|
||||||
|
* New Feature: Geocode your default location right in the Admin section
|
||||||
|
* Simplified Autoload feature: automatically loads at the default location
|
||||||
|
* Improved Admin interface
|
||||||
|
* Slightly improved CSV compatibility (in regards to quotation marks)
|
||||||
|
* Fixed bug causing map overlays to display strangely when a background color was applied to images in that WordPress theme
|
||||||
|
|
||||||
|
= 1.0.6 =
|
||||||
|
* Fixed bug that was causing map to always appear at the top of a page or post
|
||||||
|
* Modified CSV importing function to be more flexible about quotation marks
|
||||||
|
* Modified paging in the Manage Database screen to better accomodate a large number of pages
|
||||||
|
* Added button to Manage Database screen to clear entire database
|
||||||
|
* Added German & Spanish translations
|
||||||
|
* Fixed some tiny cosmetic errors
|
||||||
|
* Removed some redundant code in the Manage Database screen
|
||||||
|
|
||||||
|
= 1.0.5 =
|
||||||
|
* Changed required WordPress version to 2.8
|
||||||
|
|
||||||
|
= 1.0.4 =
|
||||||
|
* Added support for localization
|
||||||
|
* Fixed bug causing fatal error when trying to activate the plugin
|
||||||
|
|
||||||
|
= 1.0.3 =
|
||||||
|
* Added optional "Powered by SimpleMap" link to map display
|
||||||
|
|
||||||
|
= 1.0.2 =
|
||||||
|
* Fixed bug that was showing ".svn" in the drop-down list of themes
|
||||||
|
* Added the ability to automatically load the map results from a given location
|
||||||
|
* Added the ability to change the default search radius
|
||||||
|
* Added support for both miles and kilometers
|
||||||
|
* Fixed invalid markup in search form
|
||||||
|
* Fixed invalid markup in Google Maps script call
|
||||||
|
* Fixed bug appearing on certain servers when trying to access remote file created by Google Maps
|
||||||
|
|
||||||
|
= 1.0.1 =
|
||||||
|
* Fixed a folder structure problem where an auto-install from within WordPress would give a missing header error.
|
||||||
|
|
||||||
|
= 1.0 =
|
||||||
|
* Initial release
|
||||||
|
|
||||||
|
== Making Your Own Theme ==
|
||||||
|
|
||||||
|
To upload your own SimpleMap theme, make a directory in your `plugins` folder called `simplemap-styles`. Upload your theme's CSS file here.
|
||||||
|
|
||||||
|
To give it a name that shows up in the **Theme** drop-down menu (instead of the filename), use the following markup at the beginning of the CSS file:
|
||||||
|
|
||||||
|
`/*
|
||||||
|
Theme Name: YOUR THEME NAME HERE
|
||||||
|
*/`
|
||||||
|
|
||||||
|
== Other Notes ==
|
||||||
|
|
||||||
|
Planned for future releases:
|
||||||
|
|
||||||
|
* UI for custom markers
|
||||||
|
* Show map of single location
|
||||||
|
* Search by Day / Time (great for groups)
|
||||||
|
* Search by Date (great for traveling gigs / performances)
|
||||||
|
|
||||||
|
To suggest any new features, please visit [the SimpleMap home page](http://simplemap-plugin.com/) and leave a comment.
|
||||||
|
|
||||||
|
== Credits ==
|
||||||
|
|
||||||
|
= Code and Inspiration =
|
||||||
|
|
||||||
|
* [Alison Barrett](http://alisothegeek.com/) Original developer and maintainer until June, 2010.
|
||||||
|
|
||||||
|
= Translations =
|
||||||
|
|
||||||
|
* German: Thorsten at [.numinose](http://www.numinose.com)
|
||||||
|
* Spanish: Fernando at [Dixit](http://www.dixit.es)
|
||||||
|
* Portugese (Brazil): Rodolfo Rodrigues at [ChEngineer Place](http://chengineer.com/)
|
||||||
|
* Dutch: Jan-Albert Droppers at [Droppers.NL](http://droppers.nl)
|
||||||
|
|
||||||
|
If you want to help with any translation for this plugin, please don't hesitate to contact us. Any help translating is greatly appreciated! The updated `.POT` file is always included in every release, in the `lang` folder.
|
||||||
|
|
||||||
|
== License ==
|
||||||
|
|
||||||
|
SimpleMap - the easy store locator for WordPress.
|
||||||
|
Copyright (C) 2010 FullThrottle Development, LLC.
|
||||||
|
|
||||||
|
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/>.
|
BIN
screenshot-1.png
Normal file
After Width: | Height: | Size: 177 KiB |
BIN
screenshot-2.png
Normal file
After Width: | Height: | Size: 125 KiB |
BIN
screenshot-3.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
screenshot-4.png
Normal file
After Width: | Height: | Size: 211 KiB |
BIN
screenshot-5.png
Normal file
After Width: | Height: | Size: 102 KiB |
153
simplemap.php
Normal file
|
@ -0,0 +1,153 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Plugin Name: SimpleMap
|
||||||
|
Version: 2.4.6
|
||||||
|
Plugin URI: http://simplemap-plugin.com/
|
||||||
|
Author: Michael Torbert
|
||||||
|
Author URI: http://fullthrottledevelopment.com/
|
||||||
|
Description: An easy-to-use international store locator plugin that uses Google Maps to display information directly on your WordPress site.
|
||||||
|
|
||||||
|
This plugin was originally created by Alison Barrett (http://alisothegeek.com/). FullThrottle took over development at v 1.2.3
|
||||||
|
*/
|
||||||
|
|
||||||
|
global $wp_version, $wpdb;
|
||||||
|
|
||||||
|
$exit_msg = __( 'SimpleMap requires WordPress 2.8 or newer. <a href="http://codex.wordpress.org/Upgrading_WordPress">Please update!</a>', 'SimpleMap' );
|
||||||
|
if ( version_compare( $wp_version, "2.8", "<" ) )
|
||||||
|
exit( $exit_msg );
|
||||||
|
|
||||||
|
#### CONSTANTS ####
|
||||||
|
|
||||||
|
// Plugin Version Number
|
||||||
|
define( 'SIMPLEMAP_VERSION', '2.4.6' );
|
||||||
|
|
||||||
|
if ( !defined( 'WP_PLUGIN_DIR' ) ) {
|
||||||
|
define( 'WP_PLUGIN_DIR', ABSPATH . 'wp-content/plugins' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// If this file is in the plugin directory, proceed as normal.
|
||||||
|
if ( strpos( __FILE__, WP_PLUGIN_DIR ) === 0 ) {
|
||||||
|
$simplemap_file = plugin_basename( __FILE__ );
|
||||||
|
} else {
|
||||||
|
// This file is most likely marked as an active plugin, so let's find it that way.
|
||||||
|
$simplemap_plugins = preg_grep( '#/' . basename( __FILE__ ) . '$#', get_option( 'active_plugins', array() ) );
|
||||||
|
if ( !empty( $simplemap_plugins ) ) {
|
||||||
|
$simplemap_file = current( $simplemap_plugins );
|
||||||
|
} else {
|
||||||
|
// Last ditch effort to find the 'good' filename.
|
||||||
|
$simplemap_file = plugin_basename( $plugin ? $plugin : ( $mu_plugin ? $mu_plugin : ( $network_plugin ? $network_plugin : __FILE__ ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$simplemap_dir = dirname( $simplemap_file );
|
||||||
|
|
||||||
|
// Define plugin file
|
||||||
|
define( 'SIMPLEMAP_FILE', $simplemap_file );
|
||||||
|
|
||||||
|
// Define plugin path
|
||||||
|
define( 'SIMPLEMAP_PATH', WP_PLUGIN_DIR . '/' . $simplemap_dir );
|
||||||
|
|
||||||
|
// Define plugin URL
|
||||||
|
define( 'SIMPLEMAP_URL', plugins_url() . '/' . $simplemap_dir );
|
||||||
|
|
||||||
|
// Table Names
|
||||||
|
if ( !defined( 'SIMPLEMAP_TABLE' ) )
|
||||||
|
define( 'SIMPLEMAP_TABLE', $wpdb->prefix . 'simple_map' );
|
||||||
|
|
||||||
|
if ( !defined( 'SIMPLEMAP_CAT_TABLE' ) )
|
||||||
|
define( 'SIMPLEMAP_CAT_TABLE', $wpdb->prefix . 'simple_map_cats' );
|
||||||
|
|
||||||
|
// Map HOST
|
||||||
|
if ( !defined( 'SIMPLEMAP_MAPS_JS_API' ) ) {
|
||||||
|
// TODO: Evaluate removing scheme check as scheme-less urls can be enqueued in 3.3 (WP #16560)
|
||||||
|
$scheme = 'http:';
|
||||||
|
if ( !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) {
|
||||||
|
$scheme = 'https:';
|
||||||
|
}
|
||||||
|
|
||||||
|
define( 'SIMPLEMAP_MAPS_WS_API', $scheme . '//maps.googleapis.com/maps/api/' );
|
||||||
|
define( 'SIMPLEMAP_MAPS_JS_API', SIMPLEMAP_MAPS_WS_API . 'js?' );
|
||||||
|
}
|
||||||
|
|
||||||
|
#### INCLUDES ####
|
||||||
|
|
||||||
|
include_once( 'classes/simplemap.php' );
|
||||||
|
include_once( 'classes/widgets.php' );
|
||||||
|
include_once( 'classes/locations.php' );
|
||||||
|
|
||||||
|
// Check to make sure another plugin hasn't already loaded the client before including
|
||||||
|
if ( ! class_exists( 'FT_Premium_Support_Client' ) )
|
||||||
|
include_once( 'classes/ft-ps-client.php' );
|
||||||
|
|
||||||
|
#### FIRE IN THE HOLE! ####
|
||||||
|
|
||||||
|
// Init SimpleMap class
|
||||||
|
if ( class_exists( 'Simple_Map' ) && ( ! isset( $simple_map ) ) )
|
||||||
|
$simple_map = $SimpleMap = new Simple_Map();
|
||||||
|
|
||||||
|
// Register Location post types and custom taxonomies
|
||||||
|
if ( class_exists( 'SM_Locations' ) && ( ! isset( $sm_locations ) || ! is_object( $sm_locations ) ) )
|
||||||
|
$sm_locations = new SM_Locations();
|
||||||
|
|
||||||
|
if ( is_admin() ) {
|
||||||
|
register_activation_hook( SIMPLEMAP_FILE, array( 'SM_Admin', 'on_activate' ) );
|
||||||
|
|
||||||
|
include_once( 'classes/admin.php' );
|
||||||
|
include_once( 'classes/options-general.php' );
|
||||||
|
include_once( 'classes/import-export.php' );
|
||||||
|
include_once( 'classes/help.php' );
|
||||||
|
|
||||||
|
// Register General Options adminpages
|
||||||
|
if ( class_exists( 'SM_Options' ) && ( ! isset( $sm_options ) || ! is_object( $sm_options ) ) )
|
||||||
|
$sm_options = new SM_Options();
|
||||||
|
|
||||||
|
// Register Import / Export adminpages
|
||||||
|
if ( class_exists( 'SM_Import_Export' ) && ( ! isset( $sm_import_export ) || ! is_object( $sm_import_export ) ) )
|
||||||
|
$sm_import_export = new SM_Import_Export();
|
||||||
|
|
||||||
|
// Register Help adminpages
|
||||||
|
if ( class_exists( 'SM_Help' ) && ( ! isset( $sm_help ) || ! is_object( $sm_help ) ) )
|
||||||
|
$sm_help = new SM_Help();
|
||||||
|
} else {
|
||||||
|
include_once( 'classes/xml-search.php' );
|
||||||
|
include_once( 'classes/shortcodes.php' );
|
||||||
|
include_once( 'classes/maps.php' );
|
||||||
|
include_once( 'classes/templates.php' );
|
||||||
|
|
||||||
|
// Init XML Search class
|
||||||
|
if ( class_exists( 'SM_XML_Search' ) && ( ! isset( $sm_xml_search ) ) )
|
||||||
|
$sm_xml_search = new SM_XML_Search();
|
||||||
|
|
||||||
|
// Init the shortcode class
|
||||||
|
if ( class_exists( 'SM_Location_Shortcodes' ) && ! isset( $sm_location_shortcodes ) )
|
||||||
|
$sm_location_shortcodes = new SM_Location_Shortcodes();
|
||||||
|
|
||||||
|
// Init the maps class
|
||||||
|
if ( class_exists( 'SM_Map_Factory' ) && ! isset( $sm_map_factory ) )
|
||||||
|
$sm_map_factory = new SM_Map_Factory();
|
||||||
|
|
||||||
|
// Init the templating system for single locations
|
||||||
|
if ( class_exists( 'SM_Template_Factory' ) && ! isset( $sm_template_factory ) )
|
||||||
|
add_action( 'template_redirect', 'sm_init_templating' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function sm_init_templating() {
|
||||||
|
$sm_location_master = new SM_Template_Factory();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build admin pages and shuffle menu to merge WP UI for custom posts with our custom pages
|
||||||
|
if ( class_exists( 'SM_Admin' ) && ( ! isset( $sm_admin ) || ! is_object( $sm_admin ) ) )
|
||||||
|
$sm_admin = new SM_Admin();
|
||||||
|
|
||||||
|
// Premium Support Client for SimpleMap
|
||||||
|
$config = array(
|
||||||
|
'server_url' => 'http://simplemap-plugin.com',
|
||||||
|
'product_id' => 1,
|
||||||
|
'product-slug' => 'sm-premium',
|
||||||
|
'plugin_support_page_ids' => array( 'simplemap_page_simplemap-help', 'toplevel_page_simplemap', 'simplemap_page_simplemap-import-export', 'sm-location' ),
|
||||||
|
'plugin_basename' => plugin_basename( SIMPLEMAP_PATH . '/simplemap.php' ),
|
||||||
|
'plugin_slug' => 'simplemap',
|
||||||
|
'learn_more_link' => 'http://simplemap-plugin.com/premium-support/'
|
||||||
|
);
|
||||||
|
if ( class_exists( 'FT_Premium_Support_Client' ) && ( ! isset( $simplemap_ps ) || ! is_object( $simplemap_ps ) ) )
|
||||||
|
$simplemap_ps = new FT_Premium_Support_Client( $config );
|
||||||
|
?>
|