commit 96d893fd58a65833301de042258bedaa273d21e3 Author: Will Bradley Date: Tue Feb 18 19:11:50 2014 -0700 Initial Commit diff --git a/GNU-GPL.txt b/GNU-GPL.txt new file mode 100644 index 0000000..20d40b6 --- /dev/null +++ b/GNU-GPL.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. \ No newline at end of file diff --git a/classes/admin.php b/classes/admin.php new file mode 100644 index 0000000..1027ec1 --- /dev/null +++ b/classes/admin.php @@ -0,0 +1,124 @@ +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 ) : + ?> + + 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 ); + } + } + } +} +?> diff --git a/classes/ft-ps-client.php b/classes/ft-ps-client.php new file mode 100644 index 0000000..074f9dc --- /dev/null +++ b/classes/ft-ps-client.php @@ -0,0 +1,827 @@ +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 "
" . sprintf( __( "Your license for SimpleMap has expired!
You need to renew your license now for continued support and upgrades: Renew my license now." ), $link ) . "
"; + } + + function renew_soon() { + $link = ( $this->paypal_button ) ? esc_url( $this->paypal_button ) : 'http://simplemap-plugin.com'; + echo "
" . sprintf( __( "SimpleMap is expiring soon!
You will need to renew your license for continued support and upgrades: Renew my license now." ), $link ) . "
"; + } + + } + +} + +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( '%s', $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; +} + +?> diff --git a/classes/help.php b/classes/help.php new file mode 100644 index 0000000..90c4818 --- /dev/null +++ b/classes/help.php @@ -0,0 +1,250 @@ +get_options(); + + extract( $options ); + + ?> +
+ + show_toolbar( $sm_page_title ); + ?> + +

| | |

+ +
+ +
+ +
+ +
+ + +
+ +

+ +
+ +
+ + + + + +
+
+ +
+ +
+
+ + + + +
+ +

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
[simplemap]
[simplemap categories=2,5,14 tags=3,6,15]
[simplemap show_categories_filter=false show_tags_filter=false]
[simplemap hide_map=true]
[simplemap hide_list=true]
[simplemap default_lat='34.1346702' default_lng='-118.4389877']
[simplemap categories=2,5,14 show_tags_filter=false]
', '' ); ?>
+
+ +
+ +
+
+ + + + +
+ +

+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ ', ''); ?>
+ ', '' ); ?>
+ ', '', '', '' ); ?>

+ + +
+
+ +
+ +
+
+ + + + +
+ +

+ +
+ +
+ + + + + + +
+
+
+
+ +
+ +
+
+ +
+ +
+
+ + + + +
+ +
+ +
+ +
+ + + + + +
+ +

+ +
+ + + +

+

+ +

+

+ +

+ +
    +
  • +
  • +
  • +
  • +
+ +
    +
  • +
  • +
+ + +

%s was purchased on %s by %s (%s). It will remain valid for this URL until %s.", 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 ) ) ); ?>

+

|

+ + + + + +
+
+ + + +
+
+ +
+ +
+
+
+
+ diff --git a/classes/import-export.php b/classes/import-export.php new file mode 100644 index 0000000..6c854b7 --- /dev/null +++ b/classes/import-export.php @@ -0,0 +1,803 @@ + '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'] ) { + ?> +
+ + show_toolbar( $sm_page_title ); + ?> + +
+ +
+ +
+ +
+ +
+ +

+ +
+ + auto( $file_location ); + + if ( isset( $csv->data ) ) { + echo '
    '; + + /* 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 "
  1. " . sprintf( esc_attr( $to_insert['name'] ) . __( ' was successfully %simported', 'SimpleMap' ), $geocoded ) . "
  2. "; + } else { + echo "
  3. " . esc_attr( $to_insert['name'] ) . __( ' failed to import properly', 'SimpleMap' ) . "
  4. "; + } + + unset( $to_insert ); + unset( $geocoded ); + } + } + + echo ""; + echo "

    " . sprintf( __( 'View them here', 'SimpleMap' ), admin_url( 'edit.php?post_type=sm-location' ) ) . "

    "; + } + + // Import is finished, delete csv and redirect to edit locaitons page + if ( file_exists( $file_location ) ) { + unlink( $file_location ); + } + } + ?> +
+
+
+
+
+ get_options(); + + /* + if ( !isset( $options['api_key'] ) ) + $options['api_key'] = ''; + */ + + extract( $options ); + + ?> +
+ + show_toolbar( $sm_page_title ); + ?> + +
+ +
+ +
+ +
+ +
+ +

+ +
+ +

', '' );?>

+ + +
+ + +

|

+ + + get_location_data_types( current($csv->data) ); + foreach( $csv->titles as $col => $title ) { + echo ""; + } + ?> + + + data ); + if ( $row_count < 50 ) { + foreach( $csv->data as $csv_row => $csv_row_data ) { + ?> $tdv ) { + ?>data[$numb] as $td => $tdv ) { + ?> +
" . $this->column_select( $col, $title ) . "
+ writable by WordPress: %s', 'http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress', '' . WP_PLUGIN_DIR . '' ), 'SimpleMap' ); + } + ?> + +
+ +
+ +
+ +
+ +
+ +
+ "; + + $select .= ""; + + + foreach( $this->get_location_data_types() as $type => $label ) { + $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 ); + + + ?> +
+ + show_toolbar( $sm_page_title ); + + // Messages + if ( isset( $_GET['sm-msg'] ) && '2' == $_GET['sm-msg'] ) + echo '

'.__('Legacy SimpleMap settings deleted.', 'SimpleMap').'

'; + + if ( isset( $_GET['sm-msg'] ) && '3' == $_GET['sm-msg'] ) + echo '

'.__('Legacy SimpleMap NOT settings deleted.', 'SimpleMap').'

'; + ?> + +
+ +
+ +
+ +
+ +
+ +

+ +
+ +

+ +

+ +

+ +

+ +

+ +

+ +
    +
  • +
  • +
+ +

', ''); ?>

+ +

+ +
+ + + +

+
+ + " . __( sprintf( 'Please make the following directory writable by WordPress: %s', 'http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress', '' . WP_PLUGIN_DIR . '' ), 'SimpleMap' ); + ?> + +

+ + + API key if you need your locaitons geocoded.", 'SimpleMap' ), admin_url( "admin.php?page=simplemap" ) ); ?> + +
+ +

+
+ +
+
+ + + +
+ +

+ +
+ +
+ + + + +
+
+ +
+
+ + + +
+
+ +
+ +
+ + + + + +
+ +

+ +
+ + + +

+

+ +

+

+ +

+ +
    +
  • +
  • +
  • +
  • +
+ +
    +
  • +
  • +
+ + +

%s was purchased on %s by %s (%s). It will remain valid for this URL until %s.", 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 ) ) ); ?>

+

|

+ + + + + +
+
+ + legacy_tables_exist() ) : ?> + +
+ +

+ +
+

+ +
    +
  • '>
  • + +
  • +
+
+
+ + + + + +
+ +
+ +
+
+
+
+ diff --git a/classes/locations.php b/classes/locations.php new file mode 100644 index 0000000..c41a933 --- /dev/null +++ b/classes/locations.php @@ -0,0 +1,749 @@ +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 "
";print_r( $simplemap_ps );echo "
"; + if ( ! url_has_ftps_for_item( $simplemap_ps ) ) : + + ?> +

+ +

+ +
    +
  • +
  • +
  • +
  • +
+ +
    +
  • +
  • +
+ + +

+
    +
  • +
  • + + + 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 ) : ''; + + ?> +

    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    + +
    +
    +
    +
    + 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 ) : ''; + ?> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    http://', 'SimpleMap'); ?>
    />
    + +
    + +
    + + 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 ) : ''; + + ?> +

    Drag the marker to fine tune your location's placement on the map

    +
    + 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( , ); + var myOptions = { + 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(); + + + jQuery( '#js-geo-encode-msg' ).removeClass( 'hidden' ); + + // Do geocode + var geo_address = ''; + 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: , + 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( ); + 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); + } + }); + + + } + + 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 ); + } + 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() { + ?> +

    Warning: You have more than 10,000 locations in your database. We have limited the list here to 1,000. You may use the search field to access locations beyond the first 1,000.', 'SimpleMap' ); ?>

    + 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 = ""; + + 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' ); + + + } + + } +} +?> diff --git a/classes/maps.php b/classes/maps.php new file mode 100644 index 0000000..20c937c --- /dev/null +++ b/classes/maps.php @@ -0,0 +1,279 @@ +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 = ''; + + 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'); + ?> + + + + + + + + + + +
    + + + + '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 ); + ?> +
    + + show_toolbar( $sm_page_title ); + + // Messages + if ( isset( $_GET['sm-msg'] ) && '1' == $_GET['sm-msg'] ) + echo '

    '.__('SimpleMap settings saved.', 'SimpleMap').'

    '; + + ?> + +
    + +
    + + + + + + +
    + + + +
    + +
    + + + +
    + +

    + +
    +

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + + + + + +
    + +
    + +

    +

    +

    +
    + +
    +
    + + + +
    + +

    + +
    +

    ', ' ' ); ?>

    + +
    + + + + + + */ ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + get_api_link() . '">', ''); ?> +
    + +
    + + + +

    + type="text" name="default_address" id="default_address" size="30" value="" />  onclick="codeAddress();return false;" href="#"> +
    +

    +
    + +
    + +
    +
    + +
    + +
    + ', '', '
    ', '', '', '
    ', '', '' ) ); ?>
    + ' . $disabledmsg . ''; } ?> + + +
    +
    + +
    + +
    +
    + +
    + +
    + +

    +

    +

    +
    + +
    +
    + + +
    + +

    + +
    +

    ', ' ' ); ?>

    + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + 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 ''; + echo '
    '; + if ( $active && !isset( $standard_taxonomies[$taxonomy] ) ) { + echo '
    '; + echo ''; + echo '
    '; + echo ''; + echo '
    '; + echo '
    '; + } + } + ?> +
    + +
    +
    +
    +
    +
    + +
    + +
    + +

    +

    +

    + +
    + +
    +
    + + + + +
    +
    + +
    + +
    + + + + + + +
    + +

    + +
    + + + +

    +

    + +

    +

    + +

    + +
      +
    • +
    • +
    • +
    • +
    + +
      +
    • +
    • +
    + + +

    %s was purchased on %s by %s (%s). It will remain valid for this URL until %s.", 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 ) ) ); ?>

    +

    |

    + + + + + +
    +
    + + + + +
    + +

    + +
    +

    [simplemap]' ); ?>

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + 100%', '500px' ); ?> +
    +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    +
    +
    + ', '' ); ?>
    +
    + /*
    Theme Name: THEME_NAME_HERE
    */
    +
    + +
    + + +    +
    +
    + + + +
    +
    + +

    +    +

    +
    + +
    +
    + +
    + +

    + +
    +

    +

    +

    +
    +
    + + + +
    +
    + + + +
    +
    + +

    Donate via PayPal

    + +
    +
    +
    +
    + diff --git a/classes/parsecsv.lib.php b/classes/parsecsv.lib.php new file mode 100644 index 0000000..dc74e4d --- /dev/null +++ b/classes/parsecsv.lib.php @@ -0,0 +1,695 @@ +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 ) ? "".$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; + } + +} + +?> diff --git a/classes/shortcodes.php b/classes/shortcodes.php new file mode 100644 index 0000000..e5df40b --- /dev/null +++ b/classes/shortcodes.php @@ -0,0 +1,254 @@ +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; + + } + + } + +} diff --git a/classes/simplemap.php b/classes/simplemap.php new file mode 100644 index 0000000..c49818b --- /dev/null +++ b/classes/simplemap.php @@ -0,0 +1,2369 @@ +plugin_domain, 'wp-content/plugins/' . $plugin_dir . '/lang', $plugin_dir . '/lang' ); + + $this->plugin_url = SIMPLEMAP_URL; + + // Add shortcode handler + add_shortcode( 'simplemap', array( &$this, 'display_map' ) ); + + // Enqueue frontend scripts & styles into + add_action( 'template_redirect', array( &$this, 'enqueue_frontend_scripts_styles' ) ); + + // Enqueue backend scripts + add_action( 'init', array( &$this, 'enqueue_backend_scripts_styles' ) ); + + // Add hook for master js file + add_action( 'template_redirect', array( &$this, 'google_map_js_script' ) ); + + // Add hook for general options js file + add_action( 'init', array( &$this, 'general_options_js_script' ) ); + + // Query vars + add_filter( 'query_vars', array( &$this, 'register_query_vars' ) ); + + // Backwards compat for core sm taxonomies + add_filter( 'sm_category-text', array( &$this, 'backwards_compat_categories_text' ) ); + add_filter( 'sm_tag-text', array( &$this, 'backwards_compat_tags_text' ) ); + add_filter( 'sm_day-text', array( &$this, 'backwards_compat_days_text' ) ); + add_filter( 'sm_time-text', array( &$this, 'backwards_compat_times_text' ) ); + + } + + // This function generates the code to display the map + function display_map( $atts ) { + + $options = $this->get_options(); + + $atts = $this->parse_shortcode_atts( $atts ); + + extract( $atts ); + + $to_display = ''; + + $to_display .= $this->location_search_form( $atts ); + + if ( $powered_by ) + $to_display .= '
    ' . sprintf( __( 'Powered by %s SimpleMap', 'SimpleMap' ), '' ) . '
    '; + + // Hide map? + $hidemap = ( $hide_map ) ? "display:none; " : ''; + + // Hide list? + $hidelist = $hide_list ? "display:none; " : ''; + + // Map Width and height + $map_width = ( '' == $map_width ) ? $options['map_width'] : $map_width; + $map_height = ( '' == $map_height ) ? $options['map_height'] : $map_height; + + // Updating Div + $sm_updating_img_src = apply_filters( 'sm_updating_img_src', SIMPLEMAP_URL . '/inc/images/loading.gif' ); + $sm_updating_div_size = apply_filters( 'sm_updating_img_size', 'height:' . $map_height . ';width:' . $map_width . ';' ); + $to_display .= '
    ' . __( 'Loading new locations', 'SimpleMap' ) . '
    '; + + $to_display .= '
    '; + $to_display .= '
    '; + $to_display .= ''; + + return apply_filters( 'sm-display-map', $to_display, $atts ); + } + + // This function returns the location search form + function location_search_form( $atts ) { + global $post; + + // Grab default SimpleMap options + $options = $this->get_options(); + + // Merge default simplemap options with default shortcode options and provided shortcode options + $atts = $this->parse_shortcode_atts( $atts ); + + // Create individual vars for each att + extract( $atts ); + + // Array of the names for all taxonomies registered with sm-location post type + $sm_tax_names = get_object_taxonomies( 'sm-location' ); + + // Array of field names for this form (with label syntax stripped + $form_field_names = $this->get_form_field_names_from_shortcode_atts( $search_fields ); + + // Form onsubmit, action, and method values + $on_submit = apply_filters( 'sm-location-search-onsubmit', ' onsubmit="searchLocations( 1 ); return false; "', $post->ID ); + $action = apply_filters( 'sm-locaiton-search-action', get_permalink(), $post->ID ); + $method = apply_filters( 'sm-location-search-method', 'post', $post->ID ); + + // Form Field Values + $address_value = get_query_var( '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 = get_query_var( 'location_search_zip' ); + $country_value = get_query_var( 'location_search_country' ); + $radius_value = isset( $_REQUEST['location_search_distance'] ) ? $_REQUEST['location_search_distance'] : $radius; + $limit_value = isset( $_REQUEST['location_search_limit'] ) ? $_REQUEST['location_search_limit'] : $limit; + $is_sm_search = isset( $_REQUEST['location_is_search_results'] ) ? 1 : 0; + + // Normal Field inputs + $ffi['street'] = array( 'label' => apply_filters( 'sm-search-label-street', __( 'Street: ', 'SimpleMap' ), $post ), 'input' => '' ); + $ffi['city'] = array( 'label' => apply_filters( 'sm-search-label-city', __( 'City: ', 'SimpleMap' ), $post ), 'input' => '' ); + $ffi['state'] = array( 'label' => apply_filters( 'sm-search-label-state', __( 'State: ', 'SimpleMap' ), $post ), 'input' => '' ); + $ffi['zip'] = array( 'label' => apply_filters( 'sm-search-label-zip', __( 'Zip: ', 'SimpleMap' ), $post ), 'input' => '' ); + $ffi['country'] = array( 'label' => apply_filters( 'sm-search-label-country', __( 'Country: ', 'SimpleMap' ), $post ), 'input' => '' ); + $ffi['empty'] = array( 'label' => '', 'input' => '' ); + $ffi['submit'] = array( 'label' => '', 'input' => '' ); + $ffi['distance'] = $this->add_distance_field( $radius_value, $units ); + + $hidden_fields = array(); + + // Visible Taxonomy Field Inputs + foreach ( $sm_tax_names as $tax_name ) { + if ( in_array( $tax_name, $form_field_names ) && $this->show_taxonomy_filter( $atts, $tax_name ) ) + $ffi[$tax_name] = $this->add_taxonomy_fields( $atts, $tax_name ); + else + $hidden_fields[] = ''; + } + + // More Taxonomy Fields + foreach ( $sm_tax_names as $tax_name ) { + $hidden_fields[] = ''; + } + + // Hide search? + $hidesearch = $hide_search ? " style='display:none;' " : ''; + + $location_search = ''; // close map_search div + + return apply_filters( 'sm_location_search_form', $location_search, $atts ); + } + + // Separates form field names from label syntax attached to them when submitted via shortcode + function get_form_field_names_from_shortcode_atts( $fields ) { + + // String to array + $fields = explode( '||', $fields); + + foreach( $fields as $key => $field ) { + + switch( substr( $field, 0, 8 ) ) { + + case 'labelbr_' : + $field_names[] = substr( $field, 8 ); + break; + case 'labelsp_' : + $field_names[] = substr( $field, 8 ); + break; + case 'labeltd_' : + $field_names[] = substr( $field, 8 ); + break; + default : + $field_names[] = $field; + } + + } + + return (array) $field_names; + + } + + // Determines if we're supposed to show this taxonomy's filter options in the form + function show_taxonomy_filter( $atts, $tax_name ) { + + // Convert tax_name to PHP safe equiv + $php_tax_name = str_replace( '-', '_', $tax_name ); + + // Convert Given Taxonomy's 'show filter' into a generic one + $key = 'show_' . $php_tax_name . '_filter'; + $show_taxes_filter = $atts[$key]; + + if ( false != $show_taxes_filter && 'false' != $show_taxes_filter ) + return true; + + return false; + + } + + // Adds Distance field to form + function add_distance_field( $radius_value, $units ) { + global $post; + + // Distance + $distance_input = ''; + + return array( 'label' => apply_filters( 'sm-search-label-distance', __( 'Select a distance: ', 'SimpleMap' ), $post ), 'input' => $distance_input ); + + } + + // Adds taxonomy fields to search form + function add_taxonomy_fields( $atts, $taxonomy ) { + global $post; + + // Get taxonomy object or return empty; + if ( ! $tax_object = get_taxonomy( $taxonomy ) ) + return ''; + + $options = $this->get_options(); + + $atts = $this->parse_shortcode_atts( $atts ); + + extract( $atts ); + + $php_taxonomy = str_replace( '-', '_', $taxonomy ); + + // Convert Specific Taxonomy var names and var values to Generic var names and var values + $taxonomies = $atts[$php_taxonomy]; + $tax_hidden_name = 'avail_' . $php_taxonomy; + $show_taxes_filter = $atts['show_' . $php_taxonomy . '_filter']; + $tax_field_name = $php_taxonomy; + + // This originates at the comma separated list of taxonomy ids in the shortcode. ie: sm_category='1,3,5' + $taxes_avail = $atts[$tax_hidden_name]; + + // Place available taxes in array + $taxes_avail = explode( ',', $taxes_avail ); + $taxes_array = array(); + + // Loop through all cats and create array of available cats + if ( $all_taxes = get_terms( $taxonomy ) ) { + + foreach ( $all_taxes as $key => $value ){ + if ( '' == $taxes_avail[0] || in_array( $value->term_id, $taxes_avail ) ) { + $taxes_array[] = $value->term_id; + } + } + + } + + $taxes_avail = $taxes_array; + + // Show taxes filters if allowed + $tax_search = ''; + $tax_label = apply_filters( $php_taxonomy . '-text', __( $tax_object->labels->singular_name . ': ' ), 'SimpleMap' ); + + $taxes_array = apply_filters( 'sm-search-from-taxonomies', $taxes_array, $taxonomy ); + + if ( 'checkboxes' == $taxonomy_field_type ) { + // Print checkbox for each available cat + foreach( $taxes_array as $key => $taxid ) { + if( $term = get_term_by( 'id', $taxid, $taxonomy ) ) { + $tax_checked = isset( $_REQUEST['location_search_' . $tax_field_name . '_' . esc_attr( $term->term_id ) . 'field'] ) ? ' checked="checked" ' : ''; + $tax_search .= ' '; + } + } + } elseif( 'select' == $taxonomy_field_type ) { + // Print selectbox if that's what we're doing + $tax_select = ""; + + if ( ! empty( $taxid ) ) + $tax_search .= $tax_select; + } + + return array( 'label' => $tax_label, 'input' => $tax_search ); + } + + // This function enqueues all the javascript and stylesheets + function enqueue_frontend_scripts_styles() { + global $post; + $options = $this->get_options(); + + // Rewrite rules if we've changed the location permalink slug + if ( get_option( 'sm-rewrite-rules' ) ) { + global $wp_rewrite; + $wp_rewrite->flush_rules(); + delete_option( 'sm-rewrite-rules' ); + } + + // Frontend only + if ( ! is_admin() && is_object( $post ) || apply_filters( 'sm-force-frontend-js', '__return_false' ) ) { + // Bail if we're not showing on all pages and this isn't a map page + if ( ! in_array( $post->ID, explode( ',', $options['map_pages'] ) ) && ! in_array( 0, explode( ',', $options['map_pages'] ) ) ) + return false; + + // Check for use of custom stylesheet and load styles + if ( strstr( $options['map_stylesheet'], 'simplemap-styles' ) ) + $style_url = plugins_url() . '/' . $options['map_stylesheet']; + else + $style_url = SIMPLEMAP_URL . '/' . $options['map_stylesheet']; + + // Load styles + wp_enqueue_style( 'simplemap-map-style', $style_url ); + + // Scripts + wp_enqueue_script( 'simplemap-master-js', get_home_url() . '?simplemap-master-js=1&smpid=' . $post->ID, array( 'jquery' ) ); + + // Google API v3 does not need a key + $url_params = array( + 'sensor' => 'false', + 'v' => '3', + 'language' => $options['default_language'], + 'region' => $options['default_country'], + ); + if ( $options['adsense_for_maps'] ) { + $url_params['libraries'] = 'adsense'; + } + wp_enqueue_script( 'simplemap-google-api', SIMPLEMAP_MAPS_JS_API . http_build_query( $url_params, '', '&' ) ); + } + } + + // This function enqueues all the javascript and stylesheets + function enqueue_backend_scripts_styles() { + // Admin only + if ( is_admin() ) { + $options = $this->get_options(); + wp_enqueue_style( 'simplemap-admin', SIMPLEMAP_URL . '/inc/styles/admin.css' ); + + // SimpleMap General options + if ( isset( $_GET['page'] ) && 'simplemap' == $_GET['page'] ) + wp_enqueue_script( 'simplemap-general-options-js', get_home_url() . '/?simplemap-general-options-js', array( 'jquery' ) ); + + // Google API v3 does not need a key + $url_params = array( + 'v' => '3', + 'sensor' => 'false', + 'language' => $options['default_language'], + 'region' => $options['default_country'], + ); + wp_enqueue_script( 'simplemap-google-api', SIMPLEMAP_MAPS_JS_API . http_build_query( $url_params, '', '&' ) ); + } + } + + // JS Script for general options page + function general_options_js_script() { + if ( ! isset( $_GET['simplemap-general-options-js'] ) ) + return; + + header( 'Status: 200 OK', false, 200 ); + header( 'Content-type: application/x-javascript' ); + do_action( 'sm-master-js-headers' ); + + $options = $this->get_options(); + + do_action( 'sm-general-options-js' ); + ?> + function codeAddress() { + // if this is modified, modify mirror function in master-js php function + var d_address = document.getElementById("default_address").value; + + geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': d_address }, function( results, status ) { + if ( status == google.maps.GeocoderStatus.OK ) { + var latlng = results[0].geometry.location; + document.getElementById("default_lat").value = latlng.lat(); + document.getElementById("default_lng").value = latlng.lng(); + } else { + alert("Geocode was not successful for the following reason: " + status); + } + }); + } + get_options(); + + ?> + var default_lat = ; + var default_lng = ; + var default_radius = ; + var zoom_level = ''; + var map_width = ''; + var map_height = ''; + var special_text = ''; + var units = ''; + var limit = ''; + var plugin_url = ''; + var visit_website_text = ''; + var get_directions_text = ''; + var location_tab_text = ''; + var description_tab_text = ''; + var phone_text = ''; + var fax_text = ''; + var email_text = ''; + + var taxonomy_text = {}; + get_sm_taxonomies( 'array', '', true, 'object' ) ) { + foreach( $taxonomies as $taxonomy ) { + ?> + taxonomy_text.name; ?> = 'name . '-text', __( $taxonomy->labels->name, 'SimpleMap' ) ); ?>'; + + var noresults_text = ''; + var default_domain = ''; + var address_format = ''; + var siteurl = ''; + var map; + var geocoder; + var autoload = ''; + var auto_locate = ''; + var markersArray = []; + var infowindowsArray = []; + + function clearInfoWindows() { + if (infowindowsArray) { + for (var i=0;i + jQuery( "#simplemap" ).html( "

    General Settings before your maps will work.', 'SimpleMap' ), admin_url( 'admin.php?page=simplemap' ) ); ?>

    " ); + + + if ( lat == 0 ) { + lat = ''; + } + + if ( lng == 0 ) { + lng = ''; + } + + var latlng = new google.maps.LatLng( lat, lng ); + var myOptions = { + zoom: parseInt(zoom_level), + center: latlng, + mapTypeId: google.maps.MapTypeId[map_type] + }; + map = new google.maps.Map( document.getElementById( "simplemap" ), myOptions ); + + // Adsense for Google Maps + + + // Adsense ID. If no shortcode, check for options. If not options, use blank string. + if ( aspid == 0 ) + aspid = ''; + + // Channel ID. If no shortcode, check for options. If not options, use blank string. + if ( ascid == 0 ) + ascid = ''; + + // Max ads per map. If no shortcode, check for options. If no options, use 2. + if ( asma == 0 ) + asma = ''; + + var publisher_id = aspid; + + var adUnitDiv = document.createElement('div'); + var adUnitOptions = { + channelNumber: ascid, + format: google.maps.adsense.AdFormat.HALF_BANNER, + position: google.maps.ControlPosition.TOP, + map: map, + visible: true, + publisherId: publisher_id + }; + adUnit = new google.maps.adsense.AdUnit(adUnitDiv, adUnitOptions); + + } + + function codeAddress() { + // if this is modified, modify mirror function in general-options-js php function + var d_address = document.getElementById("default_address").value; + + geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': d_address }, function( results, status ) { + if ( status == google.maps.GeocoderStatus.OK ) { + var latlng = results[0].geometry.location; + document.getElementById("default_lat").value = latlng.lat(); + document.getElementById("default_lng").value = latlng.lng(); + } else { + alert("Geocode was not successful for the following reason: " + status); + } + }); + } + + function codeNewAddress() { + if (document.getElementById("store_lat").value != '' && document.getElementById("store_lng").value != '') { + document.new_location_form.submit(); + } + else { + var address = ''; + var street = document.getElementById("store_address").value; + var city = document.getElementById("store_city").value; + var state = document.getElementById("store_state").value; + var country = document.getElementById("store_country").value; + + if (street) { address += street + ', '; } + if (city) { address += city + ', '; } + if (state) { address += state + ', '; } + address += country; + + geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': address }, function( results, status ) { + if ( status == google.maps.GeocoderStatus.OK ) { + var latlng = results[0].geometry.location; + document.getElementById("store_lat").value = latlng.lat(); + document.getElementById("store_lng").value = latlng.lng(); + document.new_location_form.submit(); + } else { + alert("Geocode was not successful for the following reason: " + status); + } + }); + } + } + + function codeChangedAddress() { + var address = ''; + var street = document.getElementById("store_address").value; + var city = document.getElementById("store_city").value; + var state = document.getElementById("store_state").value; + var country = document.getElementById("store_country").value; + + if (street) { address += street + ', '; } + if (city) { address += city + ', '; } + if (state) { address += state + ', '; } + address += country; + + geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': address }, function( results, status ) { + if ( status == google.maps.GeocoderStatus.OK ) { + var latlng = results[0].geometry.location; + document.getElementById("store_lat").value = latlng.lat(); + document.getElementById("store_lng").value = latlng.lng(); + } else { + alert("Geocode was not successful for the following reason: " + status); + } + }); + } + + function searchLocations( is_search ) { + // Init searchData + var searchData = {}; + searchData.taxes = {}; + + // Set defaults for search form fields + searchData.address = ''; + searchData.city = ''; + searchData.state = ''; + searchData.zip = ''; + searchData.country = ''; + + if ( null != document.getElementById('location_search_address_field') ) { + searchData.address = document.getElementById('location_search_address_field').value; + } + + if ( null != document.getElementById('location_search_city_field') ) { + searchData.city = document.getElementById('location_search_city_field').value; + } + + if ( null != document.getElementById('location_search_country_field') ) { + searchData.country = document.getElementById('location_search_country_field').value;; + } + + if ( null != document.getElementById('location_search_state_field') ) { + searchData.state = document.getElementById('location_search_state_field').value; + } + + if ( null != document.getElementById('location_search_zip_field') ) { + searchData.zip = document.getElementById('location_search_zip_field').value; + } + + if ( null != document.getElementById('location_search_distance_field') ) { + searchData.radius = document.getElementById('location_search_distance_field').value; + } + + searchData.lat = document.getElementById('location_search_default_lat').value; + searchData.lng = document.getElementById('location_search_default_lng').value; + searchData.limit = document.getElementById('location_search_limit').value; + searchData.searching = document.getElementById('location_is_search_results').value; + + // Do SimpleMap Taxonomies + + + // Do taxnonomy for checkboxes + searchData.taxes. = ''; + var checks_found = false; + jQuery( 'input[rel=location_search__field]' ).each( function() { + checks_found = true; + if ( jQuery( this ).attr( 'checked' ) && jQuery( this ).attr( 'value' ) != null ) { + += jQuery( this ).attr( 'value' ) + ','; + } + }); + + // Do taxnonomy for select box if checks weren't found + if ( false == checks_found ) { + jQuery( 'option[rel=location_search__select_val]' ).each( function() { + if ( jQuery( this ).attr( 'selected' ) && jQuery( this ).attr( 'value' ) != null ) { + += jQuery( this ).attr( 'value' ) + ','; + } + }); + } + + + + var query = ''; + var start = 0; + + if ( searchData.address && searchData.address != '' ) { + query += searchData.address + ', '; + } + + if ( searchData.city && searchData.city != '' ) { + query += searchData.city + ', '; + } + + if ( searchData.state && searchData.state != '' ) { + query += searchData.state + ', '; + } + + if ( searchData.zip && searchData.zip != '' ) { + query += searchData.zip + ', '; + } + + if ( searchData.country && searchData.country != '' ) { + query += searchData.country + ', '; + } + + // Query + if ( query != null ) { + query = query.slice(0, -2); + } + + if ( searchData.limit == '' || searchData.limit == null ) { + searchData.limit = 0; + } + + if ( searchData.radius == '' || searchData.radius == null ) { + searchData.radius = 0; + } + + // Taxonomies + + + if ( != null ) { + var _ = .slice(0, -1); + } else { + var _ = ''; + } + + // Append available taxes logic if no taxes are selected but limited taxes were passed through shortcode as available + if ( '' != document.getElementById('avail_').value && '' == _ ) { + _ = 'OR,' + document.getElementById('avail_').value; + } + + searchData.taxes. = _; + + + + // Load default location if query is empty + if ( query == '' || query == null ) { + + if ( searchData.lat != 0 && searchData.lng != 0 ) + query = searchData.lat + ', ' + searchData.lng; + else + query = ', '; + + } + + // Searching + if ( 1 == searchData.searching || 1 == is_search ) { + is_search = 1; + searchData.source = 'search'; + } else { + is_search = 0; + searchData.source = 'initial_load'; + } + + geocoder.geocode( { 'address': query }, function( results, status ) { + if ( status == google.maps.GeocoderStatus.OK ) { + searchData.center = results[0].geometry.location; + if ( 'none' != autoload || is_search ) { + if ( 'all' == autoload && is_search != 1 ) { + searchData.radius = 0; + searchData.limit = 0; + } + + if (! searchData.center) { + searchData.center = new GLatLng( 44.9799654, -93.2638361 ); + } + searchData.query_type = 'all'; + searchData.mapLock = 'unlock'; + searchData.homeAddress = query; + + searchLocationsNear(searchData); + } + } + }); + } + + function searchLocationsNear(searchData) { + // Radius + if ( searchData.radius != null && searchData.radius != '' ) { + searchData.radius = parseInt( searchData.radius ); + + if ( units == 'km' ) { + searchData.radius = parseInt( searchData.radius ) / 1.609344; + } + } else if ( autoload == 'all' ) { + searchData.radius = 0; + } else { + if ( units == 'mi' ) { + searchData.radius = parseInt( default_radius ); + } else if ( units == 'km' ) { + searchData.radius = parseInt( default_radius ) / 1.609344; + } + } + + // Build search URL + get_sm_taxonomies( 'array', '', true ) ) { + $js_tax_string = ''; + foreach( $taxonomies as $taxonomy ) { + $js_tax_string .= "'&$taxonomy=' + searchData.taxes.$taxonomy + "; + } + } + ?> + + var searchUrl = siteurl + '/?sm-xml-search=1&lat=' + searchData.center.lat() + '&lng=' + searchData.center.lng() + '&radius=' + searchData.radius + '&namequery=' + searchData.homeAddress + '&query_type=' + searchData.query_type + '&limit=' + searchData.limit + '&address=' + searchData.address + '&city=' + searchData.city + '&state=' + searchData.state + '&zip=' + searchData.zip + '&pid='; + + + // Display Updating Message and hide search results + if ( jQuery( "#simplemap" ).is(":visible") ) { + jQuery( "#simplemap" ).hide(); + jQuery( "#simplemap-updating" ).show(); + } + + jQuery( "#results" ).html( '' ); + + jQuery.get( searchUrl, {}, function(data) { + + // Hide Updating Message + if ( jQuery( "#simplemap-updating" ).is(":visible") ) { + jQuery( "#simplemap-updating" ).hide(); + jQuery( "#simplemap" ).show(); + } + + + clearOverlays(); + + var results = document.getElementById('results'); + results.innerHTML = ''; + + var markers = jQuery( eval( data ) ); + if (markers.length == 0) { + results.innerHTML = '

    ' + noresults_text + '

    '; + map.setCenter( searchData.center ); + return; + } + + var bounds = new google.maps.LatLngBounds(); + markers.each( function () { + var locationData = this; + locationData.distance = parseFloat(locationData.distance); + locationData.point = new google.maps.LatLng(parseFloat(locationData.lat), parseFloat(locationData.lng)); + locationData.homeAddress = searchData.homeAddress; + + var marker = createMarker(locationData); + var sidebarEntry = createSidebarEntry(marker, locationData, searchData); + results.appendChild(sidebarEntry); + bounds.extend(locationData.point); + }); + + // Make centeral marker on search + if ( 'search' == searchData.source && ) { + var searchMarkerOptions = {}; + searchMarkerOptions.map = map; + searchMarkerOptions.position = searchData.center; + + searchMarkerOptions.icon = new google.maps.MarkerImage( + '', + new google.maps.Size(20, 32), + new google.maps.Point(0,0), + new google.maps.Point(0,32) + ); + + var searchMarkerTitle = ''; + if ( '' != searchData.address ) { + searchMarkerTitle += searchData.address + ' '; + } + if ( '' != searchData.city ) { + searchMarkerTitle += searchData.city + ' '; + } + if ( '' != searchData.state ) { + searchMarkerTitle += searchData.state + ' '; + } + if ( '' != searchData.zip ) { + searchMarkerTitle += searchData.zip + ' '; + } + + var searchMarker = new google.maps.Marker( searchMarkerOptions ); + searchMarker.title = searchMarkerTitle; + markersArray.push(searchMarker); + bounds.extend(searchMarkerOptions.position); + } + + // If the search button was clicked, limit to a 15px zoom + if ( 'search' == searchData.source ) { + map.fitBounds( bounds ); + if ( map.getZoom() > 15 ) { + map.setZoom( 15 ); + } + } else { + // If initial load of map, zoom to default settings + map.setZoom(parseInt(zoom_level)); + } + + // Paranoia - fix container sizing bug -- pdb + google.maps.event.addListener(map, "idle", function(){ + google.maps.event.trigger(map, 'resize'); + }); + }); + } + + function stringFilter(s) { + filteredValues = "emnpxt%"; // Characters stripped out + var i; + var returnString = ""; + for (i = 0; i < s.length; i++) { // Search through string and append to unfiltered values to returnString. + var c = s.charAt(i); + if (filteredValues.indexOf(c) == -1) returnString += c; + } + return returnString; + } + + function createMarker( locationData ) { + + // Init tax heights + locationData.taxonomyheights = []; + + // Allow plugin users to define Maker Options (including custom images) + var markerOptions = {}; + if ( 'function' == typeof window.simplemapCustomMarkers ) { + markerOptions = simplemapCustomMarkers( locationData ); + } + + // Allow developers to turn of description in bubble. (Return true to hide) + + locationData.description = ''; + + + markerOptions.map = map; + markerOptions.position = locationData.point; + var marker = new google.maps.Marker( markerOptions ); + marker.title = locationData.name; + markersArray.push(marker); + + var mapwidth; + var mapheight; + var maxbubblewidth; + var maxbubbleheight; + + mapwidth = document.getElementById("simplemap"); + if ( typeof mapwidth != 'undefined' ) { + mapwidth = mapwidth.offsetWidth; + } else { + if ( typeof map_width != 'undefined' ) { + mapwidth = Number(stringFilter(map_width)); + } else { + mapwidth = 400; + } + } + + mapheight = document.getElementById("simplemap"); + if ( typeof mapheight != 'undefined' ) { + mapheight = mapheight.offsetHeight; + } else { + if ( typeof map_height != 'undefined' ) { + mapheight = Number(stringFilter(map_height)); + } else { + mapheight = 200; + } + } + maxbubblewidth = Math.round(mapwidth / 1.5); + maxbubbleheight = Math.round(mapheight / 2.2); + + var fontsize = 12; + var lineheight = 12; + + if (locationData.taxes.sm_category && locationData.taxes.sm_category != '' ) { + var titleheight = 3 + Math.floor((locationData.name.length + locationData.taxes.sm_category.length) * fontsize / (maxbubblewidth * 1.5)); + } else { + var titleheight = 3 + Math.floor((locationData.name.length) * fontsize / (maxbubblewidth * 1.5)); + } + + var addressheight = 2; + if (locationData.address2 != '') { + addressheight += 1; + } + if (locationData.phone != '' || locationData.fax != '') { + addressheight += 1; + if (locationData.phone != '') { + addressheight += 1; + } + if (locationData.fax != '') { + addressheight += 1; + } + } + + for (jstax in locationData.taxes) { + if ( locationData.taxes[jstax] !== '' ) { + locationData.taxonomyheights[jstax] = 3 + Math.floor((locationData.taxes[jstax][length]) * fontsize / (maxbubblewidth * 1.5)); + } + } + var linksheight = 2; + + var totalheight = titleheight + addressheight; + for (jstax in locationData.taxes) { + if ( 'sm_category' != jstax ) { + totalheight += locationData.taxonomyheights[jstax]; + } + } + totalheight = (totalheight + 1) * fontsize; + + if (totalheight > maxbubbleheight) { + totalheight = maxbubbleheight; + } + + if ( isNaN( totalheight ) || totalheight > maxbubbleheight ) { + totalheight = maxbubbleheight; + } + + var html = '
    '; + html += '

    '; + + if ( '' != locationData.permalink ) { + html += ''; + } + html += locationData.name; + + if ( '' != locationData.permalink ) { + html += ''; + } + + if (locationData.taxes.sm_category && locationData.taxes.sm_category != null && locationData.taxes.sm_category != '' ) { + html += '
    ' + locationData.taxes.sm_category + ''; + } + + html += '

    '; + + html += '

    ' + locationData.address; + if (locationData.address2 != '') { + html += '
    ' + locationData.address2; + } + + // Address Data + if (address_format == 'town, province postalcode') { + html += '
    ' + locationData.city + ', ' + locationData.state + ' ' + locationData.zip + '

    '; + } else if (address_format == 'town province postalcode') { + html += '
    ' + locationData.city + ' ' + locationData.state + ' ' + locationData.zip + '

    '; + } else if (address_format == 'town-province postalcode') { + html += '
    ' + locationData.city + '-' + locationData.state + ' ' + locationData.zip + '

    '; + } else if (address_format == 'postalcode town-province') { + html += '
    ' + locationData.zip + ' ' + locationData.city + '-' + locationData.state + '

    '; + } else if (address_format == 'postalcode town, province') { + html += '
    ' + locationData.zip + ' ' + locationData.city + ', ' + locationData.state + '

    '; + } else if (address_format == 'postalcode town') { + html += '
    ' + locationData.zip + ' ' + locationData.city + '

    '; + } else if (address_format == 'town postalcode') { + html += '
    ' + locationData.city + ' ' + locationData.zip + '

    '; + } + + // Phone and Fax Data + if (locationData.phone != null && locationData.phone != '') { + html += '

    ' + phone_text + ': ' + locationData.phone + ''; + if (locationData.email != null && locationData.email != '') { + html += '
    ' + email_text + ': ' + locationData.email + ''; + } + if (locationData.fax != null && locationData.fax != '') { + html += '
    ' + fax_text + ': ' + locationData.fax + ''; + } + html += '

    '; + } else if (locationData.fax != null && locationData.fax != '') { + html += '

    ' + fax_text + ': ' + locationData.fax + '

    '; + } + + html += '

    '; + + for (jstax in locationData.taxes) { + if ( 'sm_category' == jstax ) { + continue; + } + if ( locationData.taxes[jstax] != null && locationData.taxes[jstax] != '' ) { + html += taxonomy_text[jstax] + ': ' + locationData.taxes[jstax] + '
    '; + } + } + html += '

    '; + + var dir_address = locationData.point.toUrlValue(10); + var dir_address2 = ''; + if (locationData.address) { dir_address2 += locationData.address; } + if (locationData.city) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.city; }; + if (locationData.state) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.state; }; + if (locationData.zip) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.zip; }; + if (locationData.country) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.country; }; + + if ( '' != dir_address2 ) { dir_address = locationData.point.toUrlValue(10) + '(' + escape( dir_address2 ) + ')'; }; + + html += ' '; + + if (locationData.description != '' && locationData.description != null) { + var numlines = Math.ceil(locationData.description.length / 40); + var newlines = locationData.description.split('
    ').length - 1; + var totalheight2 = 0; + + if ( locationData.description.indexOf(' maxbubbleheight) { + totalheight2 = maxbubbleheight; + } + + //marker.openInfoWindowTabsHtml([new GInfoWindowTab(location_tab_text, html), new GInfoWindowTab(description_tab_text, html2)], {maxWidth: maxbubblewidth}); + // tabs aren't possible with the Google Maps api v3 + html += '

    ' + locationData.description + '

    '; + } + + html += '
    '; + + google.maps.event.addListener(marker, 'click', function() { + clearInfoWindows(); + var infowidth = 0; + if ( maxbubblewidth <= 100 ) { + infowidth = document.getElementById("simplemap"); + if ( typeof infowidth != 'undefined' ) { + infowidth = infowidth.offsetWidth; + } else { + infowidth = 400; + } + infowidth = infowidth * (maxbubblewidth / 100.0); + } + if ( infowidth < maxbubblewidth ) infowidth = maxbubblewidth; + infowidth = parseInt(infowidth) + 'px'; + var infowindow = new google.maps.InfoWindow({ + maxWidth: infowidth, + content: html + }); + infowindow.open(map, marker); + infowindowsArray.push(infowindow); + window.location = '#map_top'; + }); + + return marker; + } + + function createSidebarEntry(marker, locationData, searchData) { + var div = document.createElement('div'); + + // Beginning of result + var html = '
    '; + + // Flagged special + if (locationData.special == 1 && special_text != '') { + html += '
    ' + special_text + '
    '; + } + + // Name & distance + html += '
    '; + html += '

    '; + if (locationData.permalink != null && locationData.permalink != '') { + html += ''; + } + html += locationData.name; + if (locationData.permalink != null && locationData.permalink != '') { + html += ''; + } + + if (locationData.distance.toFixed(1) != 'NaN') { + if (units == 'mi') { + html+= ' ' + locationData.distance.toFixed(1) + ' miles'; + } + else if (units == 'km') { + html+= ' ' + (locationData.distance * 1.609344).toFixed(1) + ' km'; + } + } + html += '

    '; + + // Address + html += '
    ' + locationData.address; + if (locationData.address2 != '') { + html += '
    ' + locationData.address2; + } + + if (address_format == 'town, province postalcode') { + html += '
    ' + locationData.city + ', ' + locationData.state + ' ' + locationData.zip + '
    '; + } + else if (address_format == 'town province postalcode') { + html += '
    ' + locationData.city + ' ' + locationData.state + ' ' + locationData.zip + '
    '; + } + else if (address_format == 'town-province postalcode') { + html += '
    ' + locationData.city + '-' + locationData.state + ' ' + locationData.zip + '
'; + } + else if (address_format == 'postalcode town-province') { + html += '
' + locationData.zip + ' ' + locationData.city + '-' + locationData.state + '
'; + } + else if (address_format == 'postalcode town, province') { + html += '
' + locationData.zip + ' ' + locationData.city + ', ' + locationData.state + '
'; + } + else if (address_format == 'postalcode town') { + html += '
' + locationData.zip + ' ' + locationData.city + '
'; + } + else if (address_format == 'town postalcode') { + html += '
' + locationData.city + ' ' + locationData.zip + ''; + } + + // Phone, email, and fax numbers + html += '
'; + if (locationData.phone != null && locationData.phone != '') { + html += phone_text + ': ' + locationData.phone; + } + if (locationData.email != null && locationData.email != '') { + html += '
' + email_text + ': ' + locationData.email + '
'; + } + if (locationData.fax != null && locationData.fax != '') { + html += '
' + fax_text + ': ' + locationData.fax + '
'; + } + html += '
'; + + // Links section + html += ''; + html += '
'; + + + html += '
'; + html += locationData.description; + html += '
'; + html += '
'; + + + // Taxonomy lists + for (jstax in locationData.taxes) { + if ( locationData.taxes[jstax] != null && locationData.taxes[jstax] != '' ) { + html += '
' + taxonomy_text[jstax] + ': ' + locationData.taxes[jstax] + '
'; + } + } + + // End of result + html += ''; + + div.innerHTML = html; + div.style.cursor = 'pointer'; + div.style.margin = 0; + google.maps.event.addDomListener(div, 'click', function() { + google.maps.event.trigger(marker, 'click'); + }); + return div; + } + get_options(); + // Create URL encoded comma separated list of address elements that != '' + $to_geocode = urlencode( implode( ', ', array_filter( compact( 'address', 'city', 'state', 'zip', 'country' ) ) ) ); + + // Base URL + $base_url = SIMPLEMAP_MAPS_WS_API . 'geocode/json?sensor=false®ion=' . substr( $options['default_domain'], strrpos( $options['default_domain'], '.' ) + 1 ); + + // Add query + $request_url = $base_url . "&address=" . $to_geocode; + + $response = wp_remote_get( $request_url ); + + // TODO: Handle this situation better + if ( ! is_wp_error( $response ) ) { + $body = json_decode( $response['body'] ); + $status = $body->status; + + if ( $status == 'OK' ) { + // Successful geocode + //echo "
";print_r( $body );die();
+					$location = $body->results[0]->geometry->location;
+
+					// Format: Longitude, Latitude, Altitude
+					$lat = $location->lat;
+					$lng = $location->lng;
+				}
+
+				return compact( 'body', 'status', 'lat', 'lng' );
+			} else {
+				return false;
+			}
+		}
+
+		// Returns list of SimpleMap Taxonomies
+		function get_sm_taxonomies( $format='array', $prefix='', $php_safe=false, $output='names' ) {
+
+			$taxes = array();
+
+			if ( $taxes = get_object_taxonomies( 'sm-location', $output ) ) {
+
+				foreach( $taxes as $key => $tax ) {
+
+					// Convert to PHP safe and add prefix
+					if ( $php_safe && 'names' == $output )
+						$taxes[$key] = str_replace( '-', '_', $prefix.$tax );
+					elseif ( $php_safe )
+						$taxes[$key]->name = str_replace( '-', '_', $prefix.$tax->name );
+
+				}
+
+			}
+
+			// Convert to string if needed
+			if ( 'string' == $format )
+				$taxes = implode( ', ', $taxes );
+
+			return $taxes;
+
+		}
+
+		function get_taxonomy_settings( $taxonomy = null ) {
+			$standard_taxonomies = array(
+				'sm-category' => array( 'singular' => 'Category', 'plural' => 'Categories', 'hierarchical' => true, 'field' => 'category' ),
+				'sm-tag' => array( 'singular' => 'Tag', 'plural' => 'Tags', 'field' => 'tags' ),
+				'sm-day' => array( 'singular' => 'Day', 'plural' => 'Days', 'field' => 'days', 'description' => 'day of week' ),
+				'sm-time' => array( 'singular' => 'Time', 'plural' => 'Times', 'field' => 'times', 'description' => 'time of day' ),
+			);
+
+			if ( empty( $taxonomy ) ) {
+				return $standard_taxonomies;
+			}
+
+			if ( isset( $standard_taxonomies[$taxonomy] ) ) {
+				return $standard_taxonomies[$taxonomy];
+			}
+			else {
+				$singular = ucwords( substr( $taxonomy, strpos( $taxonomy, '-' ) + 1 ) );
+				return array( 'singular' => $singular, 'plural' => $singular . 's' );
+			}
+		}
+
+		// This function returns the default SimpleMap options		
+		function get_options() {
+			$options = array();
+			$saved = get_option( 'SimpleMap_options' );
+
+			if ( !empty( $saved ) ) {
+				$options = $saved;
+			}
+
+			static $default = null;
+			if ( empty( $default ) ) {
+				$default = array(
+					'map_width' => '100%',
+					'map_height' => '350px',
+					'default_lat' => '44.968684',
+					'default_lng' => '-93.215561',
+					'zoom_level' => '10',
+					'default_radius' => '10',
+					'map_type' => 'ROADMAP',
+					'special_text' => '',
+					'default_state' => '',
+					'default_country' => 'US',
+					'default_language' => 'en',
+					'default_domain' => '.com',
+					'map_stylesheet' => 'inc/styles/light.css',
+					'units' => 'mi',
+					'autoload' => 'all',
+					'lock_default_location' => false,
+					'results_limit' => '20',
+					'address_format' => 'town, province postalcode',
+					'powered_by' => 0,
+					'enable_permalinks' => 0,
+					'permalink_slug' => 'location',
+					'display_search' => 'show',
+					'map_pages' => '0',
+					'adsense_for_maps' => 0,
+					'adsense_pub_id' => '',
+					'adsense_channel_id' => '',
+					'adsense_max_ads' => 2,
+					//'api_key' => '',
+					'auto_locate' => '',
+					'taxonomies' => array(
+						'sm-category' => $this->get_taxonomy_settings( 'sm-category' ),
+						'sm-tag' => $this->get_taxonomy_settings( 'sm-tag' ),
+					),
+				);
+
+				$valid_map_type_map = array(
+					'ROADMAP' => 'ROADMAP',
+					'SATELLITE' => 'SATELLITE',
+					'HYBRID' => 'HYBRID',
+					'TERRAIN' => 'TERRAIN',
+					'G_NORMAL_MAP' => 'ROADMAP',
+					'G_SATELLITE_MAP' => 'SATELLITE',
+					'G_HYBRID_MAP' => 'HYBRID',
+					'G_PHYSICAL_MAP' => 'TERRAIN',
+				);
+
+				if ( empty( $valid_map_type_map[$options['map_type']] ) ) {
+					$options['map_type'] = $default['map_type'];
+				}
+				else {
+					$options['map_type'] = $valid_map_type_map[$options['map_type']];
+				}
+			}
+
+			$options += $default;
+
+			if ( isset( $options['days_taxonomy'] ) ) {
+				if ( ! empty( $options['days_taxonomy'] ) ) {
+					$options['taxonomies']['sm-day'] = $this->get_taxonomy_settings( 'sm-day' );
+				}
+				unset( $options['days_taxonomy'] );
+			}
+
+			if ( isset( $options['time_taxonomy'] ) ) {
+				if ( ! empty( $options['time_taxonomy'] ) ) {
+					$options['taxonomies']['sm-time'] = $this->get_taxonomy_settings( 'sm-time' );
+				}
+				unset( $options['time_taxonomy'] );
+			}
+
+			if ( $saved != $options ) {
+				update_option( 'SimpleMap_options', $options );
+			}
+			return $options;
+		}
+		
+		// Google Domains
+		function get_domain_options() {
+			$domains_list = array(
+				'United States' => '.com',
+				'Austria' => '.at',
+				'Australia' => '.com.au',
+				'Bosnia and Herzegovina' => '.com.ba',
+				'Belgium' => '.be',
+				'Brazil' => '.com.br',
+				'Canada' => '.ca',
+				'Switzerland' => '.ch',
+				'Czech Republic' => '.cz',
+				'Germany' => '.de',
+				'Denmark' => '.dk',
+				'Spain' => '.es',
+				'Finland' => '.fi',
+				'France' => '.fr',
+				'Italy' => '.it',
+				'Japan' => '.jp',
+				'Netherlands' => '.nl',
+				'Norway' => '.no',
+				'New Zealand' => '.co.nz',
+				'Poland' => '.pl',
+				'Russia' => '.ru',
+				'Sweden' => '.se',
+				'Taiwan' => '.tw',
+				'United Kingdom' => '.co.uk',
+				'South Africa' => '.co.za'
+			);
+			
+			return apply_filters( 'sm-domain-list', $domains_list );
+		}
+
+		// Region list from http://code.google.com/apis/adwords/docs/appendix/provincecodes.html
+		// Used for Maps v3 localization: http://code.google.com/apis/maps/documentation/javascript/basics.html#Localization
+		function get_region_options() {
+			$region_list = array(
+				'US' => 'United States',
+				'AR' => 'Argentina',
+				'AU' => 'Australia',
+				'AT' => 'Austria',
+				'BE' => 'Belgium',
+				'BR' => 'Brazil',
+				'CA' => 'Canada',
+				'CL' => 'Chile',
+				'CN' => 'China',
+				'CO' => 'Colombia',
+				'HR' => 'Croatia',
+				'CZ' => 'Czech Republic',
+				'DK' => 'Denmark',
+				'EG' => 'Egypt',
+				'FI' => 'Finland',
+				'FR' => 'France',
+				'DE' => 'Germany',
+				'HU' => 'Hungary',
+				'IN' => 'India',
+				'IE' => 'Ireland',
+				'IL' => 'Israel',
+				'IT' => 'Italy',
+				'JP' => 'Japan',
+				'MY' => 'Malaysia',
+				'MX' => 'Mexico',
+				'MA' => 'Morocco',
+				'NL' => 'Netherlands',
+				'NZ' => 'New Zealand',
+				'NG' => 'Nigeria',
+				'NO' => 'Norway',
+				'PL' => 'Poland',
+				'PT' => 'Portugal',
+				'RU' => 'Russian Federation',
+				'SA' => 'Saudi Arabia',
+				'ZA' => 'South Africa',
+				'KR' => 'South Korea',
+				'ES' => 'Spain',
+				'SE' => 'Sweden',
+				'CH' => 'Switzerland',
+				'TH' => 'Thailand',
+				'TR' => 'Turkey',
+				'UA' => 'Ukraine',
+				'GB' => 'United Kingdom',
+			);
+
+			return apply_filters( 'sm-region-list', $region_list );
+		}
+
+		// Country list
+		function get_country_options() {
+			$country_list = array(
+				'US' => 'United States',
+				'AF' => 'Afghanistan',
+				'AL' => 'Albania',
+				'DZ' => 'Algeria',
+				'AS' => 'American Samoa',
+				'AD' => 'Andorra',
+				'AO' => 'Angola',
+				'AI' => 'Anguilla',
+				'AQ' => 'Antarctica',
+				'AG' => 'Antigua and Barbuda',
+				'AR' => 'Argentina',
+				'AM' => 'Armenia',
+				'AW' => 'Aruba',
+				'AU' => 'Australia',
+				'AT' => 'Austria',
+				'AZ' => 'Azerbaijan',
+				'BS' => 'Bahamas',
+				'BH' => 'Bahrain',
+				'BD' => 'Bangladesh',
+				'BB' => 'Barbados',
+				'BY' => 'Belarus',
+				'BE' => 'Belgium',
+				'BZ' => 'Belize',
+				'BJ' => 'Benin',
+				'BM' => 'Bermuda',
+				'BT' => 'Bhutan',
+				'BO' => 'Bolivia',
+				'BA' => 'Bosnia and Herzegowina',
+				'BW' => 'Botswana',
+				'BV' => 'Bouvet Island',
+				'BR' => 'Brazil',
+				'IO' => 'British Indian Ocean Territory',
+				'BN' => 'Brunei Darussalam',
+				'BG' => 'Bulgaria',
+				'BF' => 'Burkina Faso',
+				'BI' => 'Burundi',
+				'KH' => 'Cambodia',
+				'CM' => 'Cameroon',
+				'CA' => 'Canada',
+				'CV' => 'Cape Verde',
+				'KY' => 'Cayman Islands',
+				'CF' => 'Central African Republic',
+				'TD' => 'Chad',
+				'CL' => 'Chile',
+				'CN' => 'China',
+				'CX' => 'Christmas Island',
+				'CC' => 'Cocos (Keeling) Islands',
+				'CO' => 'Colombia',
+				'KM' => 'Comoros',
+				'CG' => 'Congo',
+				'CD' => 'Congo, The Democratic Republic of the',
+				'CK' => 'Cook Islands',
+				'CR' => 'Costa Rica',
+				'CI' => 'Cote D\'Ivoire',
+				'HR' => 'Croatia (Local Name: Hrvatska)',
+				'CU' => 'Cuba',
+				'CY' => 'Cyprus',
+				'CZ' => 'Czech Republic',
+				'DK' => 'Denmark',
+				'DJ' => 'Djibouti',
+				'DM' => 'Dominica',
+				'DO' => 'Dominican Republic',
+				'TP' => 'East Timor',
+				'EC' => 'Ecuador',
+				'EG' => 'Egypt',
+				'SV' => 'El Salvador',
+				'GQ' => 'Equatorial Guinea',
+				'ER' => 'Eritrea',
+				'EE' => 'Estonia',
+				'ET' => 'Ethiopia',
+				'FK' => 'Falkland Islands (Malvinas)',
+				'FO' => 'Faroe Islands',
+				'FJ' => 'Fiji',
+				'FI' => 'Finland',
+				'FR' => 'France',
+				'FX' => 'France, Metropolitan',
+				'GF' => 'French Guiana',
+				'PF' => 'French Polynesia',
+				'TF' => 'French Southern Territories',
+				'GA' => 'Gabon',
+				'GM' => 'Gambia',
+				'GE' => 'Georgia',
+				'DE' => 'Germany',
+				'GH' => 'Ghana',
+				'GI' => 'Gibraltar',
+				'GR' => 'Greece',
+				'GL' => 'Greenland',
+				'GD' => 'Grenada',
+				'GP' => 'Guadeloupe',
+				'GU' => 'Guam',
+				'GT' => 'Guatemala',
+				'GN' => 'Guinea',
+				'GW' => 'Guinea-Bissau',
+				'GY' => 'Guyana',
+				'HT' => 'Haiti',
+				'HM' => 'Heard and Mc Donald Islands',
+				'VA' => 'Holy See (Vatican City State)',
+				'HN' => 'Honduras',
+				'HK' => 'Hong Kong',
+				'HU' => 'Hungary',
+				'IS' => 'Iceland',
+				'IN' => 'India',
+				'ID' => 'Indonesia',
+				'IR' => 'Iran (Islamic Republic of)',
+				'IQ' => 'Iraq',
+				'IE' => 'Ireland',
+				'IL' => 'Israel',
+				'IT' => 'Italy',
+				'JM' => 'Jamaica',
+				'JP' => 'Japan',
+				'JO' => 'Jordan',
+				'KZ' => 'Kazakhstan',
+				'KE' => 'Kenya',
+				'KI' => 'Kiribati',
+				'KP' => 'Korea, Democratic People\'s Republic of',
+				'KR' => 'Korea, Republic of',
+				'KW' => 'Kuwait',
+				'KG' => 'Kyrgyzstan',
+				'LA' => 'Lao People\'s Democratic Republic',
+				'LV' => 'Latvia',
+				'LB' => 'Lebanon',
+				'LS' => 'Lesotho',
+				'LR' => 'Liberia',
+				'LY' => 'Libyan Arab Jamahiriya',
+				'LI' => 'Liechtenstein',
+				'LT' => 'Lithuania',
+				'LU' => 'Luxembourg',
+				'MO' => 'Macau',
+				'MK' => 'Macedonia, Former Yugoslav Republic of',
+				'MG' => 'Madagascar',
+				'MW' => 'Malawi',
+				'MY' => 'Malaysia',
+				'MV' => 'Maldives',
+				'ML' => 'Mali',
+				'MT' => 'Malta',
+				'MH' => 'Marshall Islands',
+				'MQ' => 'Martinique',
+				'MR' => 'Mauritania',
+				'MU' => 'Mauritius',
+				'YT' => 'Mayotte',
+				'MX' => 'Mexico',
+				'FM' => 'Micronesia, Federated States of',
+				'MD' => 'Moldova, Republic of',
+				'MC' => 'Monaco',
+				'MN' => 'Mongolia',
+				'MS' => 'Montserrat',
+				'MA' => 'Morocco',
+				'MZ' => 'Mozambique',
+				'MM' => 'Myanmar',
+				'NA' => 'Namibia',
+				'NR' => 'Nauru',
+				'NP' => 'Nepal',
+				'NL' => 'Netherlands',
+				'AN' => 'Netherlands Antilles',
+				'NC' => 'New Caledonia',
+				'NZ' => 'New Zealand',
+				'NI' => 'Nicaragua',
+				'NE' => 'Niger',
+				'NG' => 'Nigeria',
+				'NU' => 'Niue',
+				'NF' => 'Norfolk Island',
+				'MP' => 'Northern Mariana Islands',
+				'NO' => 'Norway',
+				'OM' => 'Oman',
+				'PK' => 'Pakistan',
+				'PW' => 'Palau',
+				'PA' => 'Panama',
+				'PG' => 'Papua New Guinea',
+				'PY' => 'Paraguay',
+				'PE' => 'Peru',
+				'PH' => 'Philippines',
+				'PN' => 'Pitcairn',
+				'PL' => 'Poland',
+				'PT' => 'Portugal',
+				'PR' => 'Puerto Rico',
+				'QA' => 'Qatar',
+				'RE' => 'Reunion',
+				'RO' => 'Romania',
+				'RU' => 'Russian Federation',
+				'RW' => 'Rwanda',
+				'KN' => 'Saint Kitts and Nevis',
+				'LC' => 'Saint Lucia',
+				'VC' => 'Saint Vincent and The Grenadines',
+				'WS' => 'Samoa',
+				'SM' => 'San Marino',
+				'ST' => 'Sao Tome And Principe',
+				'SA' => 'Saudi Arabia',
+				'SN' => 'Senegal',
+				'SC' => 'Seychelles',
+				'SL' => 'Sierra Leone',
+				'SG' => 'Singapore',
+				'SK' => 'Slovakia (Slovak Republic)',
+				'SI' => 'Slovenia',
+				'SB' => 'Solomon Islands',
+				'SO' => 'Somalia',
+				'ZA' => 'South Africa',
+				'GS' => 'South Georgia, South Sandwich Islands',
+				'ES' => 'Spain',
+				'LK' => 'Sri Lanka',
+				'SH' => 'St. Helena',
+				'PM' => 'St. Pierre and Miquelon',
+				'SD' => 'Sudan',
+				'SR' => 'Suriname',
+				'SJ' => 'Svalbard and Jan Mayen Islands',
+				'SZ' => 'Swaziland',
+				'SE' => 'Sweden',
+				'CH' => 'Switzerland',
+				'SY' => 'Syrian Arab Republic',
+				'TW' => 'Taiwan',
+				'TJ' => 'Tajikistan',
+				'TZ' => 'Tanzania, United Republic of',
+				'TH' => 'Thailand',
+				'TG' => 'Togo',
+				'TK' => 'Tokelau',
+				'TO' => 'Tonga',
+				'TT' => 'Trinidad and Tobago',
+				'TN' => 'Tunisia',
+				'TR' => 'Turkey',
+				'TM' => 'Turkmenistan',
+				'TC' => 'Turks and Caicos Islands',
+				'TV' => 'Tuvalu',
+				'UG' => 'Uganda',
+				'UA' => 'Ukraine',
+				'AE' => 'United Arab Emirates',
+				'GB' => 'United Kingdom',
+				'UM' => 'United States Minor Outlying Islands',
+				'UY' => 'Uruguay',
+				'UZ' => 'Uzbekistan',
+				'VU' => 'Vanuatu',
+				'VE' => 'Venezuela',
+				'VN' => 'Vietnam',
+				'VG' => 'Virgin Islands (British)',
+				'VI' => 'Virgin Islands (U.S.)',
+				'WF' => 'Wallis and Futuna Islands',
+				'EH' => 'Western Sahara',
+				'YE' => 'Yemen',
+				'YU' => 'Yugoslavia',
+				'ZM' => 'Zambia',
+				'ZW' => 'Zimbabwe'
+			);
+
+			return apply_filters( 'sm-country-list', $country_list );
+		}
+
+		// Region list from http://code.google.com/apis/maps/faq.html#languagesupport
+		// Used for Maps v3 localization: http://code.google.com/apis/maps/documentation/javascript/basics.html#Localization
+		function get_language_options() {
+			$language_list = array(
+				'ar' => 'Arabic',
+				'eu' => 'Basque',
+				'bg' => 'Bulgarian',
+				'bn' => 'Bengali',
+				'ca' => 'Catalan',
+				'cs' => 'Czech',
+				'da' => 'Danish',
+				'de' => 'German',
+				'el' => 'Greek',
+				'en' => 'English',
+				'en-AU' => 'English (Australian)',
+				'en-GB' => 'English (Great Britain)',
+				'es' => 'Spanish',
+				'eu' => 'Basque',
+				'fa' => 'Farsi',
+				'fi' => 'Finnish',
+				'fil' => 'Filipino',
+				'fr' => 'French',
+				'gl' => 'Galician',
+				'gu' => 'Gujarati',
+				'hi' => 'Hindi',
+				'hr' => 'Croatian',
+				'hu' => 'Hungarian',
+				'id' => 'Indonesian',
+				'it' => 'Italian',
+				'iw' => 'Hebrew',
+				'ja' => 'Japanese',
+				'kn' => 'Kannada',
+				'ko' => 'Korean',
+				'lt' => 'Lithuanian',
+				'lv' => 'Latvian',
+				'ml' => 'Malayalam',
+				'mr' => 'Marathi',
+				'nl' => 'Dutch',
+				'no' => 'Norwegian',
+				'pl' => 'Polish',
+				'pt' => 'Portuguese',
+				'pt-BR' => 'Portuguese (Brazil)',
+				'pt-PT' => 'Portuguese (Portugal)',
+				'ro' => 'Romanian',
+				'ru' => 'Russian',
+				'sk' => 'Slovak',
+				'sl' => 'Slovenian',
+				'sr' => 'Serbian',
+				'sv' => 'Swedish',
+				'tl' => 'Tagalog',
+				'ta' => 'Tamil',
+				'te' => 'Telugu',
+				'th' => 'Thai',
+				'tr' => 'Turkish',
+				'uk' => 'Ukrainian',
+				'vi' => 'Vietnamese',
+				'zh-CN' => 'Chinese (Simplified)',
+				'zh-TW' => 'Chinese (Traditional)',
+			);
+
+			return apply_filters( 'sm-language-list', $language_list );
+		}
+
+		function get_auto_locate_options() {
+			$auto_locate_list = array(
+				'' => 'No Automatic Location',
+				'ip' => 'Use IP Address',
+				'html5' => 'Use HTML5',
+			);
+
+			return apply_filters( 'sm-auto-locte-list', $auto_locate_list );
+		}
+
+		// Echo the toolbar
+		function show_toolbar( $title = '' ) {
+			global $simple_map;
+			$options = $simple_map->get_options();
+			if ( '' == $title )
+				$title = 'SimpleMap';
+			?>
+			
+				
+					
+					
+					
+					
+				
+			
+

+
+ + + + +
+ + + + +
+
+ +

' . __( 'You must enter an API key for your domain.', 'SimpleMap' ).' ' . __( 'Enter a key on the General Options page.', 'SimpleMap' ) . '

'; + */ + } + + // Return the available search_radii + function get_search_radii(){ + $search_radii = array( 1, 5, 10, 25, 50, 100, 500, 1000 ); + return apply_filters( 'sm-search-radii', $search_radii ); + } + + // What link are we using for google's API + function get_api_link() { + $lo = str_replace('_', '-', get_locale()); + $l = substr($lo, 0, 2); + switch($l) { + case 'es': + case 'de': + case 'ja': + case 'ko': + case 'ru': + $api_link = "http://code.google.com/intl/$l/apis/maps/signup.html"; + break; + case 'pt': + case 'zh': + $api_link = "http://code.google.com/intl/$lo/apis/maps/signup.html"; + break; + case 'en': + default: + $api_link = "http://code.google.com/apis/maps/signup.html"; + break; + } + return $api_link; + } + + // Returns true if legacy tables exist in the DB + function legacy_tables_exist() { + global $wpdb; + + $sql = "SHOW TABLES LIKE '" . $wpdb->prefix . "simple_map'"; + if ( $tables = $wpdb->get_results( $sql ) ) { + return true; + } + + return false; + } + + // Search form / widget query vars + function register_query_vars( $vars ) { + + $vars[] = 'location_search_address'; + $vars[] = 'location_search_city'; + $vars[] = 'location_search_state'; + $vars[] = 'location_search_zip'; + $vars[] = 'location_search_distance'; + $vars[] = 'location_search_limit'; + $vars[] = 'location_is_search_results'; + + return $vars; + } + + /** + * Parses the shortcode attributes with the default options and returns array + * + * @since 2.3 + */ + function parse_shortcode_atts( $shortcode_atts ) { + $options = $this->get_options(); + $default_atts = $this->get_default_shortcode_atts(); + $atts = shortcode_atts( $default_atts, $shortcode_atts ); + + // If deprecated shortcodes were used, replace with current ones + if ( isset( $atts['show_categories_filter'] ) ) + $atts['show_sm_category_filter'] = $atts['show_categories_filter']; + if ( isset( $atts['show_tags_filter'] ) ) + $atts['show_sm_tag_filter'] = $atts['show_tags_filter']; + if ( isset( $atts['show_days_filter'] ) ) + $atts['show_sm_day_filter'] = $atts['show_days_filter']; + if ( isset( $atts['show_times_filter'] ) ) + $atts['show_sm_time_filter'] = $atts['show_times_filter']; + if ( isset( $atts['categories'] ) ) + $atts['sm_category'] = $atts['categories']; + if ( isset( $atts['tags'] ) ) + $atts['sm_tag'] = $atts['tags']; + if ( isset( $atts['days'] ) ) + $atts['sm_day'] = $atts['days']; + if ( isset( $atts['times'] ) ) + $atts['sm_time'] = $atts['times']; + + // Determine if we need to hide the search form or not + if ( '' == $atts['hide_search'] ) { + // Use default value + if ( 'show' == $options['display_search'] ) + $atts['hide_search'] = 0; + else + $atts['hide_search'] = 1; + } + + // Set categories and tags to available equivelants + $atts['avail_sm_category'] = $atts['sm_category']; + $atts['avail_sm_tag'] = $atts['sm_tag']; + $atts['avail_sm_day'] = $atts['sm_day']; + $atts['avail_sm_time'] = $atts['sm_time']; + + // Default lat / lng from shortcode? + if ( ! $atts['default_lat'] ) + $atts['default_lat'] = $options['default_lat']; + if ( ! $atts['default_lng'] ) + $atts['default_lng'] = $options['default_lng']; + + // Doing powered by? + if ( '' == $atts['powered_by'] ) { + + // Use default value + $atts['powered_by'] = $options['powered_by']; + + } else { + + // Use shortcode + if ( 0 == $atts['powered_by'] ) + $atts['powered_by'] = 0; + else + $atts['powered_by'] = 1; + + } + + // Default units or shortcode units? + if ( 'km' != $atts['units'] && 'mi' != $atts['units'] ) + $atts['units'] = $options['units']; + + // Default radius or shortcode radius? + if ( '' != $atts['radius'] && in_array( $atts['radius'], $this->get_search_radii() ) ) + $atts['radius'] = absint( $atts['radius'] ); + else + $atts['radius'] = $options['default_radius']; + + //Make sure we have limit + if ( '' == $atts['limit'] ) + $atts['limit'] = $options['results_limit']; + + // Clean search_field_cols + if ( 0 === absint( $atts['search_form_cols'] ) ) + $atts['search_form_cols'] = $default_atts['search_form_cols']; + + // Which type of map are we using? + if ( '' == $atts['map_type'] ) + $atts['map_type'] = $options['map_type']; + + // Height of the map? + if ( '' == $atts['map_height'] ) + $atts['map_height'] = $options['map_height']; + + // Width of the map? + if ( '' == $atts['map_width'] ) + $atts['map_width'] = $options['map_width']; + + // Which zoom level are we using? + if ( '' == $atts['zoom_level'] ) + $atts['zoom_level'] = $options['zoom_level']; + + // Which autoload option are we using? + if ( '' == $atts['autoload'] ) + $atts['autoload'] = $options['autoload']; + + // Return final array + return $atts; + } + + /** + * Returns default shortcode attributes + * + * @since 2.3 + */ + function get_default_shortcode_atts() { + $options = $this->get_options(); + + $tax_atts = array(); + $tax_search_fields = array(); + foreach ( $options['taxonomies'] as $taxonomy => $taxonomy_info ) { + $tax_search_fields[] = "||labeltd_$taxonomy||empty"; + + $safe_tax = str_replace('-', '_', $taxonomy); + $tax_atts[$safe_tax] = ''; + $tax_atts['show_' . $safe_tax . '_filter'] = 1; + + // The following are deprecated. Don't use them. + $tax_atts[strtolower($taxonomy_info['plural'])] = null; + $tax_atts['show_' . strtolower($taxonomy_info['plural']) . '_filter'] = null; + } + + $atts = $tax_atts + array( + 'search_title' => __( 'Find Locations Near:', 'SimpleMap' ), + 'search_form_type' => 'table', + 'search_form_cols' => 3, + 'search_fields' => 'labelbr_street||labelbr_city||labelbr_state||labelbr_zip||empty||empty||labeltd_distance||empty' . implode('', $tax_search_fields) . '||submit||empty||empty', + 'taxonomy_field_type' => 'checkboxes', + 'hide_search' => '', + 'hide_map' => 0, + 'hide_list' => 0, + 'default_lat' => 0, + 'default_lng' => 0, + 'adsense_publisher_id' => 0, + 'adsense_channel_id' => 0, + 'adsense_max_ads' => 0, + 'map_width' => '', + 'map_height' => '', + 'units' => '', + 'radius' => '', + 'limit' => '', + 'autoload' => '', + 'zoom_level' => '', + 'map_type' => '', + 'powered_by' => '', + 'sm_day' => '', + 'sm_time' => '' + ); + + return apply_filters( 'sm-default-shortcode-atts', $atts ); + } + + // This function filters category text labels + function backwards_compat_categories_text( $text ) { + return __( 'Categories', 'SimpleMap' ); + } + + // This function filters category text labels + function backwards_compat_tags_text( $text ) { + return __( 'Tags', 'SimpleMap' ); + } + + // This function filters category text labels + function backwards_compat_days_text( $text ) { + return __( 'Days', 'SimpleMap' ); + } + + // This function filters category text labels + function backwards_compat_times_text( $text ) { + return __( 'Times', 'SimpleMap' ); + } + + } +} diff --git a/classes/templates.php b/classes/templates.php new file mode 100644 index 0000000..fc7348c --- /dev/null +++ b/classes/templates.php @@ -0,0 +1,151 @@ +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: + *
    + *
  • Check for specific template via post-meta + *
  • Check for default template
  • + *
+ * + * @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 = "
"; + $return .= "
[sm-location data='iframe-map' map_width='100px' map_height='100px']
"; + $return .= "
[sm-location data='full-address']"; + $return .= "
Get Directions"; + $return .= "
    [sm-location data='phone' before='
  • ' after='
  • '] [sm-location data='email' before='
  • ' after='
  • '] [sm-location data='sm_category' format='csv' before='
  • Categories: ' after='
  • '] [sm-location data='sm_tag' format='csv' before='
  • Tags: ' after='
  • ']
"; + $return .= "
"; + $return .= "
"; + $return .= "
"; + $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; + + } + + } + +} diff --git a/classes/widgets.php b/classes/widgets.php new file mode 100644 index 0000000..fd3dcbd --- /dev/null +++ b/classes/widgets.php @@ -0,0 +1,256 @@ + '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 '' . $before_title . $title . $after_title . ''; + + // 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 = ''; // 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'] ) : ''; + ?> + +

+

+ +

/> +
+ + /> +
+ + /> +
+ + /> +
+ + /> +
+ + 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; + ?> + /> +
+ + +

+

+ +

+ +

+

+ */ + ?> +

+

+ + diff --git a/classes/xml-search.php b/classes/xml-search.php new file mode 100644 index 0000000..4221e18 --- /dev/null +++ b/classes/xml-search.php @@ -0,0 +1,198 @@ + 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(); + } + } +} diff --git a/inc/images/black-dot.png b/inc/images/black-dot.png new file mode 100644 index 0000000..9031b92 Binary files /dev/null and b/inc/images/black-dot.png differ diff --git a/inc/images/blue-dot.png b/inc/images/blue-dot.png new file mode 100644 index 0000000..00f0f69 Binary files /dev/null and b/inc/images/blue-dot.png differ diff --git a/inc/images/blue-grad.png b/inc/images/blue-grad.png new file mode 100644 index 0000000..a570cb4 Binary files /dev/null and b/inc/images/blue-grad.png differ diff --git a/inc/images/button-red-grad-active.png b/inc/images/button-red-grad-active.png new file mode 100644 index 0000000..c6e78fd Binary files /dev/null and b/inc/images/button-red-grad-active.png differ diff --git a/inc/images/button-red-grad.png b/inc/images/button-red-grad.png new file mode 100644 index 0000000..958eba7 Binary files /dev/null and b/inc/images/button-red-grad.png differ diff --git a/inc/images/green-dot.png b/inc/images/green-dot.png new file mode 100644 index 0000000..930b1b6 Binary files /dev/null and b/inc/images/green-dot.png differ diff --git a/inc/images/icon.png b/inc/images/icon.png new file mode 100644 index 0000000..b502b49 Binary files /dev/null and b/inc/images/icon.png differ diff --git a/inc/images/loading.gif b/inc/images/loading.gif new file mode 100644 index 0000000..78a943c Binary files /dev/null and b/inc/images/loading.gif differ diff --git a/inc/images/map-type-hybrid.jpg b/inc/images/map-type-hybrid.jpg new file mode 100644 index 0000000..8410311 Binary files /dev/null and b/inc/images/map-type-hybrid.jpg differ diff --git a/inc/images/map-type-normal.jpg b/inc/images/map-type-normal.jpg new file mode 100644 index 0000000..4323109 Binary files /dev/null and b/inc/images/map-type-normal.jpg differ diff --git a/inc/images/map-type-satellite.jpg b/inc/images/map-type-satellite.jpg new file mode 100644 index 0000000..c19078b Binary files /dev/null and b/inc/images/map-type-satellite.jpg differ diff --git a/inc/images/map-type-terrain.jpg b/inc/images/map-type-terrain.jpg new file mode 100644 index 0000000..ebe7060 Binary files /dev/null and b/inc/images/map-type-terrain.jpg differ diff --git a/inc/images/pink-dot.png b/inc/images/pink-dot.png new file mode 100644 index 0000000..dbc1ac3 Binary files /dev/null and b/inc/images/pink-dot.png differ diff --git a/inc/images/purple-dot.png b/inc/images/purple-dot.png new file mode 100644 index 0000000..a569c4c Binary files /dev/null and b/inc/images/purple-dot.png differ diff --git a/inc/images/red-dot.png b/inc/images/red-dot.png new file mode 100644 index 0000000..3735dc0 Binary files /dev/null and b/inc/images/red-dot.png differ diff --git a/inc/images/star.png b/inc/images/star.png new file mode 100644 index 0000000..222128e Binary files /dev/null and b/inc/images/star.png differ diff --git a/inc/images/teal-dot.png b/inc/images/teal-dot.png new file mode 100644 index 0000000..87549ff Binary files /dev/null and b/inc/images/teal-dot.png differ diff --git a/inc/images/white-dot.png b/inc/images/white-dot.png new file mode 100644 index 0000000..87f808d Binary files /dev/null and b/inc/images/white-dot.png differ diff --git a/inc/images/yellow-dot.png b/inc/images/yellow-dot.png new file mode 100644 index 0000000..b52fdc3 Binary files /dev/null and b/inc/images/yellow-dot.png differ diff --git a/inc/styles/admin.css b/inc/styles/admin.css new file mode 100644 index 0000000..e7d9a5a --- /dev/null +++ b/inc/styles/admin.css @@ -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; +} diff --git a/inc/styles/dark.css b/inc/styles/dark.css new file mode 100644 index 0000000..a22faa4 --- /dev/null +++ b/inc/styles/dark.css @@ -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 { + diff --git a/inc/styles/light.css b/inc/styles/light.css new file mode 100644 index 0000000..b5313b8 --- /dev/null +++ b/inc/styles/light.css @@ -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; +} diff --git a/lang/SimpleMap-de_DE.mo b/lang/SimpleMap-de_DE.mo new file mode 100644 index 0000000..a1ae520 Binary files /dev/null and b/lang/SimpleMap-de_DE.mo differ diff --git a/lang/SimpleMap-de_DE.po b/lang/SimpleMap-de_DE.po new file mode 100644 index 0000000..06d9d7b --- /dev/null +++ b/lang/SimpleMap-de_DE.po @@ -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 \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. Please update!" +msgstr "SimpleMap benötigt WordPress 2.8 oder neuer. Bitte updaten!" + +#: 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 http://" +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" + diff --git a/lang/SimpleMap-en_US.mo b/lang/SimpleMap-en_US.mo new file mode 100644 index 0000000..642e6b6 Binary files /dev/null and b/lang/SimpleMap-en_US.mo differ diff --git a/lang/SimpleMap-es_ES.mo b/lang/SimpleMap-es_ES.mo new file mode 100644 index 0000000..1cd1581 Binary files /dev/null and b/lang/SimpleMap-es_ES.mo differ diff --git a/lang/SimpleMap-es_ES.po b/lang/SimpleMap-es_ES.po new file mode 100644 index 0000000..79ed42d --- /dev/null +++ b/lang/SimpleMap-es_ES.po @@ -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 \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. Please update!" +msgstr "SimpleMap requiere WordPress 2.8 o superior. ¡Por favor, actualiza tu WP!" + +#: 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 http://" +msgstr "Por favor, incluya http://" + +#: 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" + diff --git a/lang/SimpleMap-nl_NL.mo b/lang/SimpleMap-nl_NL.mo new file mode 100644 index 0000000..f2fb634 Binary files /dev/null and b/lang/SimpleMap-nl_NL.mo differ diff --git a/lang/SimpleMap-nl_NL.po b/lang/SimpleMap-nl_NL.po new file mode 100644 index 0000000..d065c9a --- /dev/null +++ b/lang/SimpleMap-nl_NL.po @@ -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 \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. Please update!" +msgstr "SimpleMap vereist WordPress 2.8 of nieuwer.AUB update!" + +#: 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 http://" +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" + diff --git a/lang/SimpleMap-pt_BR.mo b/lang/SimpleMap-pt_BR.mo new file mode 100644 index 0000000..ca3f22f Binary files /dev/null and b/lang/SimpleMap-pt_BR.mo differ diff --git a/lang/SimpleMap-pt_BR.po b/lang/SimpleMap-pt_BR.po new file mode 100644 index 0000000..a70525e --- /dev/null +++ b/lang/SimpleMap-pt_BR.po @@ -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 \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. Please update!" +msgstr "SimpleMap requer Wordpress 2.8 ou superior. Por favor, faça update do seu sistema!" + +#: 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 http://" +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" + diff --git a/lang/SimpleMap.mo b/lang/SimpleMap.mo new file mode 100644 index 0000000..642e6b6 Binary files /dev/null and b/lang/SimpleMap.mo differ diff --git a/lang/SimpleMap.pot b/lang/SimpleMap.pot new file mode 100644 index 0000000..68bffb6 --- /dev/null +++ b/lang/SimpleMap.pot @@ -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 \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. Please update!" +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 http://" +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 "" + diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..961822c --- /dev/null +++ b/readme.txt @@ -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 . diff --git a/screenshot-1.png b/screenshot-1.png new file mode 100644 index 0000000..0982e1a Binary files /dev/null and b/screenshot-1.png differ diff --git a/screenshot-2.png b/screenshot-2.png new file mode 100644 index 0000000..42c61bf Binary files /dev/null and b/screenshot-2.png differ diff --git a/screenshot-3.png b/screenshot-3.png new file mode 100644 index 0000000..139fbe0 Binary files /dev/null and b/screenshot-3.png differ diff --git a/screenshot-4.png b/screenshot-4.png new file mode 100644 index 0000000..5c83bf7 Binary files /dev/null and b/screenshot-4.png differ diff --git a/screenshot-5.png b/screenshot-5.png new file mode 100644 index 0000000..f20859b Binary files /dev/null and b/screenshot-5.png differ diff --git a/simplemap.php b/simplemap.php new file mode 100644 index 0000000..cd964f1 --- /dev/null +++ b/simplemap.php @@ -0,0 +1,153 @@ +Please update!', '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 ); +?>